ar1eof.m

来自「蒙托卡罗模拟奇异谱分析」· M 代码 · 共 27 行

M
27
字号
function [E,L,C]=ar1eof(g,a,mu2,M)
% AR1EOF - theoretical SSA EOFs for AR(1) process.
% Syntax: [E,L,C]=ar1eof(g,a,mu2,M);
%
% Given the autocorrelation (g), noise variance (a), and
% expected square on the mean (mu2) parameters for a
% theoretical AR(1) process, and the SSA embedding 
% dimension M, AR1EOF computes the EOFs and eigenspectrum
% for the process.
%
% Written by Eric Breitenberger.      Version 2/22/96
% Please send comments and suggestions to eric@gi.alaska.edu       
%

if g~=0 % (red noise)
  gk=0:M-1;
  gk=g.^gk;
  gk=gk-mu2;
  C=(a^2/(1-g^2))*toeplitz(gk);
else % (white noise)
  C=(a^2/(1-g^2))*(1-mu2)*eye(M);
end
[E,L]=eig(C);
[L,i]=sort(-diag(L));
L=-L';
E=E(:,i);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?