dlmLg: Dynamic Linear Model with linear growth

View source: R/dlmLg.R

dlmLgR Documentation

Dynamic Linear Model with linear growth

Description

Dynamic Linear Model with linear growth.

Usage

dlmLg(x, C0, v, W, M0)

Arguments

x

a vector of data X_t.

C0

prior covariance matrix

v

prior variance of V.

W

prior variance of W.

M0

prior mean.

Value

a vector with values from the Dynamic Linear Model.

Author(s)

Shelemyahu Zacks

Examples

C0 <- matrix(c(0.22325, -0.00668, -0.00668, 0.00032), nrow = 2, byrow = TRUE)
W <- matrix(c(0.3191, -0.0095, -0.0095, 0.0004), nrow = 2, byrow = TRUE)
M0 <- matrix(c(134.234, -0.3115), nrow = 2)
v <- 0.1

data(DOW1941)
plot(DOW1941$Date, DOW1941$DOW1941,          
     type="l", 
     ylab="Dow Jones 1941", xlab="Date")
     
lines(DOW1941$Date, dlmLg(DOW1941$DOW1941, C0 = C0, v = v, W = W, M0 = M0))



mistat documentation built on March 7, 2023, 6:43 p.m.