GSADF_Y: GSADF test statistic and the BSADF sequence for a real time...

Description Usage Arguments Details Value Examples

View source: R/function_PSY.R

Description

This function computes the GSADF test statistic and the BSADF sequence for a real time series data

Usage

1
GSADF_Y(y, r0, lag, select, clust_number)

Arguments

y

is a T x 1 numeric vector

r0

is the minimum window size fraction

lag

is the number of lags in the ADF regression

select

is a character object choosing either a "Fixed" number of lags in the ADF regression or by using the the "BIC"/"AIC" criteria

clust_number

is the number of clusters for parallel computation

Details

This function computes the GSADF test statistic and BSADF sequence for a real time series data. The minimum window size fraction suggested by PSY(2015) is r0=0.01+1.8/sqrt(length(y))

Value

results is a list containing the GSADF test statistic and the BSADF sequence

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
#Replicate the empirical analysis in Table 8 by PSY(2015)

# Read file
path.bit <- system.file("extdata", "SP_DV.csv", package = "bubble")
SP_DV <- read.table(path.bit,  head = TRUE, sep = ";", fill=T, stringsAsFactors = FALSE)
SP_DV <- na.omit( SP_DV[,"PV.ratio", drop=F])
r0=0.01+1.8/sqrt(length(SP_DV[,1]))
gsadf_test <-GSADF_Y(SP_DV[,1], r0, 6 , "BIC", 8)

qe <-c(0.90,0.95,0.99)    #quantiles
m <- 1000
T=length(SP_DV[,1])
clust_number=7
cv_gsadf<- CV_GSADF(qe,m,T,r0, clust_number=7, address)
cat(gsadf_test$gsadf, cv_gsadf, sep = "\t")

## End(Not run)

deanfantazzini/bubble documentation built on Oct. 22, 2020, 2:43 p.m.