Learn R Programming

bssm (version 2.0.2)

fitted.mcmc_output: Fitted for State Space Model

Description

Returns summary statistics from the posterior predictive distribution of the mean.

Usage

# S3 method for mcmc_output
fitted(object, model, probs = c(0.025, 0.975), ...)

Arguments

object

Results object of class mcmc_output from run_mcmc based on the input model.

model

A bssm_model object.

probs

Numeric vector defining the quantiles of interest. Default is c(0.025, 0.975).

...

Ignored.

Examples

Run this code
prior <- uniform(0.1 * sd(log10(UKgas)), 0, 1)
model <- bsm_lg(log10(UKgas), sd_y = prior, sd_level =  prior,
  sd_slope =  prior, sd_seasonal =  prior, period = 4)
fit <- run_mcmc(model, iter = 1e4)
res <- fitted(fit, model) 
head(res)

Run the code above in your browser using DataLab