SS.sim.tv: Simulation

Description Usage Arguments Details Value Examples

View source: R/SS.sim.tv.R

Description

Simulate a time-varying state space system

Usage

1
SS.sim.tv(F, H, Q, R, length.out, beta0=0)

Arguments

F

A list of d x d matrices.

H

A list of n x d matrices.

Q

A list of d x d matrices.

R

A list of n x n matrices.

length.out

A scalar integer.

beta0

Initial state value. A scalar, or a vector of length d.

Details

This function is a more general, and slower, implementation of SS.sim. This function can also accept arguments in non-time-varying fashion (a la SS.sim).

Value

A named list.

Beta

A T x d matrix, the ith row of which is the state at time i.

Y

A T x n matrix, the ith row of which is noiseless observation at time i.

Z

A T x n matrix, the ith row of which is observation at time i.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(9999)

H.tv <- list()
for(i in 1:200) {
	H.tv[[i]] <- matrix( c( sin(i * 0.05), cos(i * 0.05) ), 1, 2 )
}

ssx <- SS.sim.tv( 0.99, H.tv, 0.001, 1, 200, c(4,4) )

plot(ssx$Z[ ,1], type="l")

SSsimple documentation built on Dec. 7, 2019, 9:06 a.m.