亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pca.m

?? pca程序,一個主分量分析程序,用于提取特征直,歡迎大家下載
?? M
字號:
function [evals,evecs,efuns,edata]=pca(D,meantrend,varnorm,k_rank,method,reportflag)
%PCA - Principal Component Analysis of data matrix
% PCA performs principal component (EOF) analysis on input 
% time series, using either the SVD method or the COVARIANCE
% MATRIX method, depending on the size of the problem. See Emery 
% and Thompson or Preisendorfer for details.
% 
% Input: D - a matrix of observation time series, one series 
% per column. In the case that the columns represent 
% different physical quantities, the varnorm flag below
% can be used to normlize the column variance, by 
% dividing each series by it's demeaned std.
% meantrend - binary flag (0|1) specifying whether (or not)
% to remove mean and linear trends from the column
% data; the default is to remove both mean and
% linear trend.
% varnorm - binary flag (0|1) specifying whether (or not)
% the code should perform variance normaliation
% of the observation matrix D columns. The default
% is NOT to normalize the variance.
% k_rank - number of eigenvalues/vectors/functions to return.
% If k_rank>rank(D), then this option does nothing.
% If k_rank==0, then all eig's are returned; this is
% the default. Inputting k_rank < rank(D) amounts
% to returning the rank-k approximation to the data 
% matrix. k_rank can also be the string 'SIG', which 
% tells the routine to determine the number of 
% statistically signifigant modes and return that
% k_rank approximation. Specifying k_rank to anything 
% other than 0 forces the method to be 'SVD'.
% method - override the method selection; either 'COV','SVD'
% or 'SEL' to let the code select the method
% report - binary flag (0|1) to write a "report" to stdout 
% of the "success" of the analysis. Default is no report. 
%
% Output:
% evals - vector of eigenvalues of the covariance matrix (D'*D)
% evecs - matrix of eigenvectors of the covariance matrix
% efuns - matrix of eigenfunctions (amplitude functions, e.g.)
% edata - k_rank approximation to the data matrix; this matrix
% will only be returned if 0 < k_rank < rank(D).
%
% NOTES: 1) Use COMP_VAR_EL_PARAMS to rotate vector series onto principal
% axes if data resprsents vector series.
%
% Call as: [evals,evecs,efuns]=pca(D);
% OR: [evals,evecs,efuns]=pca(D,meantrend);
% OR: [evals,evecs,efuns]=pca(D,meantrend,varnorm);
% OR: [evals,evecs,efuns,edata]=pca(D,meantrend,varnorm,k_rank);
% OR: [evals,evecs,efuns,edata]=pca(D,meantrend,varnorm,k_rank,method);
% OR: [evals,evecs,efuns,edata]=pca(D,meantrend,varnorm,k_rank,method,report);
%

if nargin==0
disp(' Call as: [evals,evecs,efuns]=pca(D);');
disp(' [evals,evecs,efuns]=pca(D,meantrend);');
disp(' [evals,evecs,efuns]=pca(D,meantrend,varnorm);');
disp(' [evals,evecs,efuns,edata]=pca(D,meantrend,varnorm,k_rank);');
disp(' [evals,evecs,efuns,edata]=pca(D,meantrend,varnorm,k_rank,method);');
disp(' [evals,evecs,efuns,edata]=pca(D,meantrend,varnorm,k_rank,method,report);');
evals=[];evecs=[];efuns=[];
return
end

%% PROCESS INPUT ARGUMENTS
if isstr(D)&strcmp(lower(D),'refs')
disp('Preisendorfer, PCA in Meteorology and Oceanography, Elsevier, 1988.');
disp('Overland and Preisendorfer, Signifigance test for PCA, Monthly Weather Review, 1982.');
disp('Kelly, JPO, 1988');
disp('Emery and Thompson, Data Analysis Methods in Physical Oceanography, 1998.')
evals=[];evecs=[];efuns=[];edata=[];
return
end
if exist('meantrend')
if meantrend~=0 & meantrend~=1
   error('MEANTREND flag to PCA must be 0|1.')
end
else
meantrend=1;
end

if exist('varnorm')
if varnorm~=0 & varnorm~=1
   error('VARNORM flag to PCA must be 0|1.')
end
else
varnorm=0;
end
sig_test='no';
if exist('k_rank')
if isstr(k_rank)
   if ~strcmp(lower(k_rank),'sig')
   error('if K_RANK to PCA is a string, it must be the string ''SIG''.')
   end
sig_test='yes';
end
if k_rank<0
   error('K_RANK to PCA >=0 or the string ''SIG''.')
