5.0

5.0 | 1 rating Rate this file 240 downloads (last 30 days) File Size: 4.93 KB File ID: #10093

Fminspleas

by John D'Errico

 

22 Feb 2006 (Updated 23 Jun 2008)

Code covered by BSD License  

Efficient nonlinear regression fitting using a constrained, partitioned least squares overlay to fmi

Download Now | Watch this File

File Information
Description

I need to thank Duane Hanselman for suggesting this great idea.

Fminspleas is a simple nonlinear least squares tool that fits regression models of the form

Y = a1*f1(X,C) + a2*f2(X,C) + ... + an*fn(X,C)

X can be any array, so it works on multidimensional
problems, and C is the set of only intrinsically nonlinear parameters. f1, f2, etc., must return a column vector result, of the same length as Y.

Because the optimization (in this case, fminsearch) need only work on the intrinsically nonlinear parameters, far fewer function evaluations are required. The example I give in the help took only 32 function evaluations to estimate 2 linear parameters plus 1 nonlinear parameter, versus over 300 evaluations had I just called fminsearch directly.

Fminspleas now allows you to specify bound constraints on the nonlinear parameters only. I'll see about adding linear parameter constraints if there are requests.

Finally, fminspleas allows the user to supply a set of non-negative weights to the regression.

E-mail me with any problems or bugs.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
fminsearchbnd, fminsearch interface, Optimization Tips and Tricks

MATLAB release MATLAB 7.0.1 (R14SP1)
Zip File Content  
Other Files fminspleas.m,
license.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
22 Feb 2006 John D'Errico

I've already added constraints to the nonlinear parameters in the new version going up, plus cleaned up the documentation a bit.

03 Mar 2006 Duane Hanselman

The best approach for solving optimization problems where there is a mixture of linear and nonlinear terms. Solve for the linear terms using linear least squares embedded inside a nonlinear optimizer for the nonlinear terms. This function is difficult to describe with simple help text alone, but well worth the effort required to use it.

23 May 2006 Benson Tsui

when I tried to use f = {1, @(xdata, coef) exp(xdata*coef)};
It gives the 'identifier' error.
can you tell me what causes the problem?

Please login to add a comment or rating.
Updates
23 Feb 2006

Cleaned up the help, added constraints on the nonlinear parameters.

20 Mar 2006

Version 1.1 - clean up the help & added another example with a second nonlinear parameter

12 Apr 2006

Remove (the mistaken) requirement of the optimization toolbox

08 May 2006

Inclusion of weights as an option

24 May 2006

Release 2.1: repair an error in the example

23 Jun 2008

Fix indexing in the nested function

Tag Activity for this File
Tag Applied By Date/Time
optimization John D'Errico 22 Oct 2008 08:16:32
partitioned John D'Errico 22 Oct 2008 08:16:32
nonlinear least squares John D'Errico 22 Oct 2008 08:16:32
fminsearch John D'Errico 22 Oct 2008 08:16:32
fit John D'Errico 22 Oct 2008 08:16:32
curve John D'Errico 22 Oct 2008 08:16:32
nonlinear least squares imry kissos 06 Aug 2009 05:22:57
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com