[Top][All Lists]

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

Re: nlinfit in octave

From: AsmaA
Subject: Re: nlinfit in octave
Date: Mon, 15 Jun 2015 17:51:37 -0700 (PDT)

Hi Olaf,

Thank you for your prompt response.

> the 'RobustWgtFun' feature is not in the algorithm of
> 'nonlin_residmin' and I currently haven't the time to try to add
> it. Maybe later. I'm also not aware of a different algorithm in core
> Octave or the optim package which implements a comparable feature. I
> can only suggest to leave this feature not implemented in nlinfit for
> now.

I have wrapped nlinfit on nonlin_curvefit. I chose not to wrap nlinfit
on lsqcurvefit because the default options for lsqnonlin/lsqcurvefit
are different from nlinfit. Can you please check [1].

Summary of main features:

- Options retrieved using statget but set using optimset for nonlin_curvefit.
- Check for name-value pairs. My code only assumes only one possible
name-value pair input.
- Scaled residuals and Jacobian as in nlinfit in Matlab.
- A different option DerivStep which is same as FinDiffRelStep
- Covariance Matrix and Jacobian returned using curvefit_stat.
- Calculated MSE. MSE = (R' * R)/(N-p), where N is the number of
observations (X) and p is the      number of estimated coefficients

> Copy, and make the appropriate slight changes to, 'optimset.m',
> 'optimget.m', and '__all_opts__.m' from core Octave and rename them to
> 'statset.m', 'statget.m', and e.g. '__all_stat_opts__.m',
> respectively. For now, these functions can probably be distributed
> with the optim package. 'nlinfit' will have to include a line
> e.g. like
> ## PKG_ADD: __all_stat_opts__ ("nlinfit");

Done in [2]-[4].  I wasn't sure how to initialize __all_stat_opts__. I
used __all_stat_opts__ ("stat_opts") where I created a function
stat_opts in [5].

Kind Regards,

p.s. I have been following the other threads too. Don't want to
bombard your inbox by replying to each one of them :).
- I have applied your patch to lsqnonlin and made the respective
changes in lsqcurvefit as well.
- Set the default TypicalX to 1 in both lsqnonlin and lsqcurvefit.
- I have been using Octave in Windows and used tabs as a habit
(*guilty*). I'll bear in mind not to use tabs.
- And finally, thank you for submitting a bug report for qp.

[1] https://github.com/AsmaAfzal/octave_workspace/blob/master/nlinfit.m
[2] https://github.com/AsmaAfzal/octave_workspace/blob/master/__all_stat_opts__.m
[3] https://github.com/AsmaAfzal/octave_workspace/blob/master/statset.m
[4] https://github.com/AsmaAfzal/octave_workspace/blob/master/statget.m
[5] https://github.com/AsmaAfzal/octave_workspace/blob/master/stat_opts.m

View this message in context: Re: nlinfit in octave
Sent from the Octave - Maintainers mailing list archive at Nabble.com.

reply via email to

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