# Cut-and-Paste Code Below into Window Above an Run
#
# UK_E20 Model
#
# Measurement Matrix (overall-HOURS-XREAL), (XREAL-X), (Q-N-L-U)
#
# 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
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
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.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
#
# To create RWf model, uncomment following line
# f[1,1] <- f[2,2] <- f[3,3] <- 1.0
#
# To Stabilize, uncomment next line
# f[1,1] <- f[3,3]; f[2,2] <- f[3,3];
#
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
UK_E20 <- SS(F=f,H=h,K=k,z0=c( 0.12654495, 0.10806276, 0.02649331, 1.0000000000),
output.names=c("UK1","UK2","UK3"))
print(UK_E20)
is.SS(UK_E20)
stability(UK_E20)
UK_E20.data <- simulate(UK_E20,sampleT=50,start=1900)
# UK_E20.data <- simulate(UK_E20,sampleT=20,noise=matrix(0,20,3))
UK_E20.f <- forecast(l(UK_E20,UK_E20.data),horizon=50)
tfplot(UK_E20.f)
AIC(l(UK_E20,UK_E20.data))
shockDecomposition(toSSChol(UK_E20),horizon=10,shock=rep(-1,10))