版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(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等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 幼兒園月教學(xué)計(jì)劃模板
- 醫(yī)院護(hù)士年度計(jì)劃范本
- 大班表演游戲計(jì)劃
- 農(nóng)村綜治宣傳月的工作計(jì)劃
- 度班組長工作計(jì)劃
- 客服員工作計(jì)劃
- 《GDP與GNP的區(qū)別》課件
- 醫(yī)院醫(yī)保年終工作計(jì)劃總結(jié)
- 《行為應(yīng)用分析》課件
- 2020版 滬教版 高中音樂 必修1 音樂鑒賞 下篇《第八單元 不忘初心》大單元整體教學(xué)設(shè)計(jì)2020課標(biāo)
- 人美版初中美術(shù)知識(shí)點(diǎn)匯總八年級(jí)全冊(cè)
- 公路路面畢業(yè)論文中英文資料外文翻譯文獻(xiàn)
- 區(qū)域經(jīng)理崗位職責(zé)
- 臨建施工方案1
- 訓(xùn)練及產(chǎn)說改鑫瑞發(fā)布會(huì)流程
- 產(chǎn)業(yè)園EPC總承包工程項(xiàng)目施工組織設(shè)計(jì)
- 大學(xué)生安全教育智慧樹知到答案章節(jié)測(cè)試2023年中國海洋大學(xué)
- 學(xué)校安全教育珍愛生命-拒絕打架斗毆課件
- YY/T 0698.7-2009最終滅菌醫(yī)療器械包裝材料第7部分:環(huán)氧乙烷或輻射滅菌無菌屏障系統(tǒng)生產(chǎn)用可密封涂膠紙要求和試驗(yàn)方法
- GB/T 40276-2021柔巾
- GB/T 3750-2008卡套式鉸接管接頭
評(píng)論
0/150
提交評(píng)論