Skip to content

Use new Tauchen #371

@jlperla

Description

@jlperla

A new Tauchen was added to the interpolation/quadrature lectures in #370

We should now convert over to using it across the lectures. For this, you can copy/paste a minimal version in each lecture that requires tauchen and just make sure the link to that new lecture is there.

function tauchen(N, rho, sigma, mu, m = 3)
    mu_X = mu / (1 - rho)
    sigma_X = sigma / sqrt(1 - rho^2)
    z = range(-m*sigma_X, m*sigma_X, length = N)
    midpoints = (z[1:(end - 1)] .+ step(z)/2)'
    F = cdf.(Normal(), (midpoints .- rho .* z) ./ sigma)
    P = [F[:, 1] diff(F, dims = 2) (1 .- F[:, end])]
    return (;P, mu_X, sigma_X, x = z .+ mu_X)
end

The challenge is that we won't be able to complete this before implementing the simulate.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions