[R] highfrequency package-jump test

Eric Berger er|cjberger @end|ng |rom gm@||@com
Sat Oct 10 12:33:37 CEST 2020


Hi,
I tried running your code but it is not complete. When you create the xts
you refer to data$PRICE but this has never been defined.

I generated synthetic data and used that to create the xts object as
follows:

x <- runif( length(tm), min=90, max=110 )
data<-xts(x=x,order.by=tm)

When I used this modified code the program executed with no problem.

I hope that helps,
Eric






On Sat, Oct 10, 2020 at 3:13 AM Zixuan Qi <zixuan.qi using duke.edu> wrote:

> Hello,
>
> My programming is as follows.
>
> library(highfrequency)
> library(data.table)
> library(xts)
> tm<-seq.POSIXt(from = as.POSIXct("2020-08-20 09:30:00"),to =
> as.POSIXct("2020-08-20 15:59:00"),by='min')
> data<-xts(x=data$PRICE,order.by=tm)
> data <- as.data.table(data)
> setnames(data,c('index'),c('DT'))
> setnames(data,c('V1'),c('PRICE'))
> LMtest <- intradayJumpTest(pData = data,volEstimator = "RM",
> driftEstimator = "none",RM = "bipower", lookBackPeriod = 20,on = 'minutes',
> k = 5, marketOpen = "09:30:00",marketClose = "15:59:00")
> plot(LMtest)
>
> However, the error is that ''Error in xy.coords(x, y, setLab = FALSE) :
> 'x' and 'y' lengths differ''. I don't know how to correct it.
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list