Constrained nonlinear regression
이전 댓글 표시
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
2012년 5월 18일
0 개 추천
lsqnonlin
댓글 수: 5
Mark
2012년 5월 20일
Sargondjani
2012년 5월 20일
it's hard to say but your initial guess for the second coefficient is poor. i dont know how well behaved your problem is, but the optimizer only finds a local minimum so it could get stuck in a not optimal point... so you should first try with a better initial guess
if that doesnt work, than the exit message should give you clues what to change to improve the results (post exit message here if you want help on this)
for a start:
- use lower values for TolFun and TolX (default 1e-6 i think)
- supply analytical gradient (this looks not too hard for your problem)
Sargondjani
2012년 5월 20일
and a good check is to make a 3D plot of the error's (at gridpoints). you can use 'meshgrid' to get matrices with all grippoints...
Mark
2012년 5월 21일
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
카테고리
도움말 센터 및 File Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!