# non linear regression model with constraints

29 views (last 30 days)

Show older comments

### Accepted Answer

Matt J
on 24 Aug 2018

Edited: Matt J
on 26 Aug 2018

Using fmincon, solve 3 separate problems and take the best solution of the three (the solution with the least regression error):

Problem 1: Solve subject to the constraints

alpha<=-1-delta

k*[x2^(alpha+1)-x1^(alpha+1)] - (alpha+1)*A=0

where delta>0 is as small as possible without running into numerical problems in the evaluation of 1/(alpha+1)*[x2^(alpha+1)-x1^(alpha+1)].

Problem 2: Solve subject to the constraints

alpha>=-1+delta

k*[x2^(alpha+1)-x1^(alpha+1)] - (alpha+1)*A=0

Problem 3: Solve subject to -1-delta <= alpha <= -1+delta. I would just approximate the solution here as alpha=-1 and k=A/log(x2/x1).

##### 0 Comments

### More Answers (2)

Matt J
on 24 Aug 2018

Edited: Matt J
on 24 Aug 2018

##### 2 Comments

Matt J
on 25 Aug 2018

No, but if you follow the approach with the Taylor expansion, there is no need for fmincon. You can use the area constraint to eliminate k, just as you were planning to do originally.

Alternatively, solve first with fmincon. Then plug the alpha you get as the initial point beta0 for fitnlm. Here, you have prior knowledge of whether alpha=-1 or not and so can choose the expression for A accordingly. Since you are initializing fitnlm with the known solution, it should converge in few or zero iterations and give you the goodness of fit metrics.

Matt J
on 26 Aug 2018

If you know a prior that alpha is very close to -1, maybe you should just bound the optimization to a small interval -1-delta <= alpha <= -1+delta around -1. Then you can just approximate the area as constant over that interval,

A=k*log(x2/x1)

and eliminate k from the optimization,

k=A/log(x2/x1)

##### 2 Comments

Matt J
on 26 Aug 2018

### See Also

### Community Treasure Hunt

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

Start Hunting!