QuantEcon / lecture-julia.myst

Lecture source for "Quantitative Economics with Julia"
https://julia.quantecon.org/intro.html
52 stars 43 forks source link

Add Gaussian quadrature to some of the examples with monte-carlo expectations #287

Open jlperla opened 8 months ago

jlperla commented 8 months ago

Probably stick with gaussian quadrature, maybe in the growth model and only with normal distributions? Just go nodes, weights = gausshermite(n)

Can also show the adaptation for a normal that isn't

function gaussian_nodes_weights(mu, sigma, n)
    gh = gausshermite(n)
    nodes = gh[1] .* (sqrt(2) * (sigma)) .+ mu
    weights = gh[2] ./ sqrt(pi)
    return nodes, weights
end

or something like that.