Group Abstract Group Abstract

Message Boards Message Boards

Plotting solutions to an equation for varying parameter value produces empty graphs

Posted 2 years ago
POSTED BY: Ian P
11 Replies

The expression

D[f[e, w, a, i], w] == e/w

makes little sense to me, because (1) how do you calculate the derivative of ArgMax? (2) the function f cannot depend on e, but e appears on the right hand side.

POSTED BY: Gianluca Gorni
Posted 2 years ago

Thanks. This is my understanding: (1) ArgMax will generate e that maximizes v, and that e will come out as a function of w, a, and i, i.e., $e=f(w,a,i)$. So we can calculate the derivative of f[] with respect to w. (2) Yes, you are correct, I removed e from f[]. Please do let me know if I misunderstood. Thanks for your help in advance!

POSTED BY: Ian P

The value of e that maximizes v is not a simple function of the parameters. Its derivative is even more complicated, if it exists at all.

What is the e in the right hand side of D[f[w, a, i], w] == e/w ?

With FindRoot you are trying to solve one equation in two unknowns. What do you expect to find?

POSTED BY: Gianluca Gorni
Posted 2 years ago

Thanks, Gianluca! Let me clarify my goal by referring to the following graph: enter image description here

Each curve is a plot of $e$ that maximizes $v$ as a function of $w$ for a given $a$, and the curve shifts rightward with an increase in $a$. (Typo in the graph: $s$ should be $a$.) I would like to find an equilibrium pair of $(e,w)$ for different level of $a$, and that is indicated by the dot in each curve. And the equilibrium condition is $\frac{\partial e}{\partial w} = \frac{e}{w}$, i.e. the point where the ray from the origin meets the curve tangentially.

I'm also attaching a Notebook file which contains my previous code where I used f[...] = D[v,e] instead of f[...] = ArgMax[v,e] and hence what's inside FindRoot[] was also different. As you can see in the file, this code did generate a result. But I was dubious of the shape of the plots obtained. And I was suspecting D[v,e] could be the problem since in this code, only the first-order condition, but not the second-order condition, was verified; hence we cannot guarantee whether it is maximum or minimum. That is why I have changed over to ArgMax[v,e], which however does not yield an outcome at all in the first place. I hope this clarifies what my goal is. If not, please let me know. Thank you so much for taking time to help!

Attachments:
POSTED BY: Ian P

If I understand it correctly, the e in D[f[w, a, i], w] == e/w should be f[w, a, i]. However, the calculation of f[w, a, i] is terribly complicated, just as the inequality Uem > Uun.

POSTED BY: Gianluca Gorni
Posted 2 years ago

In fact, f[w, a, i] is the curve in the figure whereas e in e/w is on the straight ray (dotted line) from the origin. The equality D[f[w, a, i], w] == e/w defines the dot where the two meet tangentially. I hope this clarifies.

POSTED BY: Ian P

I think you should write not D[f[w, a, i], w] == e/w but

D[f[w, a, i], w] == f[w, a, i]/w

because your e and f[w, a, i] are not independent objects.

POSTED BY: Gianluca Gorni
Posted 2 years ago

Thanks for your comment, Gianluca! I looked at it several times but it seems to me that the code for $\frac{\partial e}{\partial w} = \frac{e}{w}$ is D[f[w, a, i], w] == e/w. I think this can also be verified graphically by referring to the graph above.

POSTED BY: Ian P

If you are right then the equation D[f[w, a, i], w] == e/w is trivially solved as

e == w D[f[w, a, i], w]

and w is arbitrary.

POSTED BY: Gianluca Gorni

I stopped at the first error I caught:

f[e_, w_, a_, i_] = ArgMax[{v, e >= 0, e <= 1, Uem > Uun}, e]

The variable e is dummy inside ArgMax. You cannot refer to it in the definition of f.

POSTED BY: Gianluca Gorni
Posted 2 years ago

Thanks, Gianluca! But even after fixing this, I get the same outcome. May I ask for your additional advice?

POSTED BY: Ian P
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard