This function outputs posterior quantities and forecasts from a univariate warpDLM model. Currently two latent DLM specifications are supported: local level and the local linear trend.
Arguments
- y
the count-valued time series
- type
the type of latent DLM (must be either level or trend)
- transformation
transformation to use for the latent process (default is np); must be one of
"identity" (identity transformation)
"log" (log transformation)
"sqrt" (square root transformation)
"np" (nonparametric transformation estimated from empirical CDF)
"pois" (transformation for moment-matched marginal Poisson CDF)
"neg-bin" (transformation for moment-matched marginal Negative Binomial CDF)
- y_max
a fixed and known upper bound for all observations; default is
Inf
- R0
the variance for the initial state theta_0; default is 10
- nsave
number of MCMC iterations to save
- nburn
number of MCMC iterations to discard
- nskip
number of MCMC iterations to skip between saving iterations, i.e., save every (nskip + 1)th draw
- n.ahead
number of steps to forecast ahead
Value
A list with the following elements:
V_post
: posterior draws of the observation varianceW_post
: posterior draws of the state update variance(s)fc_post
: draws from the forecast distribution (of length n.ahead)post_pred
: draws from the posterior predictive distribution ofy
g_func
: transformation functiong_inv_func
: inverse transformation functionKFAS_mod
: the final KFAS model representing the latent DLM