#
# DE_L16 Model (1450-1640) Cut-and-Paste code below into window Above and Run
#
#
# Measurement Matrix (Growth), (Q-U), (Q-N)
# Q N U
#[1,] 0.569 0.6162 0.545
#[2,] 0.634 0.0932 -0.768
#[3,] 0.524 -0.7821 0.338
#
# Fraction of Variance
#[1] 0.875 1.000 1.000
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(0.9930645965, 0.013567220, 0.07110634, 0.025781090,
-0.0122882425, 1.017812347, 0.13803848, -0.0058067085,
-0.0003141255, -0.003113629, 0.99394721, 0.0008837229,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
#
# To Stabilize, Uncomment the following three lines
# f[1,1] <- .98
# f[2,2] <- 1
# f[3,3] <- 1
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
DEL16 <- SS(F=f,H=h,K=k,z0=c( 0.0257810907, -0.0058067085, 0.0008837229 , 1.0000000000),
output.names=c("DE1","DE2","DE3"))
print(DEL16)
is.SS(DEL16)
stability(DEL16)
# tfplot(simulate(DEL16,sampleT=150))
DEL16.data <- simulate(DEL16,sampleT=150,start=1450)
#DEL16.data <- simulate(DEL16,sampleT=150,noise=matrix(0,100,3))
DEL16.f <- forecast(l(DEL16,DEL16.data),horizon=150)
tfplot(DEL16.f)
AIC(m <- l(DEL16,DEL16.data))
shockDecomposition(toSSChol(m))
# To construct reasonable probabilistic counterfactuals,
# reset coefficients to values between bootstrap LCI and UCI
#
# LCI Parameter UCI P>=T[1] P< T[1] Std. Dev. Bias Bias-z
# [1,] 0.9915504 0.9930646 0.9943037 0.44 0.56 0.0011117 0.0002437 0.2192
# [2,] -0.0135637 -0.0122882 -0.0113711 0.46 0.54 0.0008673 1.0055354 1159.3712
# [3,] -0.0004753 -0.0003141 -0.0001518 0.52 0.48 0.0001359 0.9933763 7311.4855
# [4,] 0.0109488 0.0135672 0.0166961 0.42 0.58 0.0022277 0.9796733 439.7772
# [5,] 1.0124587 1.0178123 1.0241427 0.39 0.61 0.0045990 -0.0241979 -5.2615
# [6,] -0.0036734 -0.0031136 -0.0027628 0.61 0.39 0.0003558 0.9961265 2799.4957
# [7,] -0.0184579 0.0711063 0.1531018 0.50 0.50 0.0686051 0.9189129 13.3942
# [8,] 0.0631675 0.1380385 0.1996136 0.68 0.32 0.0469231 0.8391790 17.8842
# [9,] 0.9853999 0.9939472 1.0012852 0.39 0.61 0.0062504 0.0012422 0.1987
#[10,] 0.0240994 0.0257811 0.0273476 0.57 0.43 0.0012968 0.9670832 745.7303
#[11,] -0.0087828 -0.0058067 -0.0035835 0.50 0.50 0.0019612 0.9989795 509.3658
#[12,] 0.0006764 0.0008837 0.0010649 0.48 0.52 0.0001442 0.9921788 6882.8693
#