mpc.m
来自「多通道奇异谱分析程序」· M 代码 · 共 39 行
M
39 行
function [A]=mpc(X,E)
% Syntax: [A]=mpc(X,E);
% This function calculates the MSSA principal components of the data
% matrix X from the eigenfunction matrix E (from MSSAEIG).
% The eigenvector matrix may be of reduced size (k columns) - one
% PC will be calculated for each supplied eigenvector.
%
% Output: A - principal components matrix (N-M+1 x k)
%
% See section 2.4 of Vautard, Yiou, and Ghil, 1992, Physica D 58, 95-126;
% and Plaut and Vautard, 1994, J. Atm. Sciences 51, 210-236.
%
% Written by Eric Breitenberger. Version date 1/11/96
% Please send comments and suggestions to eric@gi.alaska.edu
[N,L]=size(X);
[M,k]=size(E);
M=M/L; % Calculate the *actual* value for M
if k>L*M, error('Improper specification of k.'), end
A=zeros(N,k);
a=zeros(N,L);
Ej=zeros(M,L);
for K=1:k
Ej(:)=E(:,K);
Ej=flipud(Ej);
for j=1:L
a(:,j)=filter(Ej(:,j),1,X(:,j));
end
if L>1
A(:,K)=sum(a')';
else
A(:,K)=a;
end
end
A=A(M:N,:);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?