#
# DEL20 BAU Model
# Cut-and-paste the following code into the window above and Run (Cmd-Enter)
#
#Measurement Matrix
# EN.ATM.CO2E.KT EG.USE.COMM.KT.OE NY.GDP.MKTP.KD SL.TLF.TOTL.IN
#[1,] 0.333 0.3207 0.3460 0.360
#[2,] 0.286 0.4125 -0.2792 -0.119
#[3,] -0.603 0.0753 -0.0969 -0.198
# SP.POP.TOTL SL.UEM.TOTL.ZS KOF EF HDI
#[1,] 0.344 0.348 0.361 0.206 0.353
#[2,] -0.192 -0.226 -0.048 0.722 -0.213
#[3,] 0.620 -0.105 0.324 0.230 -0.168
# Fraction of Variance
#[1] 0.827 0.968 0.987 0.994 0.997 0.999 1.000 1.000 1.000
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(0.95349473, 0.01511665, 0.09597823, 0.165278528,
-0.03688928, 0.94701798, 0.14835340, 0.006940459,
-0.01833974, -0.06112404, 0.89684472, 0.020441322,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
DEL20 <- SS(F=f,H=h,K=k,z0=c(0.165278528, 0.006940459, 0.020441322, 1.0000000000),
output.names=c("DE1","DE2","DE3"))
print(DEL20)
is.SS(DEL20)
stability(DEL20)
# tfplot(simulate(DEL20,sampleT=100))
DEL20.data <- simulate(DEL20,sampleT=50,noise=matrix(0,20,3))
DEL20.f <- forecast(m <- l(DEL20,DEL20.data),horizon=50)
tfplot(DEL20.f)
AIC(m)