[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lsqnonlin and nonlin_residmin

From: Asma Afzal
Subject: Re: lsqnonlin and nonlin_residmin
Date: Wed, 10 Jun 2015 02:15:25 +0100

Hi Olaf,

Thank you for your detailed response.

> 'not much documentation' -- that surprises me ...
I meant examples :). I spent quite some time trying to find out "how"
to specify a jacobian function for nonlin_residmin. Luckily, there was
an example using dfdp in leasqr doc.

> Looks ok to me so far, but 2 details should be changed:
> 2. You can't use 'nargout (modelfun)', because it doesn't work if
>    'modelfun' is compiled as an oct-file or if it is an m-file
>    function using (only) 'varargout'. I thought there is a Matlab
>    option which indicates if 'modelfun' returns a second output (the
>    Jacobian)? Can you check this option instead of using 'nargout()'?

I see. I was checking both the option and the number of output
arguments. I have changed it.

> If despite of now using the correct parameters there should still be
> remarkable differences to Matlab, we should look for the reason.

Negligible difference when solution is passed as an input to
residmin_stat instead of initial parameters.

> Overall, your 'lsqnonlin' looks quite well already. I have, however,
> not checked the mapping of the output flags and the mapping of all
> options. And the function should return its options if called as
> 'lsqnonlin ("defaults");' (there are examples for this in the existing
> functions of optim and Octave).

I investigated the mapping of flags earlier in [1].
Could you please check the mapping of options in [2] and [3]?

> I only roughly looked at 'lsqcurvefit', the code seems to be mostly
> equivalent to that of 'lsqnonlin'. Note that I can not check if
> 'varargout{3} = curvefit_out{2}-in_args{4};' has the correct sign for
> Matlab, but probably you have checked.

I have verified that.

Kind Regards,

[2] https://github.com/AsmaAfzal/octave_workspace/blob/master/lsqnonlin.m
[3] https://github.com/AsmaAfzal/octave_workspace/blob/master/lsqcurvefit.m

reply via email to

[Prev in Thread] Current Thread [Next in Thread]