# Compute jump test statistic

6 messages
Open this post in threaded view
|
Report Content as Inappropriate

## Compute jump test statistic

 Im trying to compute the following statistic testing for jumps in high frequecy asset prices, J t,M  =  (1  MedRVt,M / RVt,M) /(sqrt*( 0.96 * 1/M * max(1, MedRQt,M/ MedRV2t,M )) I have in R: ## ADS Test Statistic > numr = 1 - (outads\$medrv/outads\$rv)> outads\$medrq/(outads\$medrv^2) -> denom2> fix(denom2) But when I  try to run the max(1, MedRQt,M/ MedRV2t,M)) part I get: > max(1, denom2)[1] NA I guess this is returned because I am tryin to maximise a time series / sequence against a constant but I am not sure how to run this? Any advice? Thanks         [[alternative HTML version deleted]] _______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Compute jump test statistic

Open this post in threaded view
|
Report Content as Inappropriate

## Re: Compute jump test statistic

 In reply to this post by cursethiscure Sorry please find the outads data attached as a csv file.  For the max(1, MedRQ/MedRV^2))  where MedRQ/MedRV is: `outads\$medrq/(outads\$medrv^2) -> outads\$denom2`  in the csv file.  I am trying to return the maximum of either 1 or MedRQ/MedRV^2 (i'm  aware all values are greater than 1, but this needs to be applied to  other data sets) but I do not know how to maximise a constant against  time-series sequence. Everything else is ok. I just dont know how to  return this argumentoutads.csv
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Compute jump test statistic

 A csv does not contain R objects.  How did you read the csv into R? On Mon, Jun 18, 2012 at 3:24 PM, cursethiscure <[hidden email]> wrote: > Sorry please find the outads data attached as a csv file. > >  For the max(1, MedRQ/MedRV^2)) > >  where MedRQ/MedRV is: `outads\$medrq/(outads\$medrv^2) -> outads\$denom2` >  in the csv file. > >  I am trying to return the maximum of either 1 or MedRQ/MedRV^2 (i'm >  aware all values are greater than 1, but this needs to be applied to >  other data sets) but I do not know how to maximise a constant against >  time-series sequence. Everything else is ok. I just dont know how to >  return this argument http://r.789695.n4.nabble.com/file/n4633741/outads.csv> outads.csv > > -- > View this message in context: http://r.789695.n4.nabble.com/Compute-jump-test-statistic-tp4633731p4633741.html> Sent from the Rmetrics mailing list archive at Nabble.com. > > _______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-sig-finance> -- Subscriber-posting only. If you want to post, subscribe first. > -- Also note that this is not the r-help list where general R questions should go. _______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Compute jump test statistic

 What do you want to do with all of the NAs in your data.  You can't apply functions like max to data with NA > max(0, 1) [1] 1 > max(NA, 1) [1] NA Maybe you want to use na.omit? > max(na.omit(c(NA, 0)), 1) [1] 1 HTH, Garrett On Mon, Jun 18, 2012 at 4:29 PM, G See <[hidden email]> wrote: > A csv does not contain R objects.  How did you read the csv into R? > > > On Mon, Jun 18, 2012 at 3:24 PM, cursethiscure > <[hidden email]> wrote: >> Sorry please find the outads data attached as a csv file. >> >>  For the max(1, MedRQ/MedRV^2)) >> >>  where MedRQ/MedRV is: `outads\$medrq/(outads\$medrv^2) -> outads\$denom2` >>  in the csv file. >> >>  I am trying to return the maximum of either 1 or MedRQ/MedRV^2 (i'm >>  aware all values are greater than 1, but this needs to be applied to >>  other data sets) but I do not know how to maximise a constant against >>  time-series sequence. Everything else is ok. I just dont know how to >>  return this argument http://r.789695.n4.nabble.com/file/n4633741/outads.csv>> outads.csv >> >> -- >> View this message in context: http://r.789695.n4.nabble.com/Compute-jump-test-statistic-tp4633731p4633741.html>> Sent from the Rmetrics mailing list archive at Nabble.com. >> >> _______________________________________________ >> [hidden email] mailing list >> https://stat.ethz.ch/mailman/listinfo/r-sig-finance>> -- Subscriber-posting only. If you want to post, subscribe first. >> -- Also note that this is not the r-help list where general R questions should go. _______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.