lsquares fitting and constrains for parameters (looking for positive values of parameters)



On 1/17/12, gwpublic at wp.pl <gwpublic at wp.pl> wrote:

> So instead of fitting with lsquares_estimate expression like this:
> a*x^4 + b*x^3 + d*x + e
> I fit expression with all parameters after "abs" :
> abs(a)*x^4 + abs(b)*x^3 + abs(d)*x + abs(e)

Since abs is not differentiable at 0, that could cause some trouble,
because lsquares_estimate eventually calls a function (lbfgs)
which works only for differentiable functions. (I don't remember
how many continuous derivatives lbfgs requires. I'll guess it's 2
but I'd have to look it up.)

Anyway instead of abs(a)*x you could try a^2*x instead.

best

Robert Dodier