end
else
k_rank=0;
end

if exist('method')
if ~isstr(method)|((~strcmp(method,'COV'))&...
       (~strcmp(method,'SVD'))&...
       (~strcmp(method,'SEL')))
   error('METHOD to PCA must be ''COV'' or ''SVD'' or ''SEL''')
end
else
method='SEL';
end
if isstr(k_rank),method='SVD';,end
% Check the number of outgoing arguments.
if nargout<4
error('Rank-k data matrix requested, but <4 output arguments provided.')
end

if exist('reportflag')
if reportflag~=0 & reportflag~=1
   error('REPORT flag to PCA must be 0|1.')
end
else
reportflag=0;
end

% Get number of series (spatial points, variables, etc.) (M, 
% column count) and length of observations (N, row count).
% Recall that the observation matrix is input with time
% proceeding down the rows, and location (variables) across the 
% columns
[M,N]=size(D'); % NOTE THE TRANSPOSE !!! 

% The relative sizes of M and N determine whether we compute
% the EOFs from the covariance matrix or whether we use the
% SVD method, unless overridden by user on input. 
if strcmp(method,'SEL')
if M>N
method='SVD';
else
method='COV';
end
end

% Regardless of the method, we form a "data" matrix DT, which is
% de-meaned and linearly de-trended, if the user has specified
% meantrend==1.

DM=D;
if meantrend==1
% Demean data matrix D
if reportflag
disp(' ')
disp(['Before: Mean = ',num2str(mean(D))])
disp(['De-meaning, De-trending data'])
end
[DM,MEAN]=demean(DM);

% Some de-trending needs to happen here; atleast linear removal
% Compute linear trend for each variable
[DM,TRENDCOEFFS]=detrend2(DM);
end

% So far, observations have been de-meaned and linearly
% de-trended. If the observation series
% represent different physical quantities (temp and sal, for 
% example), then the user should have specified varmorm==1, so ...
if varnorm
STD=std(DM);
if reportflag
disp(' ')
disp(['Normalizing variance.'])
disp(['Before: Min STD = ',num2str(min(STD))])
disp([' Max STD = ',num2str(max(STD))])
end
[DM,STDD]=normvar(DM);
if reportflag
STD=std(DM);
disp(['After : Min STD = ',num2str(min(STD))])
disp([' Max STD = ',num2str(max(STD))])
end
end

% At this point, we transpose the data matrix to put the
% time along the columns;
DM=DM';

switch method
case 'COV'
% Form DM times DM-transpose, DDT
DDT=(1/(N-1))*DM*DM';% This is the covariance matrix
flops(0);tic;
[U,d]=eig(DDT);
FLOPS=flops;
TOC=toc;
[evals,iperm]=sort(diag(d));
iperm=flipud(iperm); % Flip to get descending order
evals=flipud(evals); 
evecs=U(:,iperm); % Permute the columns of U
efuns=DM'*evecs;
edata=[]; % Rank-k data cannot be returned if method=='COV'
case 'SVD'
flops(0);tic;
if reportflag,disp('Performing SVD...'),end 
[U,S,V]=svd(DM);
FLOPS=flops;
TOC=toc;
% now, we compute the eigenvalues from the singular values;
% they are the squares of the SVs, scaled by the length of 
% the time series -1, as in the covariance, matrix.
evals=(1/(N-1))*diag(S).^2;
% evecs are in U
evecs=U;
% Eigenfunctions
efuns=V*S';

DMrank=length(diag(S)>eps);

% Rank-k Approximation to the input data matrix
if isstr(k_rank) % then it must be 'SIG', and determine the
% statistically signifigant singular values.
     
if reportflag,disp('Determining signifigance...'),end
% set k_rank according to the following signifigance test.
% The sig. test is based on a Monte Carlo simulation.
% See Overland and Preisendorfer, Monthly Weather Review,
% Jan. '82, Vol. 110, No. 1 for details, and notation.
% Form the normalized eigenvalue statistic:
T=evals/sum(evals); % eqn 1

% Form 100 replicates of a length DMrank by 
% M gaussian random noise matrix
for r=1:100
F=randn(DMrank,M);
delta(r,:)=(eig(F*F'))';
end
for r=1:100
UU(r,:)=delta(r,:)/sum(delta(r,:));
end
for j=1:M
UU(:,j)=sort(UU(:,j));
end
ik=find(T>UU(95,:)');
k_rank=ik(length(ik));
end
if k_rank>0 & (k_rank<=min(M,N))
%return the k_rank approximation to the input data matrix.
edata=(U(:,1:k_rank)*S(1:k_rank,1:k_rank)*V(:,1:k_rank)')';
if varnorm % add back in the std
edata=edata.*(ones(size(edata(:,1)))*STDD);   
end
if meantrend % add back in the means and trends
   tt=(1:length(edata(:,1)))';tt=tt-mean(tt);
   edata=edata+tt*TRENDCOEFFS;
edata=edata+ones(size(edata(:,1)))*MEAN;
end
else % k_rank=0
edata=[];
end
end

if nargout==1 | nargout==0
efuns=[];evecs=[];
elseif nargout==2
efuns=[];
elseif nargout==3
edata=[];
end

if reportflag
disp(' ')
disp(['Method = ' upper(method)]);
disp(['Flops = ' int2str(FLOPS)]);
disp(['O(MNN) = ' int2str(M*N*N)]);
disp(['Time = ' num2str(TOC)]);
disp(['Matrix Rank = ' num2str(DMrank)]);
disp(' ')
if strcmp(sig_test,'yes')
disp(['Signifigant Rank (95%-conf level) = ' int2str(k_rank)])
end
if k_rank>0
disp(['Rank-' int2str(k_rank) ' data matrix approximation returned in 4th output argument.'])
disp(' ')
end
maxerr=max(max(abs(evecs*evecs')-eye(size(evecs))));
disp(['Max error in orthogonality of eigenvectors: ' num2str(maxerr)])
disp(' ')
disp(' Variance Table')
if strcmp(sig_test,'yes')
disp(' (** indicates signifigance)')
end
disp(' Mode E-val %Var ')
nr=min(M,N);
pvar=cumsum(evals)/sum(evals)*100;
for i=1:nr
if i<=k_rank & strcmp(sig_test,'yes')
fprintf(' ** %d %.3f %6.2f\n',[ i evals(i) pvar(i)])
else
fprintf(' %d %.3f %6.2f\n',[ i evals(i) pvar(i)])
end
end
fprintf('Total %.3f\n',sum(evals(1:nr)))
end

%
% Brian O. Blanton
% Department of Marine Sciences
% Ocean Processes Numerical Modeling Laboratory
% 12-7 Venable Hall
% CB# 3300
% University of North Carolina
% Chapel Hill, NC
% 27599-3300
%
% 919-962-4466
% blanton@marine.unc.edu
%
% Summer 1999
% 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人精品二区三区99精品| 国产亚洲综合在线| 久久先锋影音av鲁色资源网| 国产精品萝li| 九一久久久久久| 欧美做爰猛烈大尺度电影无法无天| 精品嫩草影院久久| 亚洲一区二区精品视频| 国产成人综合自拍| 日韩欧美专区在线| 亚洲二区在线视频| 日本韩国精品一区二区在线观看| 亚洲精品一区二区三区蜜桃下载| 亚洲成人777| 91麻豆免费观看| 中文字幕av一区 二区| 卡一卡二国产精品| 666欧美在线视频| 亚洲一区二区三区在线看| 国产精品1024| 久久天天做天天爱综合色| 日本不卡不码高清免费观看| 欧洲av在线精品| 一区二区三区免费观看| 99视频精品免费视频| 国产亚洲婷婷免费| 国产精品一区二区在线观看不卡 | 亚洲综合成人网| av动漫一区二区| 国产精品二区一区二区aⅴ污介绍| 国产一区二区三区黄视频| 日韩亚洲欧美在线观看| 日本欧美久久久久免费播放网| 91黄视频在线| 亚洲午夜久久久久久久久久久| 色哟哟精品一区| 樱花草国产18久久久久| 日本精品视频一区二区三区| 亚洲黄色性网站| 在线观看日韩精品| 水野朝阳av一区二区三区| 欧美精品自拍偷拍动漫精品| 日韩av在线发布| 日韩美女一区二区三区| 精品一区二区影视| 国产亚洲1区2区3区| 成人在线视频首页| 亚洲视频一区二区在线| 91久久一区二区| 日韩福利视频网| 久久九九国产精品| 99久久夜色精品国产网站| 亚洲欧洲综合另类在线| 欧美色欧美亚洲另类二区| 日本在线不卡视频| 久久天天做天天爱综合色| voyeur盗摄精品| 亚洲国产精品久久人人爱蜜臀 | 国产精华液一区二区三区| 国产丝袜美腿一区二区三区| 99久久精品国产导航| 亚洲成a人片在线观看中文| 欧美肥妇free| 国产不卡视频在线播放| 一区二区三区在线免费| 91.com在线观看| 粉嫩欧美一区二区三区高清影视| 国产精品九色蝌蚪自拍| 欧美日韩国产天堂| 国产尤物一区二区在线| 亚洲欧美日韩在线不卡| 日韩欧美一区二区视频| 成人黄页毛片网站| 秋霞成人午夜伦在线观看| 国产精品视频麻豆| 欧美一三区三区四区免费在线看| 国产福利不卡视频| 亚洲1区2区3区4区| 日本一区二区三区免费乱视频| 欧美色偷偷大香| 成人免费av网站| 日韩高清一区二区| 亚洲精品日韩一| 国产日韩欧美高清在线| 欧美欧美欧美欧美首页| 成人国产精品免费观看| 蜜臀av国产精品久久久久| 亚洲中国最大av网站| 欧美高清一级片在线观看| 91精品国产麻豆| 欧美在线观看禁18| caoporen国产精品视频| 国产一区二区三区香蕉| 香蕉影视欧美成人| 一区视频在线播放| 精品国产一区二区精华| 欧美精品777| 欧美在线播放高清精品| 99re热这里只有精品免费视频| 久久99精品国产麻豆婷婷| 亚洲成人av资源| 亚洲在线中文字幕| 亚洲欧美另类小说视频| 国产精品伦一区二区三级视频| 日韩精品一区二区三区swag| 欧美精品乱人伦久久久久久| 91蝌蚪porny九色| 成人av一区二区三区| 高清视频一区二区| 国产精品1024久久| 国产一区二区三区四区五区美女 | 琪琪一区二区三区| 五月婷婷色综合| 亚洲综合成人在线| 亚洲午夜在线视频| 樱花影视一区二区| 亚洲aaa精品| 日韩av电影免费观看高清完整版在线观看| 中文字幕在线观看一区| 国产精品久久久久久户外露出 | 久久精品无码一区二区三区| 精品国产一二三| 2020日本不卡一区二区视频| 欧美不卡一二三| www欧美成人18+| 久久精品日产第一区二区三区高清版 | 日本vs亚洲vs韩国一区三区| 婷婷综合久久一区二区三区| 亚洲18女电影在线观看| 日韩av一级片| 国产在线视频不卡二| 国产乱码精品一区二区三区av| 国产精品91一区二区| 成人av小说网| 欧美日韩日日夜夜| 日韩精品一区国产麻豆| 久久久久久久综合| 亚洲人成影院在线观看| 亚洲国产人成综合网站| 日韩国产成人精品| 国产精品中文有码| 91麻豆产精品久久久久久| 欧美日韩电影一区| 精品福利二区三区| 亚洲欧美中日韩| 三级亚洲高清视频| 国产精品一二二区| 欧美中文字幕亚洲一区二区va在线| 欧美高清性hdvideosex| 久久久久88色偷偷免费| 亚洲激情中文1区| 极品美女销魂一区二区三区免费| 国产成a人无v码亚洲福利| 欧美午夜在线一二页| 欧美r级电影在线观看| 国产精品不卡在线| 久久精品国产一区二区| www.成人在线| 日韩精品一区二区三区四区视频| 中文字幕一区不卡| 老色鬼精品视频在线观看播放| 97久久超碰国产精品| 欧美一区二区三区视频在线| 国产精品三级电影| 久久精品国产成人一区二区三区| 成人的网站免费观看| 日韩欧美在线综合网| 伊人性伊人情综合网| 国产一区不卡在线| 91精品国模一区二区三区| 国产精品成人在线观看| 免费人成黄页网站在线一区二区 | 欧美韩国日本不卡| 日韩av在线发布| 欧美亚洲一区二区在线| 欧美激情一区二区三区四区| 日本午夜精品一区二区三区电影 | 亚洲国产高清aⅴ视频| 免费看欧美女人艹b| 欧日韩精品视频| 国产精品家庭影院| 国产一区激情在线| 欧美一区二区三区色| 亚洲国产日日夜夜| 91看片淫黄大片一级在线观看| 久久久久久亚洲综合| 美女脱光内衣内裤视频久久网站 | 一色屋精品亚洲香蕉网站| 精品一区二区三区在线观看国产| 欧美日韩不卡一区| 亚洲一区二区视频| 欧洲中文字幕精品| 亚洲激情男女视频| 日本精品裸体写真集在线观看| 国产精品免费视频观看| 国产成人av电影在线| 久久九九全国免费| 国产成人免费在线观看| 国产欧美日韩亚州综合| 国产精品综合在线视频|