Re: How to show level of accuracy from original data FROM Re: Coefficients from Fit as a list?

• To: mathgroup at smc.vnet.net
• Subject: [mg63429] Re: How to show level of accuracy from original data FROM Re: [mg63396] Coefficients from Fit as a list?
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Sat, 31 Dec 2005 06:40:26 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```points={{0,-1},{1,2},{3,7},{4,6},{7,9},{11,14}};

model=a*x^2+b*x+c;
param={a,b,c};
var=x;

f[x_]=model/.FindFit[points,model,param,var];

SumOfSq=Total[(f/@points[[All,1]]-points[[All,2]])^2]

6.72994

or

MSE=Mean[(f/@points[[All,1]]-points[[All,2]])^2]

1.12166

Bob Hanlon

>
> From: "Lea Rebanks" <lrebanks at onetelhk.net>
To: mathgroup at smc.vnet.net
> Date: 2005/12/30 Fri AM 03:55:58 EST
> Subject: [mg63429] How to show level of accuracy from original data  FROM  Re:
[mg63396] Coefficients from Fit as a list?
>
> Hi Bob,
>
> When using FindFit to give the best linear approximation to data set
> points. Could you show me a simple example of code / function to show
> level of accuracy / error deviation from original data set.
>
> Many thanks
>
> Lea Rebanks...
>
> -----Original Message-----
> From: Bob Hanlon [mailto:hanlonr at cox.net]
To: mathgroup at smc.vnet.net
> Sent: Friday, December 30, 2005 3:33 PM
> Subject: [mg63429] [mg63414] Re: [mg63396] Coefficients from Fit as a list?
>
> points={{0,-1},{1,2},{3,7},{4,6},{7,9},{11,14}};
>
> Fit[points,{1,x,x^2},x]
>
> -0.0592841*x^2 + 1.89613*x - 0.113262
>
> Reverse@Most@Cases[%,_?NumericQ,Infinity]
>
> {-0.0592841,1.89613,-0.113262}
>
> param={a,b,c};
>
> param/.FindFit[points,a*x^2+b*x+c,param,x]
>
> {-0.0592841,1.89613,-0.113262}
>
> Needs["Statistics`NonlinearFit`"];
>
> param/.(BestFitParameters/.
>       NonlinearRegress[points,
>          a*x^2+b*x+c, x, param])
>
> {-0.0592841,1.89613,-0.113262}
>
>
> Bob Hanlon
>
> >
> > From: "LectorZ" <lectorz at mail.ru>
To: mathgroup at smc.vnet.net
> > Date: 2005/12/29 Thu AM 02:57:28 EST
> > Subject: [mg63429] [mg63414] [mg63396] Coefficients from Fit as a list?
> >
> > Hi there,
> >
> > How can I store the coefficients from the Fit function as a list?
> >
> > Thanks,
> >
> > LZ
> >
> >
>
>
>
>

```

• Prev by Date: Re: Piecewise Integration Woes
• Next by Date: Re: Mathematica Programmer vs. Programming in Mathematica/ functions and OOP
• Previous by thread: How to show level of accuracy from original data FROM Re: Coefficients from Fit as a list?
• Next by thread: Re: How to show level of accuracy from original data FROM Re: Coefficients from Fit as a list?