exdqlmISVB {exdqlm} | R Documentation |
exDQLM - ISVB algorithm
Description
The function applies an Importance Sampling Variational Bayes (ISVB) algorithm to estimate the posterior of an exDQLM.
Usage
exdqlmISVB(
y,
p0,
model,
df,
dim.df,
fix.gamma = FALSE,
gam.init = NA,
fix.sigma = TRUE,
sig.init = NA,
dqlm.ind = FALSE,
exps0,
tol = 0.1,
n.IS = 500,
n.samp = 200,
PriorSigma = NULL,
PriorGamma = NULL,
verbose = TRUE
)
Arguments
y |
A univariate time-series. |
p0 |
The quantile of interest, a value between 0 and 1. |
model |
List of the state-space model including |
df |
Discount factors for each block. |
dim.df |
Dimension of each block of discount factors. |
fix.gamma |
Logical value indicating whether to fix gamma at |
gam.init |
Initial value for gamma (skewness parameter), or value at which gamma will be fixed if |
fix.sigma |
Logical value indicating whether to fix sigma at |
sig.init |
Initial value for sigma (scale parameter), or value at which sigma will be fixed if |
dqlm.ind |
Logical value indicating whether to fix gamma at |
exps0 |
Initial value for dynamic quantile. If |
tol |
Tolerance for convergence of dynamic quantile estimates. Default is |
n.IS |
Number of particles for the importance sampling of joint variational distribution of sigma and gamma. Default is |
n.samp |
Number of samples to draw from the approximated posterior distribution. Default is |
PriorSigma |
List of parameters for inverse gamma prior on sigma; shape |
PriorGamma |
List of parameters for truncated student-t prior on gamma; center |
verbose |
Logical value indicating whether progress should be displayed. |
Value
A list of the following is returned:
-
run.time
- Algorithm run time in seconds. -
iter
- Number of iterations until convergence was reached. -
dqlm.ind
- Logical value indicating whether gamma was fixed at0
, reducing the exDQLM to the special case of the DQLM. -
model
- List of the state-space model includingGG
,FF
, prior parametersm0
andC0
. -
p0
- The quantile which was estimated. -
df
- Discount factors used for each block. -
dim.df
- Dimension used for each block of discount factors. -
sig.init
- Initial value for sigma, or value at which sigma was fixed iffix.sigma=TRUE
. -
seq.sigma
- Sequence of sigma estimated by the algorithm until convergence. -
samp.theta
- Posterior sample of the state vector variational distribution. -
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 variational distribution. -
samp.vts
- Posterior sample of latent parameters, v_t, variational distributions. -
theta.out
- List containing the variational distribution of the state vector including filtered distribution parameters (fm
andfC
) and smoothed distribution parameters (sm
andsC
). -
vts.out
- List containing the variational distributions of latent parameters v_t.
If dqlm.ind=FALSE
, the list also contains:
-
gam.init
- Initial value for gamma, or value at which gamma was fixed iffix.gamma=TRUE
. -
seq.gamma
- Sequence of gamma estimated by the algorithm until convergence. -
samp.gamma
- Posterior sample of skewness parameter gamma variational distribution. -
samp.sts
- Posterior sample of latent parameters, s_t, variational distributions. -
gammasig.out
- List containing the IS estimate of the variational distribution of sigma and gamma. -
sts.out
- List containing the variational distributions of latent parameters s_t.
Or if dqlm.ind=TRUE
, the list also contains:
-
sig.out
- List containing the IS estimate of the variational distribution of sigma.
Examples
y = scIVTmag[1:1095]
trend.comp = polytrendMod(1,mean(y),10)
seas.comp = seasMod(365,c(1,2,4),C0=10*diag(6))
model = combineMods(trend.comp,seas.comp)
M0 = exdqlmISVB(y,p0=0.85,model,df=c(1,1),dim.df = c(1,6),
gam.init=-3.5,sig.init=15,tol=0.05)