⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pc.m

📁 不同算法对时间序列进行奇异谱分解的源程序代码
💻 M
字号:
  function [A]=pc(x, E)
% PC - calculates principal components
%    Syntax: [A]=pc(x, E); 
%  PC calculates the principal components of the series x
%  from the eigenfunction matrix E (output from SSAEIG).
%  Returns:      A - principal components matrix (N-M+1 x M)
%  See section 2.4 of Vautard, Yiou, and Ghil, Physica D 58, 95-126, 1992.
%
%  Written by Eric Breitenberger.    Version date 5/20/95
%  Please send comments and suggestions to eric@gi.alaska.edu   
%
[N,col]=size(x);
if min(N,col)>1, error('x must be a vector.'), end
if col>1, x=x'; N=col; end     % convert x to column if necessary.
x=x-mean(x);

[M,c]=size(E);                
if M~=c, error('E is improperly dimensioned'), end
A=zeros(N-M+1,M);
% This could be rewritten using 'filter', like MPC .
for i=1:N-M+1;                 
  w=x(i:i+M-1);          
  A(i,:)=w'*E;
end


⌨️ 快捷键说明

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