optsim {timsac}R Documentation

Optimal Control Simulation

Description

Perform optimal control simulation and evaluate the means and variances of the controlled and manipulated variables X and Y.

Usage

  optsim(y, max.order = NULL, ns, q, r, noise = NULL, len, plot = TRUE)

Arguments

y

a multivariate time series.

max.order

upper limit of model order. Default is 2n2 \sqrt{n}, where nn is the length of the time series y.

ns

number of steps of simulation.

q

positive definite matrix QQ.

r

positive definite matrix RR.

noise

noise. If not provided, Gaussian vector white noise with the length len is generated.

len

length of white noise record.

plot

logical. If TRUE (default), controlled variables XX and manipulated variables YY are plotted.

Value

trans

first mm columns of transition matrix, where mm is the number of controlled variables.

gamma

gamma matrix.

gain

gain matrix.

convar

controlled variables XX.

manvar

manipulated variables YY.

xmean

mean of XX.

ymean

mean of YY.

xvar

variance of XX.

yvar

variance of YY.

x2sum

sum of X2X^2.

y2sum

sum of Y2Y^2.

x2mean

mean of X2X^2.

y2mean

mean of Y2Y^2.

References

H.Akaike and T.Nakagawa (1988) Statistical Analysis and Control of Dynamic Systems. Kluwer Academic publishers.

Examples

# Multivariate Example Data
ar <- array(0, dim = c(3,3,2))
ar[, , 1] <- matrix(c(0.4,  0,    0.3,
                      0.2, -0.1, -0.5,
                      0.3,  0.1, 0), nrow = 3, ncol = 3, byrow = TRUE)
ar[, , 2] <- matrix(c(0,  -0.3,  0.5,
                      0.7, -0.4,  1,
                      0,   -0.5,  0.3), nrow = 3, ncol = 3, byrow = TRUE)
x <- matrix(rnorm(200*3), nrow = 200, ncol = 3)
y <- mfilter(x, ar, "recursive")
q.mat <- matrix(c(0.16,0,0,0.09), nrow = 2, ncol = 2)
r.mat <- as.matrix(0.001)
optsim(y, max.order = 10, ns = 20, q = q.mat, r = r.mat, len = 20)

[Package timsac version 1.3.8-4 Index]