Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

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)

bssm

Bayesian Inference of Non-Linear and Non-Gaussian State Space Models

v1.1.4
GPL (>= 2)
Authors
Jouni Helske [aut, cre] (<https://orcid.org/0000-0001-7130-793X>), Matti Vihola [aut] (<https://orcid.org/0000-0002-8041-7222>)
Initial release
2021-04-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.