Description Usage Arguments Details Value Examples
View source: R/AM_mix_hyperparams.R
Generate a configuration object that specifies a univariate Normal mixture kernel, where users can specify the hyperparameters of the Normal-InverseGamma conjugate prior. As such, the kernel is a Gaussian distribution with mean μ and variance σ^2. The prior on (μ,σ^2) the Normal-InverseGamma:
π(μ,σ^2\mid m_0,κ_0,ν_0,σ^2_0) = π_{μ}(μ|σ^2,m_0,κ_0)π_{σ^2}(σ^2\mid ν_0,σ^2_0),
π_{μ}(μ|σ^2,m_0,κ_0) =\frac{√{κ_0}}{√{2πσ^2},} \exp^{-\frac{κ_0}{2σ^2}(μ-m_0)^2 }, \qquad μ\in\mathcal{R},
π_{σ^2}(σ^2\mid ν_0,σ^2_0)= {\frac {σ_0^{2^{ν_0 }}}{Γ (ν_0 )}}(1/σ^2)^{ν_0 +1}\exp ≤ft(-\frac{σ_0^2}{σ^2}\right), \qquad σ^2>0.
1 | AM_mix_hyperparams_uninorm(m0, k0, nu0, sig02)
|
m0 |
The m_0 hyperparameter. |
k0 |
The κ_0 hyperparameter. |
nu0 |
The ν_0 hyperparameter. |
sig02 |
The σ^2_0 hyperparameter. |
m_0 corresponds m0
,
κ_0 corresponds k0
,
ν_0 corresponds nu0
, and
σ^2_0 corresponds sig02
.
If hyperparameters are not specified, the default is m0=0
, k0=1
, nu0=3
, sig02=1
.
An AM_mix_hyperparams
object. This is a configuration list to be used as mix_kernel_hyperparams
argument for AM_mcmc_fit
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#### This example ...
data(galaxy)
y_uvn = galaxy
mixture_uvn_params = AM_mix_hyperparams_uninorm (m0=20.83146, k0=0.3333333,
nu0=4.222222, sig02=3.661027)
mcmc_params = AM_mcmc_parameters(niter=2000, burnin=500, thin=10, verbose=0)
components_prior = AM_mix_components_prior_pois (init=3, a=1, b=1)
weights_prior = AM_mix_weights_prior_gamma(init=2, a=1, b=1)
fit <- AM_mcmc_fit(
y = y_uvn,
mix_kernel_hyperparams = mixture_uvn_params,
mix_components_prior =components_prior,
mix_weight_prior = weights_prior,
mcmc_parameters = mcmc_params)
summary (fit)
plot (fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.