How does R calculate realized variance and bipower variance and how can I reproduce results in Excel?

Hello!

I need help understanding how does R calculate realized variance and bipower variance in highfrequancy package. I am trying to identify days in my data in which price jump occur using Barndorff-Nielsen and Shephard test. However, even though R gives me solution I don't quite understand the formula it uses and I would like to reproduce results in excel as well. I'm using rCov and rBPCov functions. My data set is made of stock prices every minute for 63 days. Thank you for your help!

RV=rCov(data.xts,alignBy="minutes",alignPeriod=1,makeReturns=TRUE)

BP=rBPCov(data.xts,alignBy="minutes",alignPeriod=1,makeReturns=TRUE)

1 Like

Checking highfrequency/realizedMeasures.R at master · jonathancornelissen/highfrequency · GitHub shall answer your question.

Regards,
Grzegorz

Thank you for your help!
Could you tell me is it possible to extract returns that R calculates in makeReturns=TRUE? I want to alignPeriod to be 7 minutes, so I'm wondering can I somehow see returns that R makes and takes into calculations for realized variance?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.