lsquares



Hi,

Robert Dodier wrote:
>
> Yes, if I understand correctly, you can construct a combined MSE
> and then minimize that, something like:
>
>   mse1 : lsquares_mse (data1, [a, b, c, d], equation1);
>   mse2 : lsquares_mse (data2, [a, b, c, d], equation2);
>   lsquares_estimates_approximate (mse1 + mse2, [a, b, c, d], ...);
>
> Well, if data1 and data2 have different numbers of rows I guess you
> want something like n1/(n1 + n2)*mse1 + n2/(n1 + n2)*mse2 for the
> combined MSE.
>
>   
Yes, this is exactly what I was looking for - thanks.

>>  2) Are there routines to calculate r^2, covariance matrix, standard
>>  error estimates ?
>>     
>
> r^2 you can obtain from lsquares_residual_mse.
>
> There aren't any built-in functions for the covariance matrix or
> standard error estimates.
> I 'll put those on my to-do list (should be straightforward).
>
>   
Of course, one can compute these separately but they are often needed in 
least squares fitting and would be handy to have as preprogrammed functions.

>>          debug, neqs, i, sq, tmp, lbfgs_nfeval_max:1000, /* BFGS tends
>>  to converge somewhat slowly... */
>>     
>
> Do you want to suggest another minimization algorithm?
>   

I believe that the Levenberg-Marquardt is pretty much standard algorithm 
in this business?

http://en.wikipedia.org/wiki/Levenberg-Marquardt_algorithm


Jussi Eloranta
Department of chemistry and biochemistry
Cal State Northridge