#
# UK_L16 Model (1450-1640) # Cut and paste code below into window above and Run (Cmd-Enter)
#
#
# Measurement Matrix # Growth-X, U-N, Q-N-X
# Q N U X
#[1,] 0.510 0.503 0.479 -0.508
#[2,] -0.142 -0.426 0.859 0.247
#[3,] 0.450 -0.752 -0.168 -0.452
#
# Fraction of Variance
#[1] 0.96 1.00 1.00 1.00
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(1.0040561088, 0.002898118, -0.02017946, 0.0362525059,
0.0078067024, 1.010722544, -0.09327856, 0.0022740728,
-0.0001792208, 0.003247002, 0.97879268, 0.0006215269,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
#
# Stabilize
# f[1,1] <- .9
# f[2,2] <- .9
#
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
UKL16 <- SS(F=f,H=h,K=k,z0=c( 0.0362525059, 0.0022740728, 0.0006215269, 1.0000000000),
output.names=c("UK1","UK2","UK3"))
print(UKL16)
is.SS(UKL16)
stability(UKL16)
# tfplot(simulate(UKL16,sampleT=100))
UKL16.data <- simulate(UKL16,sampleT=100)
# UKL16.data <- simulate(UKL16,sampleT=100,noise=matrix(0,100,3))
UKL16.f <- forecast(l(UKL16,UKL16.data),horizon=100)
tfplot(UKL16.f)
AIC(m <- l(UKL16,UKL16.data))
shockDecomposition(toSSChol(m))
#
# LCI Parameter UCI P>=T[1] P< T[1] Std. Dev. Bias Bias-z
# [1,] 1.0019583 1.0040561 1.006e+00 0.37 0.63 1.671e-03 0.0002679 0.1603
# [2,] 0.0070602 0.0078067 8.605e-03 0.47 0.53 6.574e-04 0.9962494 1515.3512
# [3,] -0.0002818 -0.0001792 -7.811e-05 0.47 0.53 8.675e-05 1.0042494 11576.2444
# [4,] -0.0058580 0.0028981 1.100e-02 0.38 0.62 6.865e-03 1.0024621 146.0264
# [5,] 1.0056276 1.0107225 1.016e+00 0.29 0.71 3.816e-03 -0.0048368 -1.2675
# [6,] 0.0028581 0.0032470 3.622e-03 0.50 0.50 2.960e-04 1.0008217 3380.8896
# [7,] -0.1332992 -0.0201795 7.764e-02 0.41 0.59 8.917e-02 1.0571282 11.8557
# [8,] -0.1409037 -0.0932786 -5.438e-02 0.39 0.61 3.500e-02 1.1087346 31.6814
# [9,] 0.9695138 0.9787927 9.863e-01 0.42 0.58 6.540e-03 0.0271727 4.1546
#[10,] 0.0354255 0.0362525 3.748e-02 0.54 0.46 9.060e-04 0.9674434 1067.8009
#[11,] 0.0007853 0.0022741 3.800e-03 0.45 0.55 1.324e-03 1.0017766 756.4736
#[12,] 0.0004852 0.0006215 7.462e-04 0.58 0.42 1.006e-04 1.0034153 9974.3169
#