Constrained nonlinear regression

1 回表示 (過去 30 日間)
Mark
Mark 2012 年 5 月 18 日
Hi, I was wondering if Matlab has functions to perform constrained nonlinear regression in a similar way as the Constrained Nonlinear Regression (CNLR) in SPSS.
Here is a SPSS syntax example:
*NonLinear Regression.
MODEL PROGRAM b1=13 b2=-6 b3=-1.33 .
COMPUTE PRED_ = b1 + b2 * exp(b3*advert).
CNLR sales
/OUTFILE='C:\TEMP\SPSSFNLR.TMP'
/PRED PRED_
/BOUNDS b1 >= 0; b2 <= 0; b3 <= 0
/SAVE PRED RESID
/CRITERIA STEPLIMIT 2 ISTEP 1E+20 .
Any ideas how to perform this computation in Matlab?
Thanks, Mark

回答 (1 件)

Sargondjani
Sargondjani 2012 年 5 月 18 日
lsqnonlin
  5 件のコメント
Mark
Mark 2012 年 5 月 21 日
The initial guess for the coefficients were based on:
[b1,d1,s1] = glmfit(X',Y','binomial');
Playing with the initial guess for the second coefficient between 0 and 1 didn't changed the Matlab solution.
The exitflag = 3 (Change in the residual was less than the specified tolerance.)
Sargondjani
Sargondjani 2012 年 5 月 21 日
hmmm, i think you should calculate the errors yourself and check if the SPSS solution gives you a smaller error in matlab...
i did a grid search myself and i came to the same conclusion as lsqnonlin: the optimum is somewhere around 106.7 and 0.25
...maybe you should try to improve the result of SPSS

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by