> 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
(beta).
> 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,
Asma.
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.