# Cut-and-Paste Code Below into Window Above and Run
#
# UKE20 World Model
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
#
# Measurement Matrix (overall-HOURS-XREAL), (XREAL+Q-HOURS), (X-XREAL-L-N)
#
# Q N U HOURS XREAL X L
#
#[1,] 0.393 0.3980 0.4139 -0.389 -0.234 0.382 0.4044
#[2,] 0.332 -0.0935 -0.0245 -0.236 0.886 0.177 -0.0875
#[3,] -0.133 -0.4756 -0.1471 -0.440 -0.273 0.571 -0.3739
#
# Fraction of Variance
#[1] 0.828 0.947 0.993 1.000 1.000 1.000 1.000
#
f <- matrix( c(1.003480735, -0.03861603, -0.008671156, 0.14766638,
0.039874097, 1.06097693, 0.162696069, 0.04785732,
0.005711577, -0.11211210, 0.938690394, -0.04842753,
0.000000000, 0.00000000, 0.000000000 , 1.00000000
),byrow=TRUE,nrow=4,ncol=4)
h <- matrix(c(1, 0, 0, 0,
0 , 1, 0, 0,
0, 0 , 1, 0
),byrow=TRUE,nrow=3,ncol=4)
k <- (f[1:4,1:3,drop=FALSE])
UKE20 <- SS(F=f,H=h,K=k,z0=c(0.14766638, 0.04785732, -0.04842753, 1.00000000),
output.names=c("UK1","UK2","UK3"))
print(UKE20)
is.SS(UKE20)
stability(SS(F=f[1:3,1:3,drop=FALSE],R=eye(3),Q=eye(3),H=eye(3)))
# tfplot(simulate(UKE20,sampleT=100))
UKE20.data <- simulate(UKE20,sampleT=50,noise=matrix(0,50,3),start=1950)
UKE20.f <- forecast(l(UKE20,UKE20.data),horizon=150)
tfplot(UKE20.f)
AIC(l(UKE20,UKE20.data))