Skip to content

Comparative Statics w/ InfiniteOpt.jl #234

Answered by pulsipher
azev77 asked this question in Q&A
Discussion options

You must be logged in to vote

If I understand correctly you are interested in exploring the effect of ρ on the solution. This simply amounts to deriving a Pareto frontier, since each problem is fully decoupled from one another.

The code you have will work just fine, but I would probably just define the model once and update the objective function on the fly to better the performance:

using InfiniteOpt, Ipopt

# Define the parameters
k = 100.0  # utility bliss point
T = 10.0   # life horizon
r = 0.05   # interest rate
B0 = 100.0 # endowment
ns = 1_000;             # number of gridpoints

# Define expression functions
u(c; k=k) = -(c - k)^2       # utility function
BC(B, c; r=r) = r*B - c      # budget constraint

# Set…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pulsipher
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #143 on February 27, 2022 01:47.