[SciPy-User] How to fit data with errorbars
Tue Feb 16 22:36:53 CST 2010
On Tue, Feb 16, 2010 at 11:18 PM, Nathaniel Smith <firstname.lastname@example.org> wrote:
> On Tue, Feb 16, 2010 at 7:48 PM, <email@example.com> wrote:
>> I didn't realize that it is a problem linear in parameters if the
>> objective is to fit a polynomial.
> I dunno, I'm just going off a quick glance at the documentation for
> "polyfit", which the OP wanted to use in the first place :-).
>> Essentially the same calculations are done in statsmodels.WLS plus
>> you get additional results and test statistics.
>> something like
>> wls_results = scikits.statsmodels.WLS(Y, np.vander(X,2), weights=1/stddevs)
>> example in statsmodels\examples\tut_ols_wls.py
> Yeah, using real statistics code is always a better idea when
> available. (Actually, I would use R for this. Don't tell anyone!)
But it's more fun trying to figure out how to do it in python than how
to do it in R or rpy.
(But maybe not so much if I have to figure out both for doing the
validation tests. I've seen that your incremental_ls also uses R only
for validation and not for the heavy duty stuff.)
> -- Nathaniel
> SciPy-User mailing list
More information about the SciPy-User