leasqr help
Francesco Potorti`
Potorti at isti.cnr.it
Wed Apr 9 07:02:02 CDT 2008
>I would like to use leasqr for non linear minimization.
>
>Am I wrong or it seems that leasqr calculate direclty the "chi2" ?
I do not know.
>In case a have a "Matrix" as data, would it work right ?
>In this case my "function" should return a matrix as well ?
Supposing that by "data" you mean the "observed values", the answer is
no: the function should return a scalar value.
However, you can work around this limitation. For example, suppose you
have a function Fm with three parameters a,b,c which returns a 3x3
matrix. Then you can optimize a function Fs instead, defined like this:
function ret = Fs (a,b,c,i,j)
ret = Fm(a,b,c)(i,j)
endfunction
thus independently minimising the distance between each element of the
matrices. If instead you need to measure the distance between matrices
in some other specific way, it should be not so difficult to change
leasqr.m to use your distance rather than squared difference of scalars.
--
Francesco Potortì (ricercatore) Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR Fax: +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa Email: Potorti at isti.cnr.it
Web: http://fly.isti.cnr.it/ Key: fly.isti.cnr.it/public.key
More information about the Help-octave
mailing list