I would like to find a maximum economic stress scenario restricted by a limit of the mahalanobis distance of this scenario. For this, I have to consider two functions in the optimization.
To make it easier, we can work with a simplifying problem: We have a simple linear model: y=a+bx
. For this I want to minimize: sum(a+bx-y)^2
. But also, I have for example the restriction that: (ab*5)/2<30
.
To calculate this problem with the excel solver is not a problem. But, how I get this in r?