Closed Smit-create closed 1 year ago
Plots from finite_opt_saving_2:
Plots from finite_lq
:
Plots from firm_hiring.py
A plot from modified_opt_savings
:
@jstac This is ready for review. I have added all the code from Chapter 6. Thanks!
Many thanks @Smit-create , this is looking good!
One concern is the first figure above, for inventory dynamics. It looks slightly different to the Julia one in the textbook. I had a quick look at your code and I wasn't sure why that's the case. Could you please compare the two figures and let me know what you think?
One concern is the first figure above, for inventory dynamics.
One of the reasons might be differences in the behavior of Geometric random distribution. NumPy generates only positive integers while Julia generates whole numbers:
>>> rand = np.random.default_rng().geometric(0.6, size=20)
>>> np.mean(rand)
1.65
>>> rand
array([1, 2, 1, 1, 3, 1, 1, 2, 2, 1, 6, 1, 1, 2, 1, 1, 1, 1, 2, 2])
Julia:
julia> G = Geometric(0.6)
julia> X = zeros(Int32, 20)
julia> for t in 1:20
X[t] = rand(G)
end
julia> mean(X)
0.6
Thanks for the review @jstac. Fixed the above issue and the new plot looks like this:
Yep, that's perfect now. Many thanks @Smit-create , great work!
Plots from
inventory_dp