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.
warpDLM(
y,
type = c("level", "trend"),
transformation = c("np", "identity", "log", "sqrt", "pois", "neg-bin"),
y_max = Inf,
R0 = 10,
nsave = 5000,
nburn = 5000,
nskip = 1,
n.ahead = 1
)
A list with the following elements:
V_post
: posterior draws of the observation variance
W_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 of y
g_func
: transformation function
g_inv_func
: inverse transformation function
KFAS_mod
: the final KFAS model representing the latent DLM
the count-valued time series
the type of latent DLM (must be either level or trend)
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)
a fixed and known upper bound for all observations; default is Inf
the variance for the initial state theta_0; default is 10
number of MCMC iterations to save
number of MCMC iterations to discard
number of MCMC iterations to skip between saving iterations, i.e., save every (nskip + 1)th draw
number of steps to forecast ahead