#
# ES_L16 Model (1450-1640) Cut-and-paste code below into window above and Run
#
#
# Measurement Matrix (Growth-X), (Q+U+X-N), (N+X-Q)
# Q N U X
#[1,] 0.498 0.503 0.5025 -0.4966
#[2,] 0.600 -0.304 0.3523 0.6507
#[3,] -0.193 0.796 -0.0414 0.5717
#
# Fraction of Variance
#[1] 0.981 1.000 1.000 1.000
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(0.9938492938, 0.028443301, -0.08335018, 0.032501513,
-0.0048445979, 1.017269161, -0.05759700, -0.002428944,
0.0001853692, 0.004889928, 0.99132122, -0.000631717,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
ESL16 <- SS(F=f,H=h,K=k,z0=c( 0.032501513, -0.002428944, -0.000631717 , 1.0000000000),
output.names=c("ES1","ES2","ES3"))
print(ESL16)
is.SS(ESL16)
stability(ESL16)
# tfplot(simulate(ESL16,sampleT=150))
ESL16.data <- simulate(ESL16,sampleT=150,start=1450)
#ESL16.data <- simulate(ESL16,sampleT=150,noise=matrix(0,150,3),start=1450)
ESL16.f <- forecast(l(ESL16,ESL16.data),horizon=150)
tfplot(ESL16.f)
AIC(m <- l(ESL16,ESL16.data))
ESL16x <- SS(F=f,H=h,Q=eye(4,3),R=eye(3,3),z0=c( 0.032501513, -0.002428944, -0.000631717 , 1.0000000000),
output.names=c("ES1","ES2","ES3"))
shockDecomposition(ESL16x)
#
# LCI Parameter UCI P>=T[1] P< T[1] Std. Dev. Bias Bias-z
# [1,] 9.915e-01 0.9938493 0.9955407 0.50 0.50 0.0016115 0.0003003 0.1864
# [2,] 4.468e-03 0.0048446 0.0053286 0.55 0.45 0.0003277 0.9889332 3017.3879
# [3,] 6.341e-05 0.0001854 0.0003119 0.52 0.48 0.0001004 0.9936542 9901.4894
# [4,] -3.815e-02 -0.0284433 -0.0203787 0.56 0.44 0.0081351 1.0215217 125.5694
# [5,] 1.012e+00 1.0172692 1.0224512 0.39 0.61 0.0041414 -0.0225025 -5.4336
# [6,] -5.506e-03 -0.0048899 -0.0043440 0.54 0.46 0.0004618 0.9987168 2162.5271
# [7,] -2.630e-01 -0.0833502 0.0856603 0.53 0.47 0.1329285 1.0612722 7.9838
# [8,] 1.334e-02 0.0575970 0.1002258 0.61 0.39 0.0326645 0.9279172 28.4075
# [9,] 9.822e-01 0.9913212 1.0009248 0.36 0.64 0.0077428 0.0056673 0.7319
#[10,] 3.069e-02 0.0325015 0.0345168 0.58 0.42 0.0014640 0.9609355 656.3692
#[11,] 1.243e-03 0.0024289 0.0034896 0.50 0.50 0.0008697 0.9913829 1139.9044
#[12,] -7.686e-04 -0.0006317 -0.0005099 0.51 0.49 0.0001187 0.9944933 8378.8214