《主成分分析matlab源程序代码(最新整理)》由会员分享,可在线阅读,更多相关《主成分分析matlab源程序代码(最新整理)(3页珍藏版)》请在人人文库网上搜索。
1、dataset=263.8621.611442.754680.266575268.7642.072182.617560.182597261.1961.597692.350370.182114248.7082.096092.852790.257724253.3651.694572.94920.189702268.4341.568192.781130.13252258.7412.146532.691110.136469244.1922.021562.226070.298066219.7381.612241.885990.166298244.7021.914772.259450.187569245.。
2、2862.124992.352820.161602251.961.837142.535190.240271251.1641.741672.629610.211887251.8242.001332.626650.211991257.682.148782.656860.203846stdr=std(dataset);%求个变量的标准差n,m=size(dataset);%定义矩阵行列数sddata=dataset./stdr(ones(n,1),:);%将原始数据采集标准化sddata%输出标准化数据p,princ,eigenvalue,t2=princomp(sddata);%调用前三个主成分系。
3、数p3=p(:,1:3);%提取前三个主成分得分系数,通过看行可以看出对应的原始数据的列,每个列在每个主成分的得分p3sc=princ(:,1:3); sce=eigenvalue(1:3);%输出前三个主成分得分系数%提取前三个主成分得分值%输出前三个主成分得分值%提取前三个特征根并转置M=e(ones(m,1),:).0.5;%输出前三个特征根并转置compmat=p3.*M;%利用特征根构造变换矩阵per=100*eigenvalue/sum(eigenvalue);%求出成分载荷矩阵的前三列per%求出各主成分的贡献率cumsum(per);%列出各主成分的累积贡献率figure(1)。
4、pareto(per);%将贡献率绘成直方图t2figure(2)%输出各省与平局距离plot(eigenvalue,r+);%绘制方差贡献散点图hold on%保持图形plot(eigenvalue,g-);%绘制方差贡献ft麓图figure(3)%关闭图形plot(princ(:,1),princ(:,2),+);%绘制 2 维成份散点图%gname%,(rowname)%标示个别散点代表的省 data 市st2,index=sort(t2);%st2=flipud(st2);%index=flipud(index);%extreme=index(1);“”“”At the end, Xi。
5、ao Bian gives you a passage. Minand once said, people who learn to learn are very happy people. In every wonderful life, learning is an eternal theme. As a professional clerical and teaching position, I understand the importance of continuous learning, life is diligent, nothing can be gained, only c。
6、ontinuous learning can achieve better self. Only by constantly learning and mastering the latest relevant knowledge, can employees from all walks of life keep up with the pace of enterprise development and innovate to meet the needs of the market. This document is also edited by my studio professionals, there may be errors in the document, if there are errors, please correct, thank you。