dlmodeler.operators: Add, multiply or bind models

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

Description

Add two DLMs together, performing an outer sum.

Multiply a model by a numeric constant.

Bind two DLMs together, creating a multi-variate model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
dlmodeler.add(e1, e2, name = NULL)

## S3 method for class 'dlmodeler'
e1 + e2

dlmodeler.multiply(e1, e2)

## S3 method for class 'dlmodeler'
e1 * e2

dlmodeler.bind(e1, e2, name = NULL)

## S3 method for class 'dlmodeler'
e1 %% e2

Arguments

e1, e2

an object of class dlmodeler or a numeric value.

name

an optional name to be given to the resulting DLM.

Details

Addition: The state vector of the resulting DLM is equal to the concatenation of the state vectors of mod1 and mod2. The observation vector of the resulting DLM is equal to the sum of the observation vectors of mod1 and mod2.

Multiplication: the observation vector of the resulting DLM is multiplied by the supplied numeric constant.

Binding: The state vector of the resulting DLM is equal to the concatenation of the state vectors of mod1 and mod2. The observation vector of the resulting DLM is equal to the concatenation of the observation vectors of mod1 and mod2.

Value

An object of class dlmodeler.

Author(s)

Cyrille Szymanski <cnszym@gmail.com>

References

Giovanni Petris, An R Package for Dynamic Linear Models. Journal of Statistical Software, 36(12), 1-16. http://www.jstatsoft.org/v36/i12/.

See Also

dlmodeler

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require(dlmodeler)

# create the following model:
# deterministic level + quarterly seasonal + disturbance
mod1 <- dlmodeler.build.polynomial(0,sigmaH=.1) +
        4* dlmodeler.build.dseasonal(4,sigmaH=0)

# create a multivariate model by binding the previous model
# with a stochastic trend model
mod2 <- mod1 %% dlmodeler.build.polynomial(1,sigmaH=0)

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