rw2: Construct a second-order random walk component

View source: R/rw.R

rw2R Documentation

Construct a second-order random walk component

Description

Auxiliary function used inside of the formula of walker.

Usage

rw2(formula, data, beta, sigma = c(2, 1e-04), nu, gamma = NULL)

Arguments

formula

Formula for RW2 part of the model. Only right-hand-side is used.

data

Optional data.frame.

beta

A vector of length two which defines the prior mean and standard deviation of the Gaussian prior for coefficients at time 1.

sigma

A vector of length two, defining the Gamma prior for the slope level standard deviation. First element corresponds to the shape parameter and second to the rate parameter. Default is Gamma(2, 0.0001).

nu

A vector of length two which defines the prior mean and standard deviation of the Gaussian prior for the slopes nu at time 1.

gamma

An optional k times n matrix defining a known non-negative weights of the slope noises, where k is the number of coefficients and n is the number of time points. Then, the standard deviation of the noise term for each coefficient's slope is of form gamma_t * sigma (instead of just sigma).


walker documentation built on Sept. 11, 2024, 8:33 p.m.