SS.sim: Simulation

Description Usage Arguments Details Value Note Examples

View source: R/SS.sim.R

Description

Simulate a state space system

Usage

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

Arguments

F

The state matrix. A scalar, or vector of length d, or a d x d matrix. When scalar, F is constant diagonal. When a vector, F is diagonal.

H

The measurement matrix. Must be n x d.

Q

The state variance. A scalar, or vector of length d, or a d x d matrix. When scalar, Q is constant diagonal. When a vector, Q is diagonal.

R

The measurement variance. A scalar, or vector of length n, or an n x n matrix. When scalar, R is constant diagonal. When a vector, R is diagonal.

length.out

Scalar integer.

beta0

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

Details

H is the master argument from which system dimensionality is determined.

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 the noiseless observation at time i.

Z

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

Note

For a definition of the system of interest, please see SSsimple.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
tau <- 30	
	
x <- I( 0:10 / 10 )

H <- H.omega.sincos( x, c( 1*pi, 4*pi ) )

xs <- SS.sim( 0.99, H, 1, 2, tau, rep(0, ncol(H)) )

## Not run: 
for(i in 1:nrow(xs$Z)) {
	plot(x, xs$Z[ i, ], ylim=range(xs$Z), main=i)
	Sys.sleep(1/10)
}

## End(Not run)

Example output

Loading required package: mvtnorm

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