DynamicGlobalLocalShrinkage.SetUpLogChi2MixtureFunction
setUpLogChi2Mixture(nComp, df)

Sets up a Normal mixture to approximate the distribution of the log χ²₁ random variable.

Examples

julia> histogram(log.(rand(Chisq(1),10000)), normalize = true, fillcolor = :lightgray, linecolor = :white, lw = 0.5, label = "simulated")
julia> mix = SetUpLogChi2Mixture(10, 1) # Omori et al (2007) 10-comp
julia> plot!(-20:0.01:4, pdf.(mix.dist, -20:0.01:4), color = :black, label = "10-comp")
julia> mix = SetUpLogChi2Mixture(5, 1) # Carter-Kohn 5-component
julia> plot!(-20:0.01:4, pdf.(mix.dist, -20:0.01:4), color = :cornflowerblue, label = "5-comp")
source
DynamicGlobalLocalShrinkage.update_dsp!Function
update_dsp!(ν, S, P, H, H̃, ξ, ϕ, μ, σ²ₙ, prior, 
    mix, Dᵩ, offset = eps(), α = 1/2, β = 1/2, updateσₙ = false)

A single Gibbs update of all dynamic shrinkage process (DSP) parameters given a T × p matrix of parameter innovations, ν.

The columns of ν correspond to different parameters, which are assumed to be independent. The elements in a column of ν are innovations for the log-volatility evolution, i.e.

νₜ ~ N(0, exp(hₜ/2)) for t = 1,2,...,T hₜ = μ + ϕ(hₜ₋₁ - μ) + ηₜ, where εₜ ~ N(0,σₙ/√ξₜ) ξₜ ~ PG(2α) is a Polya-Gamma variable.

The columns of H contains the log-volatility evolution for a given parameter: hₜ for t = 1,2,...,T. The Polya-Gamma construction gives a marginal distribution for ηₜ ~ Z(α,α,0,σₙ).

prior is a named tuple with fields ϕ₀, κ₀, m₀, σ₀, ν₀, ψ₀, which are the prior parameters for the AR coefficient ϕ, the mean μ, and the variance σ²ₙ in the log-volatility evolution.

The usual square-and-log trick in stochastic volatility models is used to turn hₜ into an additive parameter ỹₜ = log(νₜ² + offset) = hₜ + qₜ, where qₜ ~ log χ²₁, which is approximated by a mixture of normals distribution with mixture allocation given by the T × p matrix S. The posterior probabilities of the mixture allocation are stored in the T × p matrix P.

mix is a named tuple with fields dist, m, v, which is the mixture distribution, and the means and variances of the mixture components.

source