MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Non-linear Rgression

  • To: mathgroup at
  • Subject: [mg71637] Re: Non-linear Rgression
  • From: Bill Rowe <readnewsciv at>
  • Date: Sat, 25 Nov 2006 05:37:18 -0500 (EST)

On 11/24/06 at 1:17 AM, amin67r at (aminr) wrote:

>Hello, I'm a physics student.I have done an experiment .I want to
>use Mathematica , I found a problem in using it :

>for example I have data ={ {0,0},{1,2},{3,6}}  and I want to fit
>them for a equation such as " y=Log[Cosh[a*x]] " so I want the value
>of parametre"a" and also its error(i.e. a=0.045+- 0.05  then error
>is 0.05 )
>and also the regression (i.e. R=0.995  )
>please ,please , tell me how I can do it ?

If only the best fit parameters are needed, then the built in 
function FindFit does what you need.

For example;


FindFit[data,Log[Cosh[a x]],{a},x]

{a -> 2.2753570110148678}

To easily get confidence intervals etc, the best choice would be 
to use the non-linear regression package that is part of the 
standard add ons. That is:


NonlinearRegress[data, Log[Cosh[a*x]], x, {a},
   RegressionReport -> {BestFitParameters,
     ParameterCITable, AsymptoticCorrelationMatrix}]

{BestFitParameters -> {a -> 2.2753570110148678},
   ParameterCITable -> TableForm[
     {{"", "Estimate", "Asymptotic SE", "CI"},
      {a, 2.2753570110148678, 0.09599842662397484,
       {1.8623091186495693, 2.6884049033801674}}},
     TableDepth -> 2, TableHeadings ->
      {{a}, {"Estimate", "Asymptotic SE", "CI"}}],
   AsymptoticCorrelationMatrix -> MatrixForm[{{1.}}]}

Note a variety of fit statistics are available when using 
NonlinearRegress. See the documentation for details.
To reply via email subtract one hundred and four

  • Prev by Date: Re: pattern matching: rules that stop other rules?
  • Next by Date: Re: AGAIN Nested while loop!!!
  • Previous by thread: Re: Non-linear Rgression
  • Next by thread: dynamic Blocking and thread safeness (in general)