[Maxima] lsquares fitting and constrains for parameters (looking for positive values of parameters)
Raymond Toy
toy.raymond at gmail.com
Mon Jan 16 12:27:49 CST 2012
On Mon, Jan 16, 2012 at 9:19 AM, <gwpublic at wp.pl> wrote:
> > If you do not need a symbolic solution,
>
> You're right. I need concrete values. (I've forgot to say it in
> problem statement).
>
> > you might be interested in
> > fmin_cobyla, which will produce the minimum of a function subject to
> > equality or inequality constraints.
>
> fmin_cobyla, I haven't knew about it. (btw. I see it's implemented in
> Scipy as well.)
>
> I try to figure out how to make it to obey constraints, with no
> success. Results are not positive, and even worse than
> lsquares_estimate.
>
> As I doing sth wrong ?
> Or sum equations are not fmin_cobyla's purpose, are they ?
>
>
>From what I can see, you're doing everything correctly. I have noticed
that fmin_cobyla is sensitive to the initial guess. With your example,
fmin_cobyla does return positive values for the parameters, except a3,
which is very small and slightly negative.
It's also possible that by giving a too-complicated expression makes cobyla
less efficient. Just from looking at the data matrix, it's clear that the
relationship is linear (difference each y value is a constant).
Perhaps a better example would be a real cubic with some noise added to the
y values.
Ray
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20120116/996941e4/attachment-0001.html>
More information about the Maxima
mailing list