Re: Extracting parameters from NonlinearFit
- To: mathgroup@smc.vnet.net
- Subject: [mg11918] Re: Extracting parameters from NonlinearFit
- From: Allan Hayes <hay@haystack.demon.co.uk>
- Date: Thu, 9 Apr 1998 00:33:21 -0400
- References: <6g4qs6$osk$2@dragonfly.wolfram.com>
Jeff Wank wrote
> Recently I began writing a program to do a monte carlo simulation of an
> NMR experiment. The whole routine is attached (I hope that works.) The
> problem is this:
> I perform a NonlinearFit utilizing an exponential function of the form
> Exp[-a*x]. The nonlinear fit gives me back an equation, something like
> 1*E(-a*x). I want to extract the a parameter out of the equation
Jeff,
NonlinearRegress giveve more information then NonlinearFit, inlcuding
replacement rules for the parameters.
<<Statistics`NonlinearFit`
Example
data =Table[{t,3.2*Exp[-0.5*t] +(Random[]-.5)}, {t,0,2,.2}];
BestFitParameters/.NonlinearRegress[data, a Exp[b t], {t},{a,b},
RegressionReport -> BestFitParameters]
{a -> 3.16783, b -> -0.512375}
f[t_]= a Exp[b t]/.%
3.16783
-----------
0.512375 t
E
--
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642