




版權(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)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 天津2025年天津市農(nóng)業(yè)科學(xué)院招聘工作人員(第二輪)筆試歷年參考題庫附帶答案詳解
- 河套學(xué)院《裝飾工程管理與現(xiàn)場實訓(xùn)》2023-2024學(xué)年第二學(xué)期期末試卷
- 天津商業(yè)大學(xué)寶德學(xué)院《環(huán)境研究法》2023-2024學(xué)年第二學(xué)期期末試卷
- 長白山職業(yè)技術(shù)學(xué)院《專業(yè)綜合實踐2(智能電子系統(tǒng)設(shè)計與制作)》2023-2024學(xué)年第二學(xué)期期末試卷
- 山東財經(jīng)大學(xué)燕山學(xué)院《中醫(yī)學(xué)基礎(chǔ)1》2023-2024學(xué)年第二學(xué)期期末試卷
- 撫順職業(yè)技術(shù)學(xué)院《建筑制圖與AutoCAD》2023-2024學(xué)年第二學(xué)期期末試卷
- 烏蘭察布醫(yī)學(xué)高等??茖W(xué)?!痘蚬こ讨扑帯?023-2024學(xué)年第二學(xué)期期末試卷
- 四川工商學(xué)院《材料成型裝備及自動化》2023-2024學(xué)年第二學(xué)期期末試卷
- 廊坊職業(yè)技術(shù)學(xué)院《產(chǎn)品設(shè)計表達基礎(chǔ)》2023-2024學(xué)年第二學(xué)期期末試卷
- 上海師范大學(xué)天華學(xué)院《電子電路基礎(chǔ)實驗(下)》2023-2024學(xué)年第二學(xué)期期末試卷
- 重型自卸車貨箱與舉升裝置設(shè)計(含CAD圖紙)
- 內(nèi)蒙古煤礦豎井地質(zhì)勘察施工技術(shù)
- 周1530安全教育記錄(2021至2022)
- 物料管理入門部分真題含答案
- 德育主題班會課件 飄揚紅領(lǐng)巾 光榮少先隊
- 大學(xué)生安全教育智慧樹知到答案章節(jié)測試2023年中國海洋大學(xué)
- 初中英語-Module 12 Unit 2 Repeat these three words dailyreduce,reuse and recycle.教學(xué)課件設(shè)計
- 西南大學(xué)藥物化學(xué)課件-第5章 前藥原理
- 建筑工程技術(shù)畢業(yè)論文設(shè)計
- (小升初數(shù)學(xué)專題)應(yīng)用題分類總復(fù)習(xí)
- 草原生態(tài)保護補助獎勵機制資金管理辦法
評論
0/150
提交評論