《数据库文化基础 (8).pdf》由会员分享,可在线阅读,更多相关《数据库文化基础 (8).pdf(14页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Least Squares4thweek/Linear AlgebraObjectives of This Week2The goal is to understandLeast squaresDerivation of least squares solutionNormal equation3Back to Over-Determined System Lets start with the original problem:Using the inverse matrix,the solution is =0.42020Person IDWeightHeightIs_smokingLif
2、e-span160kg5.5ftYes(=1)66265kg5.0ftNo(=0)74355kg6.0ftYes(=1)78605.51655.00556.01123=667478x =x =Lets add one more example:Now,lets use the previous solution =0.42020 x =x =4Back to Over-Determined System605.51655.0055506.05.010123=66747872605.51655.0055506.05.0110.42020=667478606674787200012x x Erro
3、rs Person IDWeightHeightIs_smokingLife-span160kg5.5ftYes(=1)66265kg5.0ftNo(=0)74355kg6.0ftYes(=1)78450kg5.0ftYes(=1)725Back to Over-Determined System How about using slightly different solution =0.12169.5?605.51655.0055506.05.0110.12169.5=71.372.279.964.5667478725.31.81.97.5x x Errors 6Which One is
4、Better Solution?605.51655.0055506.05.0110.42020=667478606674787200012605.51655.0055506.05.0110.12169.5=71.372.279.964.5667478725.31.81.97.5x x Errors 605.51655.0055506.05.0110.12169.5=71.372.279.964.5667478725.31.81.97.57Least Squares:Best Approximation Criterion Lets use the squared sum of errors:x
5、 x 605.51655.0055506.05.0110.42020=667478606674787200012Better solutionErrorsSum of squared errors02+02+02+122 0.5=125.32+1.82+1.92+7.520.5=9.558Least Squares Problem Now,the sum of squared errors can be represented as .Definition:Given an overdetermined system where ,and ,a least squares solution i
6、s defined as =argmin The most important aspect of the least-squares problem is that no matter what x we select,the vector will necessarily be in the column space Col.Thus,we seek for x that makes as the closest point in Col to.The vector is closer to than to for other.Col To satisfy this,the vector
7、should be orthogonal to Col.This means should be orthogonal to any vector in Col:1a a1+2a a2+a afor any vector 9Geometric Interpretation of Least Squares 1 2 1 =02 =0 =0 =010Geometric Interpretation of Least Squares 1a a1+2a a2+a afor any vector Or equivalently,Col 11Normal Equation Finally,given a
8、least squares problem,we obtain =,which is called a normal equation.This can be viewed as a new linear system,=,where a square matrix =,and =.If =is invertible,then the solution is computed as =112Life-Span Example The normal equation =is606555505.55.06.05.01011605.51655.0055506.05.011123=606555505.
9、55.06.05.01011667478721335012351651235116.2516.516516.53123=166001561216605.51655.0055506.05.011123=66747872x x Person IDWeightHeightIs_smokingLife-span160kg5.5ftYes(=1)66265kg5.0ftNo(=0)74355kg6.0ftYes(=1)78450kg5.0ftYes(=1)7213Life-Span Example Finally,the solution is obtained:123=1335012351651235116.2516.516516.531166001561216=0.152316.58410.833 Now,the life-span can be approximately written as(life-span)0.1523(weight)+16.584(height)10.833(is_smoking)Least squaresDerivation of least squares solutionNormal equationSummary