i would like to solve the following system:
c[e_] := 1/2*e + 1;
d[y_, x_] := x*y^2;
e[y_] := NMinimize[{Integrate[PDF[BetaDistribution[2, e], x]*d[y, x] + c[e]
, {x, 0, 1}], e >= 0}, e]
U[z_, y_, p_] := p - Integrate[PDF[BetaDistribution[2, z], x]*d[y, x] + c[z], {x, 0, 1}]
NMaximize[{y - p, U[e[y], y, p] == 0, y >= 0, p >= 0}, {y, p}]
Do you see what i messed up?
PS: I try to maximize y-p given the constraint U[e[y], y, p] == 0
Maximize an equation? Or are you trying to
Maximizey-p
subject to constraints? Either way, you're lacking curly brackets. $\endgroup$e
is used as both a function and as the optimization variable inNMinimize
. Furthermore,NMinimize
doesn't return just a number but also aRule
containing the position of the minimum, so you need to pull out the right answer before you can insert the result into other functions. $\endgroup$e
for three different things. While that may or may not be an actual problem it sure makes things hard to follow. Ise[y]
intended to be the minimum value or the value of the locale
at the minimum? $\endgroup$