Learn R Programming

bssm (version 1.1.5)

ar1_lg: Univariate Gaussian model with AR(1) latent process

Description

Constructs a simple Gaussian model where the state dynamics follow an AR(1) process.

Usage

ar1_lg(y, rho, sigma, mu, sd_y, beta, xreg = NULL)

Arguments

y

Vector or a ts object of observations.

rho

prior for autoregressive coefficient.

sigma

Prior for the standard deviation of noise of the AR-process.

mu

A fixed value or a prior for the stationary mean of the latent AR(1) process. Parameter is omitted if this is set to 0.

sd_y

Prior for the standard deviation of observation equation.

beta

Prior for the regression coefficients.

xreg

Matrix containing covariates.

Value

Object of class ar1_lg.

Examples

Run this code
# NOT RUN {
model <- ar1_lg(BJsales, rho = uniform(0.5,-1,1), 
  sigma = halfnormal(1, 10), mu = normal(200, 200, 100), 
  sd_y = halfnormal(1, 10))
out <- run_mcmc(model, iter = 2e4)
summary(out, return_se = TRUE)
# }

Run the code above in your browser using DataLab