I-have-a-question-I-am-unsure-how-this-is-done-because-I-have-never-learnt-it-How-do-you-determine-the-line-of-best-fit- Tinku Tara June 3, 2023 Others 0 Comments FacebookTweetPin Question Number 5117 by FilupSmith last updated on 14/Apr/16 Ihaveaquestion.IamunsurehowthisisdonebecauseIhaveneverlearntit.Howdoyoudeterminethelineofbestfit? Commented by Yozzii last updated on 14/Apr/16 Leastsquaresmethodisoneway.Givenasetofnpoints(xi,yi),supposethatthelineofbestfithastheformy=mx+c.Then,foreachxi,wegettheresultyj=mxi+c.Theleastsquaresmethodrequiresthatfortheregressionlineyonx,thequantityQmustbeminimisedwhereQ=∑ni=1(yi−yj)2=∑ni=1(yi−mxi−c)2Thismeansthatweaimtominimisethesquareddistancesbetweenagivenyiandthepointonthelineyjcorrespondingtoxi.Qisafunctionoftwovariablesmandcsinceweassumethat(xi,yi)areknown.Wecanthenemploytechniquesofmultivariablecalculustofindmandc.SinceQisofaquadraticformitsstationaryvalueisaminimumone;in3Dspace,thelocusofpoints(m,c,Q)isabowlsurfacewhereQ⩾0.⇒∂Q∂m=∑ni=1(−2xi)(yi−mxi−c)∂Q∂m=2m(∑ni=1xi2)+2c(∑ni=1xi)−2(∑ni=1xiyi)and∂Q∂c=∑ni=1(−2)(yi−mxi−c)∂Q∂c=2m(∑ni=1xi)+2c(∑ni=11)−2∑ni=1yior∂Q∂c=2m(∑ni=1xi)+2cn−2(∑ni=1yi)Atthestationarypoint,∂Q∂m=0and∂Q∂c=0.Yougetthefollowingresultformfromthesetwoequationsbyeliminatingc.m=n∑ni=1xiyi−(∑ni=1xi)(∑ni=1yi)n∑ni=1xi2−(∑ni=1xi)2Itcanshownthat(x−,y−)=(∑ni=1xin,∑ni=1yin)liesonthelineofbestfit,soccanbefoundfromc=y−−mx−.Theresultofy=mx+cistheleastsquareslineofbestfit.(x−,y−)isthecentroidofallthepoints(xi,yi).mhasanotherform.m=∑ni=1xiyi−nx−y−∑ni=1xi2−n(x−)2. Terms of Service Privacy Policy Contact: info@tinkutara.com FacebookTweetPin Post navigation Previous Previous post: lim-x-pi-2-sin-x-cos-x-tan-x-Next Next post: What-solutions-x-R-exist-for-the-equation-tan-1-x-cot-1-x-n-where-n-Z- Leave a Reply Cancel replyYour email address will not be published. Required fields are marked *Comment * Name * Save my name, email, and website in this browser for the next time I comment.