版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rè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)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 《水環(huán)境調(diào)查方法》課件
- 2020年安徽省中考英語試卷及答案解析
- 小學(xué)一年級20以內(nèi)加減法試題口算速算練習(xí)題
- 《護士禮儀行為規(guī)范》課件
- 《物業(yè)服務(wù)內(nèi)涵》課件
- 銀銅合金焊接知識點
- 地產(chǎn)建筑行業(yè)技術(shù)工作總結(jié)
- 會計行業(yè)會計人員培訓(xùn)總結(jié)
- 精神科護士的綜合總結(jié)
- 零售業(yè)務(wù)員工作總結(jié)
- 昆明市公交集團車載視頻監(jiān)控平臺升級方案20191025
- 一流課程申報
- 高中體育特長生名校報考路徑分析課件
- 主要建筑材料碳排放因子查詢表
- 建筑施工室內(nèi)裝飾設(shè)計施工圖講解
- 冠寓運營管理手冊
- 耳部銅砭刮痧技術(shù)評分標(biāo)準(zhǔn)
- 玻璃幕墻施工方案幕墻
- 抗精神疾病藥物與麻醉課件
- 數(shù)據(jù)庫原理與應(yīng)用課后習(xí)題答案李春葆 編
- 因公出國教育談話記錄
評論
0/150
提交評論