




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
ReviewofLinearAlgebra
IntroductiontoMatlabMachineLearningGroup
Fall2014OutlineLinearAlgebraBasicsMatrixCalculusSingularValueDecomposition(SVD)EigenvalueDecompositionLow-rankMatrixInversionMatlabessentialsBasicconceptsVectorinRnisanorderedsetofnrealnumbers.e.g.v=(1,6,3,4)isinR4Acolumnvector:Arowvector:m-by-nmatrixisanobjectinRmxnwithmrowsandncolumns,eachentryfilledwitha(typically)realnumber:BasicconceptsVectornorms:Anormofavector||x||isinformallyameasureofthe“l(fā)ength”ofthevector.Commonnorms:L1,L2(Euclidean)LinfinityBasicconceptsVectordot(inner)product:Vectorouterproduct:WewilluselowercaselettersforvectorsTheelementsarereferredbyxi.Ifu?v=0,||u||2!=0,||v||2!=0
uandvareorthogonalIfu?v=0,||u||2=1,||v||2=1
uandvareorthonormalBasicconceptsMatrixproduct:Wewilluseuppercaselettersformatrices.TheelementsarereferredbyAi,j.e.g.Specialmatricesdiagonalupper-triangulartri-diagonallower-triangularI(identitymatrix)BasicconceptsTranspose:Youcanthinkofitas“flipping”therowsandcolumns OR“reflecting”vector/matrixonlinee.g.Linearindependence(u,v)=(0,0),i.e.thecolumnsarelinearlyindependent.Asetofvectorsislinearlyindependentifnoneofthemcanbewrittenasalinearcombinationoftheothers.Vectorsv1,…,vkarelinearlyindependentifc1v1+…+ckvk=0impliesc1=…=ck=0e.g.x3=?2x1+x2SpanofavectorspaceIfallvectorsinavectorspacemaybeexpressedaslinearcombinationsofasetofvectorsv1,…,vk,thenv1,…,vk
spansthespace.Thecardinalityofthissetisthedimensionofthevectorspace.Abasisisamaximalsetoflinearlyindependentvectorsandaminimalsetofspanningvectorsofavectorspace(0,0,1)(0,1,0)(1,0,0)e.g.RankofaMatrixrank(A)(therankofam-by-nmatrixA)isThemaximalnumberoflinearlyindependentcolumns=Themaximalnumberoflinearlyindependentrows=Thedimensionofcol(A)=Thedimensionofrow(A)IfAisnbym,thenrank(A)<=min(m,n)Ifn=rank(A),thenAhasfullrowrankIfm=rank(A),thenAhasfullcolumnrankInverseofamatrix
InverseofasquarematrixA,denotedbyA-1istheuniquematrixs.t.AA-1=A-1A=I(identitymatrix)
IfA-1andB-1exist,then(AB)-1=B-1A-1,(AT)-1=(A-1)T
FororthonormalmatricesFordiagonalmatricesDimensionsByThomasMinka.OldandNewMatrixAlgebraUsefulforStatisticsExamples/
SingularValueDecomposition
(SVD)AnymatrixAcanbedecomposedasA=UDVT,whereDisadiagonalmatrix,withd=rank(A)non-zeroelements ThefistdrowsofUareorthogonalbasisforcol(A)ThefistdrowsofVareorthogonalbasisforrow(A)ApplicationsoftheSVDMatrixPseudoinverseLow-rankmatrixapproximationEigenValueDecompositionAnysymmetricmatrixAcanbedecomposedasA=UDUT,where
Disdiagonal,withd=rank(A)non-zeroelementsThefistdrowsofUareorthogonalbasisforcol(A)=row(A)Re-interpretingAb
Firststretchbalongthedirectionofu1byd1timesThenfurtherstretchitalongthedirectionofu2byd2timesLow-rankMatrixInversionInmanyapplications(e.g.linearregression,Gaussianmodel)weneedtocalculatetheinverseofcovariancematrixXTX(eachrowofn-by-mmatrixXisadatasample)Ifthenumberoffeaturesishuge(e.g.eachsampleisanimage,#samplen<<#featurem)invertingthem-by-mXTXmatrixbecomesanproblemComplexityofmatrixinversionisgenerallyO(n3)Matlabcancomfortablysolvematrixinversionwithm=thousands,butnotmuchmorethanthatLow-rankMatrixInversion
WiththehelpofSVD,weactuallydoNOTneedtoexplicitlyinvertXTXDecomposeX=UDVTThenXTX=VDUTUDVT=VD2VTSinceV(D2)VTV(D2)-1VT=IWeknowthat(XTX)-1=V(D2)-1VTInvertingadiagonalmatrixD2istrivial/
BasicsDerivativesDecompositionsDistributions…MATrixLABoratoryMostlyusedformathematicallibrariesVeryeasytodomatrixmanipulationinMatlabIfthisisyourfirsttimeusingMatlabStronglysuggestyougothroughthe“GettingStarted”partofMatlabhelpManyusefulbasicsyntaxMakingArrays%Asimplearray>>[12345]ans:12345>>[1,2,3,4,5]ans:12345>>v=[1;2;3;4;5]v=12345
>>v’ ans:12345>>1:5ans:12345>>1:2:5ans:135>>5:-2:1ans:531>>rand(3,1)ans:0.03180.27690.0462MakingMatrices%Allthefollowingareequivalent>>[123;456;789]>>[1,2,3;4,5,6;7,8,9]>>[[12;45;78][3;6;9]]>>[[123;456];[789]]ans: 123 456 789MakingMatrices%Creatingallones,zeros,identity,diagonalmatrices>>zeros(rows,cols)>>ones(rows,cols)>>eye(rows)>>diag([123])%CreatingRandommatrices>>rand(rows,cols)%Unif[0,1]>>randn(rows,cols)%N(0,1)%Make3x5withN(1,4)entries>>2*randn(3,5)+1%Getthesize>>[rows,cols]=size(matrix);AccessingElementsUnlikeC-likelanguages,indicesstartfrom1(NOT0)>>A=[123;456;789]ans: 123 456 789%AccessIndividualElements>>A(2,3)ans:6%Access2ndcolumn(:meansallelements)>>A(:,2)ans: 2 5 8AccessingElementsA= 123 456 789Matlabhascolumn-order>>A([1,3,5]) ans:175>>A([1,3],2:end)ans: 23 89>>A(A>5)=-1ans: 123 45-1 -1-1-1>>A(A>5)=-1ans:7869>>[ij]=find(A>5)i=3j= 13 22 33 3MatrixOperationsA= 123 456 789>>A+2*(A/4)ans: 1.50003.00004.5000 6.00007.50009.0000 10.500012.000013.5000>>A./Aans: 111 111 111>>A’>>A*AissameasA^2>>A.*B>>inv(A)>>A/B,A./B,A+B,…%SolvingSystems(A+eye(3))\[1;2;3]%inv(A+eye(3))*[1;2;3]ans: -1.0000 -0.0000 1.0000PlottinginMatlab%LetsplotaGauss
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 18文言文二則《囊螢夜讀》教學(xué)設(shè)計-2024-2025學(xué)年統(tǒng)編版語文四年級下冊
- Unit 4 My body(單元整體教學(xué)設(shè)計)-2024-2025學(xué)年科普版(2024)英語三年級上冊
- 1《小小科學(xué)家》(教學(xué)設(shè)計)-2024-2025學(xué)年科學(xué)一年級上冊蘇教版
- 7 讓弦發(fā)出高低不同的聲音 教學(xué)設(shè)計-2024-2025學(xué)年科學(xué)四年級上冊教科版
- Unit1 Lesson1 I'm from Britain(教學(xué)設(shè)計)-四年級英語下冊同步備課系列(魯科版五四制三起)
- 5風(fēng)兒輕輕吹第二課時(教學(xué)設(shè)計)2023-2024學(xué)年統(tǒng)編版道德與法治一年級下冊
- 《Module 6 Unit 1 You can play football well.》(教學(xué)設(shè)計)-2024-2025學(xué)年外研版(三起)英語五年級上冊
- 2生活與百分數(shù) 教學(xué)設(shè)計-2023-2024學(xué)年六年級下冊數(shù)學(xué)人教版
- Unit 2 My Schoolbag A Lets learn (教學(xué)設(shè)計)-2024-2025學(xué)年人教PEP版英語四年級上冊
- 《習(xí)作例文:鯨》教學(xué)設(shè)計-2024-2025學(xué)年語文五年級上冊統(tǒng)編版
- 小米創(chuàng)始人雷軍的創(chuàng)業(yè)經(jīng)歷
- 海南中維生物科技有限公司 蝗蟲微孢子蟲生物制劑項目 環(huán)評報告
- 2024年上海外服招聘筆試參考題庫附帶答案詳解
- 急診預(yù)檢分診標準
- 高等職業(yè)學(xué)校建設(shè)標準(2022年版)
- 人防工程偽裝防護技術(shù)規(guī)范
- 高中物理分層教學(xué)實施方案
- 大學(xué)英語四級閱讀理解精讀100篇
- 思想道德與法治2023版第三章繼承優(yōu)良傳統(tǒng) 弘揚中國精神專題4第1講 教學(xué)設(shè)計
- 中石油職稱俄語
- 七年級歷史下冊(人教版1-5課)測試題
評論
0/150
提交評論