sampleARphi: Sample the autoregressive coefficients in an AR(1) Model

Description Usage Arguments Details Value Note

View source: R/component_samplers.R

Description

Compue one draw of the autoregressive coefficients phi in an AR(1) model. The sampler also applies to a multivariate case with independent components.

Usage

1
sampleARphi(yt, phi_j, sigma_tj, prior_phi = NULL)

Arguments

yt

the T x p matrix of centered multivariate time series (i.e., the time series minus the unconditional means, mu)

phi_j

the p x 1 vector of previous AR(1) coefficients

sigma_tj

the (T-1) x p matrix or p x 1 vector of error standard deviations

prior_phi

the parameters of the prior for the AR(1) coefficients phi_j; either NULL for uniform on [-0.99,0.99] or a 2-dimensional vector of (shape1, shape2) for a Beta prior on [(phi_j + 1)/2]

Details

Sample the AR(1) coefficients phi_j using the model

y_tj = mu_j + phi_j(y_{t-1,j} - mu_j) + e_tj,

with e_tj ~ N(0, sigma[j]^2)

Value

p x 1 vector of sampled AR(1) coefficient(s)

Note

For the standard AR(1) case, p = 1. However, the function applies more generally for sampling p > 1 independent AR(1) processes (jointly).


drkowal/FDLM documentation built on May 20, 2019, 5:20 p.m.