[SciPy-User] Non-linear parameter optimization without least-squares

Geordie McBain gdmcbain at freeshell.org
Wed Dec 4 18:02:05 EST 2013


2013/12/5 Ryan Nelson <rnelsonchem at gmail.com>:
> If you know that leastsq squares and sums the return value from your error
> function, perhaps you could just modify the return value.
>
> def error(params, xi, yi):
>     y0 = f(params, x0)
>     return ( np.abs(yi - y0) )**0.5
>
> This is probably really bad from a statistical point of view, but I guess it
> does what you want. I don't know if any of the other functions will use the
> absolute deviation.

Least absolute deviation is a special case of quantile regression; I
don't know of any function in SciPy to do this, but there is
statsmodels.regression.quantile_regression.QuantReg.

  http://statsmodels.sourceforge.net/devel/generated/statsmodels.regression.quantile_regression.QuantReg.html



-- 
G. D. McBain

Theory of Lift - Introductory Computational Aerodynamics in MATLAB/Octave
Out now - http://www.wileyeurope.com/remtitle.cgi?111995228X



More information about the SciPy-User mailing list