#
# Cut-and-pate Code Below into Window Above and Run
# WL20_US BAU Model
#
# Measurement Matrix
# Q N HOURS XREAL X L
#[1,] 0.4124 0.403 0.413 0.410 0.399 0.412
#[2,] -0.1464 -0.580 -0.122 0.310 0.711 -0.160
#[3,] -0.0825 -0.546 0.137 0.358 -0.466 0.575
#
# Fraction of Variance
#[1] 0.977 0.999 1.000 1.000 1.000 1.000
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(1.026261160, -0.04873236, 0.04995449, 0.166789178,
0.023195483, 1.01292512, 0.06694359, 0.004293523,
-0.002685722, -0.04074830, 1.04458649, -0.006797188,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
WL20US <- SS(F=f,H=h,K=k,z0=c(0.166789178, 0.004293523, -0.006797188, 1.0000000000),
output.names=c("US1","US2","US3"))
print(WL20US)
is.SS(WL20US)
stability(WL20US)
n <- 100
# tfplot(simulate(WL20US,sampleT=n))
WL20US.data <- simulate(WL20US,sampleT=n,noise=matrix(0,n,3))
WL20US.f <- forecast(l(WL20US,WL20US.data),horizon=n)
tfplot(WL20US.f)
AIC(l(WL20US,WL20US.data))