#
# PT_L16 Model (1450-1640) (Cut-and-paste code to window above and Run)
#
#
# Measurement Matrix (Growth-X), (N+X-U), (U+X+N-Q)
# Q N U X
#[1,] 0.5365 0.431 0.499 -0.527
#[2,] 0.0684 0.819 -0.507 0.260
#[3,] -0.2825 0.268 0.702 0.596
#
# Fraction of Variance
#[1] 0.866 0.998 1.000 1.000
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(1.0087165444, 0.001876330, -0.01611471, 0.034913396,
0.0150299096, 1.012329074, 0.07014433, 0.004970298,
0.0007726909, -0.004742479, 0.95763755, -0.001933443,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
PTL16 <- SS(F=f,H=h,K=k,z0=c( 0.034913396, 0.004970298, -0.001933443 , 1.0000000000),
output.names=c("PT1","PT2","PT3"))
print(PTL16)
is.SS(PTL16)
stability(PTL16)
# tfplot(simulate(PTL16,sampleT=150))
PTL16.data <- simulate(PTL16,sampleT=150,start=1450)
#PTL16.data <- simulate(PTL16,sampleT=150,noise=matrix(0,100,3))
PTL16.f <- forecast(l(PTL16,PTL16.data),horizon=150)
tfplot(PTL16.f)
AIC(m <- l(PTL16,PTL16.data))