#
# FR_L16 Model (1450-1640) (Cut-and-Paste Code below and Run in window above)
#
#
#Measurement Matrix (Growth), (Q-U-L), (L-U)
# Q N U HOURS L
#[1,] 0.4455 0.4526 0.439 0.454 0.445
#[2,] 0.5105 0.3089 -0.613 0.235 -0.461
#[3,] -0.0141 0.0316 -0.628 -0.156 0.761
#
# Fraction of Variance
#[1] 0.959 0.996 1.000 1.000 1.000
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(.003702664, -0.003729599, 0.006072449, 0.039210961,
0.007264828, 1.001695191, 0.014830938, 0.000516837,
-0.000566718, -0.013438572, 1.003413102, -0.002557882,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
FRL16 <- SS(F=f,H=h,K=k,z0=c( 0.039210961, 0.000516837, -0.002557882, 1.0000000000),
output.names=c("FR1","FR2","FR3"))
print(FRL16)
is.SS(FRL16)
stability(FRL16)
# tfplot(simulate(FRL16,sampleT=100))
FRL16.data <- simulate(FRL16,sampleT=150)
#FRL16.data <- simulate(FRL16,sampleT=150,noise=matrix(0,100,3))
FRL16.f <- forecast(l(FRL16,FRL16.data),horizon=150)
tfplot(FRL16.f)
AIC(m <- l(FRL16,FRL16.data))
shockDecomposition(toSSChol(m))