print.dlmodeler: Print a model

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/dlmodeler-core.R

Description

Prints a short message describing a DLM.

Usage

1
2
## S3 method for class 'dlmodeler'
print(x,...)

Arguments

x

model to be printed.

...

unused.

Details

This function will print the dimensions of the DLM, the time-varying terms, and the names of the components.

Value

No value.

Author(s)

Cyrille Szymanski <cnszym@gmail.com>

See Also

dlmodeler.build

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require(dlmodeler)

# a stochastic level+trend DLM
mod <- dlmodeler.build(
		a0 = c(0,0), # initial state: (level, trend)
		P0 = diag(c(0,0)), # initial state variance set to...
		P0inf = diag(2), # ...use exact diffuse initialization
		matrix(c(1,0,1,1),2,2), # state transition matrix
		diag(c(1,1)), # state disturbance selection matrix
		diag(c(.5,.05)), # state disturbance variance matrix
		matrix(c(1,0),1,2), # observation design matrix
		matrix(1,1,1) # observation disturbance variance matrix
)
# print the model
mod
# check if it is valid
dlmodeler.check(mod)[1]==1

# an empty DLM with 4 state variables (3 of which are stocastic)
# and bi-variate observations
mod <- dlmodeler.build(dimensions=c(4,3,2))
# print the model
mod
# check if it is valid
dlmodeler.check(mod)[1]==1

Example output

constant dlmodel(state dim=2, dist dim=2, obs dim=1) 'noname'
 - model has 1 component: noname
status 
  TRUE 
constant dlmodel(state dim=4, dist dim=3, obs dim=2) 'noname'
 - model has 1 component: noname
status 
  TRUE 

dlmodeler documentation built on May 29, 2017, 11:33 a.m.