matlab主成分分析案例_第1頁
matlab主成分分析案例_第2頁
matlab主成分分析案例_第3頁
matlab主成分分析案例_第4頁
matlab主成分分析案例_第5頁
已閱讀5頁,還剩7頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1.設隨機向量X=(X1,X2,X3)T的協(xié)方差與有關系數(shù)矩陣分別為,分別從,出發(fā),求的各主成分以及各主成分的奉獻率并比較差異況。解答:>>S=[14;425];>>[PC,vary,explained]=pcacov(S);總體主成分分析:>>[PC,vary,explained]=pcacov(S)主成分互換矩陣:PC=-0.1602-0.9871-0.98710.1602主成分方差向量:vary=25.64910.3509各主成分奉獻率向量explained=98.65041.3496則由程序輸出成果得出,X的主成分為:Y1=-0.1602X1-0.9871X2Y2=-0.9871X1+0.1602X2兩個主成分的奉獻率分別為:98.6504%,1.3496%;則若用第一種主成分替代本來的變量,信息損失率僅為1.3496,是很小的。2.根據安徽省各地市經濟指標數(shù)據,見表5.2,求解:(1)運用主成分分析對17個地市的經濟發(fā)展進行分析,給出排名;(2)此時能否只用第一主成分進行排名?為何?地區(qū)工業(yè)總產值資產合計工業(yè)增長值實收資本長期負債業(yè)務收入業(yè)務成本利潤合肥491.70380.31158.39121.5422.74439.65344.4417.43淮北21.1230.556.4012.403.3121.1717.712.03亳州1.712.350.570.680.131.481.36-0.03宿州9.839.053.133.430.648.767.810.54蚌埠64.0677.8620.6330.375.9663.5752.154.71阜陽30.3846.909.199.8317.8728.2421.903.80淮南31.2070.078.9318.8833.0531.1726.502.84滁州79.1862.0920.7824.473.5171.2959.076.78六安47.8140.1417.509.524.1445.7034.734.47馬鞍山104.6978.9529.6125.965.3998.0884.813.81巢湖21.0717.836.216.221.9020.2416.461.09蕪湖214.19146.7865.1641.624.39194.98171.9811.05宣城31.1627.568.809.441.4728.8325.221.05銅陵12.7914.163.664.071.5711.9510.240.73池州6.455.372.392.200.405.974.790.52安慶39.4344.6015.1715.723.2736.0327.873.48黃山5.023.621.631.420.534.454.040.02解答:(1)>>clear>>A=[491.70,380.31,158.39,121.54,22.74,439.65,344.44,17.43;21.12,30.55,6.40,12.40,3.31,21.17,17.71,2.03;1.71,2.35,0.57,0.68,0.13,1.48,1.36,-0.03;9.83,9.05,3.13,3.43,0.64,8.76,7.81,0.54;64.06,77.86,20.63,30.37,5.96,63.57,52.15,4.71;30.38,46.90,9.19,9.83,17.87,28.24,21.90,3.80;31.20,70.07,8.93,18.88,33.05,31.17,26.50,2.84;79.18,62.09,20.78,24.47,3.51,71.29,59.07,6.78;47.81,40.14,17.50,9.52,4.14,45.70,34.73,4.47;104.69,78.95,29.61,25.96,5.39,98.08,84.81,3.81;21.07,17.83,6.21,6.22,1.90,20.24,16.46,1.09;214.19,146.78,65.16,41.62,4.39,194.98,171.98,11.05;31.16,27.56,8.80,9.44,1.47,28.83,25.22,1.05;12.76,14.16,3.66,4.07,1.57,11.95,10.24,0.73;6.45,5.37,2.39,2.20,0.40,5.97,4.79,0.52;39.43,44.60,15.17,15.72,3.27,36.03,27.87,3.48;5.02,3.62,1.63,1.42,0.53,4.45,4.04,0.02];得到的有關系數(shù)矩陣為:>>R=corrcoef(A)R=1.00000.98770.99880.98200.42810.99990.99800.95100.98771.00000.98840.99470.54380.98850.98350.94850.99880.98841.00000.98240.42940.99840.99480.94620.98200.99470.98241.00000.50510.98290.97630.93910.42810.54380.42940.50511.00000.43110.42040.45570.99990.98850.99840.98290.43111.00000.99860.95300.99800.98350.99480.97630.42040.99861.00000.95690.95100.94850.94620.93910.45570.95300.95691.0000計算特性值與特性向量:>>[v,d]=eig(corrcoef(A))v=-0.37230.11790.1411-0.2543-0.04590.5917-0.56410.3041-0.3741-0.03430.16060.2247-0.1514-0.6284-0.15350.5841-0.37190.11520.1957-0.1954-0.6909-0.13510.0383-0.5244-0.37130.00960.23680.78750.21680.23850.0303-0.2845-0.1949-0.9689-0.0004-0.12420.01190.06280.0151-0.0593-0.37250.11430.1222-0.23020.09240.22590.79460.2988-0.37160.12720.0353-0.38000.6591-0.3521-0.1557-0.3428-0.36130.0596-0.91850.1165-0.08720.03020.0022-0.0096d=7.1135000000000.7770000000000.0810000000000.0237000000000.0041000000000.0006000000000.0000000000000.0001各主成分奉獻率:>>w=sum(d)/sum(sum(d))w=0.88920.09710.01010.00300.00050.00010.00000.0000計算各個主成分得分:>>F=[A-ones(17,1)*mean(A)]*v(:,8)F=224.3503-24.0409-40.0941-35.90754.7573-12.6102-2.85731.8038-13.901213.4541-29.384762.3383-23.3175-32.4285-38.1309-14.8637-39.1675>>[F1,I1]=sort(F,'descend')F1按從大到小的次序給個主成分得分排名:F1=224.350362.338313.45414.75731.8038-2.8573-12.6102-13.9012-14.8637-23.3175-24.0409-29.3847-32.4285-35.9075-38.1309-39.1675-40.0941I1給出各個名次的序號:I1=1121058769161321114415173>>[F2,I2]=sort(I1)F2=123

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論