[scilab-Users] lsqrsolve

Maso Ricci ricci2 at unisi.it
Thu Apr 1 08:43:18 CEST 2010


thanks vincent,

I will try

Best regards


Il 31/03/2010 23.09, vinsz ha scritto:
> On 31/03/2010 11:18, Maso Ricci wrote:
>> Hi,
>>
>> I am using the lsqrsolve function to fit some data.
>> I wonder whether lsqrsolve accepts contrains in order to force the
>> solution to be positive.
>>
>> thanks in advance for any comments and suggestions
>
> A common trick to force a parameter to remain positive is to use the
> exp() function in the solver, for instance:
>
> function er = to_fit(X, m)
> a = exp( X(1) )
> b = X(2)
> [...]
> endfunction
>
> x = lsqrsolve([log(a0), b0], to_fit, N)
> a_fit = exp(x(1))
>
> hope it helps,
> Best regards,
>
>

-- 
----------------------------------------
Maso RICCI PhD
Dipartimento Farmaco Chimico Tecnologico
Università degli Studi di Siena
Via Aldo Moro,2
Siena

phone: +390577234367
email: ricci2 at unisi.it
----------------------------------------



More information about the users mailing list