Error values from a Fit

The new Python API for fit functions is very useful. After a Fit it returns a function object filled in with the fitted parameters. However the error bars from the fit are not available here (as far as I can tell). It’s still necessary to generate the Parameters table and then open and process it. Should the errors be saved in the function object and be able to be extracted from that?

Hi James,

Thanks for the question - I’ll ask around and see if there is an answer. It seems to me that it would be useful for the errors to be returned on the same object as the fit parameters.

Cheers,

Keith

Hi James,

Further to this. The object returned by fitting has a method called getError(i), where i is either the parameter name, or its index. Hopefully, that should do what you want.

Cheers

Keith

Thanks Keith, that does work. It just needs to be documented here where I and others might expect to look: http://docs.mantidproject.org/nightly/concepts/FitFunctionsInPython.html#fitfunctionsinpython
or http://docs.mantidproject.org/nightly/api/python/mantid/fitfunctions.html

Just noticed: if I remove the “CreateOutput=True” from the call to Fit(), the getError() returns zero instead of the error value from the fit. I would have expected that as I no longer need to look in xx_Parameters for errors, there’s no need to generate it.

Hi James,

The docs have been updated, hopefully this will be in the online docs in a few days. Thanks for pointing this out.

Cheers

Keith