dlmLg: Dynamic Linear Model with linear growth

Description Usage Arguments Value Author(s) Examples

View source: R/dlmLg.R

Description

Dynamic Linear Model with linear growth.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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 April 18, 2021, 5:07 p.m.