#
# MXL20 Model
#
# Measurement Matrix
# EN.ATM.CO2E.KT EG.USE.COMM.KT.OE NY.GDP.MKTP.KD SL.TLF.TOTL.IN
#[1,] 0.415 0.4179 0.414 0.414
#[2,] -0.118 -0.0828 -0.292 -0.212
#[3,] 0.722 0.2918 -0.168 -0.561
# SP.POP.TOTL SL.UEM.TOTL.ZS
#[1,] 0.419 0.368
#[2,] -0.106 0.915
#[3,] -0.208 -0.088
#
# Fraction of Variance
#[1] 0.944 0.990 0.996 0.999 1.000 1.000
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(0.995795312, -0.04389221, -0.04932056, 0.156110138,
-0.005125015, 0.78449230, 0.22102034, 0.010643033,
0.003185682, 0.03419264, 0.87541039, 0.004387268,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
MXL20 <- SS(F=f,H=h,K=k,z0=c( 0.156110138, 0.010643033, 0.004387268, 1.0000000000),
output.names=c("MX1","MX2","MX3"))
print(MXL20)
is.SS(MXL20)
stability(MXL20)
# tfplot(simulate(MXL20,sampleT=100))
MXL20.data <- simulate(MXL20,sampleT=20,noise=matrix(0,20,3))
MXL20.f <- forecast(l(MXL20,MXL20.data),horizon=50)
tfplot(MXL20.f)
AIC(l(MXL20,MXL20.data))
shockDecomposition(toSSChol(MXL20))
#
# Bootstrap Confidence Intervals
#
# LCI Parameter UCI P>=T[1] P< T[1] Std. Dev.
# [1,] 0.9795349 0.995795 1.011657 0.44 0.56 0.012788
# [2,] -0.0168112 -0.005125 0.005832 0.41 0.59 0.009914
# [3,] 0.0003689 0.003186 0.005392 0.35 0.65 0.001994
# [4,] -0.1155554 -0.043892 0.021746 0.55 0.45 0.055272
# [5,] 0.6820285 0.784492 0.859303 0.44 0.56 0.071999
# [6,] 0.0148318 0.034193 0.056536 0.56 0.44 0.018544
# [7,] -0.2092470 -0.049321 0.125905 0.41 0.59 0.138963
# [8,] 0.0627268 0.221020 0.453386 0.41 0.59 0.149187
# [9,] 0.8134918 0.875410 0.922576 0.38 0.62 0.040374
#[10,] 0.1456560 0.156110 0.169613 0.88 0.12 0.010703
#[11,] -0.0146558 0.010643 0.037577 0.50 0.50 0.019989
#[12,] -0.0027028 0.004387 0.011754 0.45 0.55 0.005313
#