The function applies a Markov chain Monte Carlo (MCMC) algorithm to sample the posterior of an exDQLM.
An object of class "exdqlmMCMC" containing the following:
y - Time-series data used to fit the model.
run.time - Algorithm run time in seconds.
dqlm.ind - Logical value indicating whether gamma was fixed at 0, reducing the exDQLM to the special case of the DQLM.
model - List of the state-space model including GG, FF, prior parameters m0 and C0.
p0 - The quantile which was estimated.
df - Discount factors used for each block.
dim.df - Dimension used for each block of discount factors.
samp.theta - Posterior sample of the state vector.
samp.post.pred - Sample of the posterior predictive distributions.
map.standard.forecast.errors - MAP standardized one-step-ahead forecast errors.
samp.sigma - Posterior sample of scale parameter sigma.
samp.vts - Posterior sample of latent parameters, v_t.
theta.out - List containing the distributions of the state vector including filtered distribution parameters (fm and fC) and smoothed distribution parameters (sm and sC).
n.burn Number of MCMC iterations that were burned.
n.mcmc Number of MCMC iterations that were sampled.
If dqlm.ind=FALSE, the object also contains the following:
samp.gamma - Posterior sample of skewness parameter gamma.
samp.sts - Posterior sample of latent parameters, s_t.
init.log.sigma - Burned samples of log sigma from the random walk MH joint sampling of sigma and gamma.
init.logit.gamma - Burned samples of logit gamma from the random walk MH joint sampling of sigma and gamma.
accept.rate - Acceptance rate of the MH step.
accept.rate.burn - MH acceptance rate during burn-in.
accept.rate.keep - MH acceptance rate in kept MCMC samples.
Sig.mh - Covariance matrix used in MH step to jointly sample sigma and gamma.
mh.diagnostics - MH tuning diagnostics (proposal mode, scaling path, adaptation summary).
diagnostics - ESS and chain-ready summaries for sigma/gamma.
A univariate time-series.
The quantile of interest, a value between 0 and 1.
List of the state-space model including GG, FF,
prior parameters m0 and C0.
Discount factors for each block.
Dimension of each block of discount factors.
Logical value indicating whether to fix gamma at
gam.init. Default is FALSE.
Initial value for gamma (skewness parameter), or value at
which gamma will be fixed if fix.gamma = TRUE.
Logical value indicating whether to fix sigma at sig.init.
Default is FALSE.
Initial value for sigma (scale parameter), or value at which
sigma will be fixed if fix.sigma = TRUE.
Logical value indicating whether to fix gamma at 0,
reducing the exDQLM to the AL/DQLM special case. Default is FALSE.
Covariance matrix used in the random walk MH step to jointly sample sigma and gamma.
Logical value indicating whether or not to recompute Sig.mh based off the initial burn-in samples of gamma and sigma. Default is FALSE.
Number of MCMC iterations to burn. Default is n.burn = 2000.
Number of MCMC iterations to sample. Default is n.mcmc = 1500.
Logical value indicating whether to use the legacy ISVB
warm start when init.from.vb = TRUE. Default is FALSE, which favors
LDVB as the default VB warm start. This flag only chooses the
warm-start source; it does not change the subsequent MCMC proposal kernel.
Optional logical. If TRUE, run a VB pre-initialization
step (LDVB by default, or ISVB when init.from.isvb = TRUE) and
initialize MCMC from converged VB moments. Default is TRUE. If
explicitly set to NULL, it falls back to init.from.isvb behavior for
backward compatibility.
Optional list controlling VB warm start. Supported keys:
method ("isvb" or "ldvb"), tol, n.IS, n.samp, max_iter, verbose.
Optional precomputed VB fit object. If supplied, warm start uses this object directly and does not rerun VB internally.
Optional normalized MCMC control list, usually from
exal_make_mcmc_control(). When supplied, the core MCMC arguments and
warmup blocks are read from mcmc_control first and then merged with the
explicit function arguments. When omitted, exAL-style dynamic MCMC uses the
package's conservative default (sigma, gamma) warmup profile
automatically; explicit controls remain the advanced override path.
Optional list controlling warmup/freeze for the exDQLM sigma/gamma block during MCMC.
Optional list controlling early latent-state
warmup/freeze in dynamic MCMC. Supported keys include
freeze_burnin_iters, freeze_only_during_burn, force_after_warmup,
and mode ("u_only" or "u_st_pair").
Optional list controlling early theta-state
warmup/freeze in dynamic MCMC. Supported keys include
freeze_burnin_iters, freeze_only_during_burn, and
force_after_warmup.
Optional list controlling sigma-only
warmup/freeze in the DQLM branch. Supported keys mirror
sigmagam_controls.
Character; proposal kernel for the exDQLM scale/skew block.
"slice" (default) uses
an exact sigma GIG update plus a bounded univariate slice sampler directly
on gamma; "laplace_rw" uses a Laplace-informed covariance then RW;
and "rw" uses joint random-walk MH on (log sigma, logit gamma).
This choice is separate from the VB warm-start method.
Logical; adapt MH proposal scale during burn-in.
Integer; adaptation interval (iterations).
Numeric length-2 vector with lower/upper target acceptance rates.
Numeric length-2 vector with min/max global scaling for MH covariance.
Numeric in (0,1); maximum fractional scale change per adaptation step.
Minimum burn-in iterations required to enable adaptation.
Positive numeric width for the bounded slice sampler when
mh.proposal = "slice". Default 0.1 for parity with bqrgal.
Positive integer or Inf; maximum stepping-out
expansions for the slice sampler.
Logical; if TRUE, retain per-iteration
sigma/gamma/s/u diagnostics under mh.diagnostics$trace. Set FALSE for
lighter-weight runs.
Positive integer; when trace.diagnostics = TRUE, record
one diagnostics row every trace.every iterations.
Positive integer controlling how often console progress
is printed when verbose = TRUE. Default 500, independent of
trace.every.
Optional callback invoked with a named list at MCMC start, at each progress checkpoint, and on completion. Intended for workflow-level progress logging.
List of parameters for inverse gamma prior on sigma; shape
a_sig and scale b_sig. Default is an inverse gamma with mean
1, or sig.init when supplied, and variance 10.
List of parameters for truncated Student-t prior on gamma;
center m_gam, scale s_gam, and degrees of freedom
df_gam. Default is a standard Student-t with 1 degree of freedom,
truncated to the support of gamma.
Logical value indicating whether progress should be displayed.
# \donttest{
data("scIVTmag", package = "exdqlm")
y = scIVTmag[1:80]
trend.comp = polytrendMod(order = 1, m0 = stats::quantile(y, 0.85), C0 = 10)
seas.comp = seasMod(p = 365, h = c(1,2), C0 = 10*diag(4))
model = trend.comp + seas.comp
M2 = exdqlmMCMC(y, p0=0.85, model, df = c(1,1), dim.df = c(1,4),
gam.init = -3.5, sig.init = 15,
n.burn = 40, n.mcmc = 40,
init.from.vb = FALSE, verbose = FALSE)
M2_al = exdqlmMCMC(y, p0=0.85, model, df = c(1,1), dim.df = c(1,4),
dqlm.ind = TRUE, sig.init = 15,
n.burn = 30, n.mcmc = 30,
init.from.vb = FALSE, verbose = FALSE)
# }
Run the code above in your browser using DataLab