Skip to main content
1-Visitor
July 2, 2018
Solved

Nonlinear Regression with constrains

  • July 2, 2018
  • 1 reply
  • 3524 views

Hello, 

In my regression model I'm trying to  constrain values of one of one of my parameters to be between 0 and 1 using solve block and minerr function (model attached).  Anybody has an idea how can I do it?

Regards, 
Tomasz

Best answer by Werner_E

Weighting does the job for me. The result is a very small, but positive value of m.

B1.png

Generally your second approach using the full vector of residuals and minerr rather then the single SSE-value is the better one and also in your case you get the better SSE value that way.

Your system seems to be conditioned in a way that the best SSE values are achieved with negative values of m. So if you demand m>0 the best choice would be m=0 (or only marginal larger). Larger values of m increase the error.

You may demand m>0.1 and the solve block will return m=0.1

B2.png

So you can experiment with various values between 0 and 1 and all values greater than zero will give you higher SSE values than m=0.

1 reply

25-Diamond I
July 2, 2018

Not sure which parameter should be constrained.

Does a constraint like

0<m<1

not work? I see you have written just m>0.

 

I just see that m2 is negative even though you wrote m>0. It could help to give more "weight" to this constraint (at the cost of the others) by writing 10^6*m>0 or something like that.

 

Can't try myself without the Excel data file.

Tomek11-VisitorAuthor
1-Visitor
July 2, 2018

Hi @Werner_E,

 

I tried constraining m to be 0<m<1 but it doesn't work, neither does weighting. unfortunately my model has physical meaning if m has values between 0 and 1. I attach spreadsheet. 

Werner_E25-Diamond IAnswer
25-Diamond I
July 2, 2018

Weighting does the job for me. The result is a very small, but positive value of m.

B1.png

Generally your second approach using the full vector of residuals and minerr rather then the single SSE-value is the better one and also in your case you get the better SSE value that way.

Your system seems to be conditioned in a way that the best SSE values are achieved with negative values of m. So if you demand m>0 the best choice would be m=0 (or only marginal larger). Larger values of m increase the error.

You may demand m>0.1 and the solve block will return m=0.1

B2.png

So you can experiment with various values between 0 and 1 and all values greater than zero will give you higher SSE values than m=0.