Learn R Programming

SSsimple (version 0.6.6)

SS.sim: Simulation

Description

Simulate a state space system

Usage

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.

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.

Details

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

Examples

Run this code
# NOT RUN {
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)
}
# }

Run the code above in your browser using DataLab