Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm using FindFit[] to fit a function to some experimental data. I'd like to know what error bars are on the fitted parameters.

Scipy's curve_fit() returns the optimised parameters along with their covariance matrix - is there anything equivalent for Mathematica? As far as I can tell, there's no mention of it in the documentation.

share|improve this question
2  
You can likely use NonlinearModelFit which is basically FindFit with additional properties and diagnostics including parameter confidence intervals. –  Andy Ross Mar 16 '13 at 23:07
3  

1 Answer 1

up vote 7 down vote accepted

A fit performed using NonlinearModelFit has many properties including "CovarianceMatrix". For example, we can fit the function A 2^(B t) to the data data = {{1, 2.1}, {2, 4.1}, {3, 9.2}} with

nlm = NonlinearModelFit[data, A 2^(B t), {A, B}, t]

which estimates {A -> 0.902745, B -> 1.1148}. We can access the covariance matrix of the estimated parameters using

nlm["CovarianceMatrix"]

yielding {{0.00945806, -0.00530171}, {-0.00530171, 0.00307167}}

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.