Description Usage Arguments Value Author(s) Examples
Likelihood function value is calcuated for the intervention
1 |
delta |
The specific number for Intervention Level estimated |
z |
The time series we fit into the model |
T |
The start of the Intervention in the series |
xint |
The covariate considered in the model |
itype |
The type of intervention fitting in the model:"Step"(Default),"Step" |
... |
Supported argment for arima function |
Likelihood value is provided
Jinkun Xiao and A. I. McLeod
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ###Likelihood Test for Casualties with null:delta=1###
###Constrained Model Likelihood####
(LLRestricted<-GetLikeDI(delta=0,z=casualties[,1],T=70,xint=scale(casualties[,2]),
itype="s",order=c(1,0,0),seasonal=list(order=c(0,0,1),period=12)))
###Full Model Likelihood###
(LLFull <- optimize(f = GetLikeDI, interval = c(0.1, 2), maximum = TRUE,
z = casualties[,1], T = 70, xint = scale(casualties[,2]), itype = "s",
order=c(1,0,0),seasonal=list(order=c(0,0,1),period=12)))
X <- 2 * (LLFull$objective - LLRestricted)
###P-VLUE For Likelihood Test###
(pval <- 1 - pchisq(X, 1))
GetPV(delta0=1,z=casualties[,1],T=70,xint=scale(casualties[,2]),itype="s",order=c(1,0,0),
seasonal=list(order=c(0,0,1),period=12))
######################################################
###Likelihood Test for Nile Flow with null:delta=1####
LLRestricted <- GetLikeDI(delta=1,z=Nile,T=34,itype="p",order=c(1,0,0))
ans <- optimize(f = GetLikeDI, interval = c(0.1, 2), maximum = TRUE,z=Nile,T=33
,itype="p",order=c(1,0,0))
LLFull <- ans$objective
X <- 2 * (LLFull - LLRestricted)
(pval <- 1 - pchisq(X, 1))
GetPV(delta0=0,z=Nile,T=34,itype="p",order=c(1,0,0))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.