Does anyone here has a code for HY estimator, preferably in python?

I have written a very basic code in python but my results are weird. When I run it for two liquid assets traded on two different exchanges simultaneously, I get a correlation of only 0.8% and a lead/analysis shows a kink at 1-sec. It is the same asset trading in two places so the correlation has to be fairly significant and 1-sec of lead/lag is very very unlikely. I was wondering if someone can help or share a few pointers?

I know of the yuima library in R which implements this, but my knowledge of R minimal and hence looking for some help.

| improve this question | | | | |
  • $\begingroup$ What is the HY estimator? You could please bring more details on that (reference to the page or equation in the quoted paper) as I could not find any reference of "HY" in the paper... $\endgroup$ – JejeBelfort Jul 26 '17 at 7:50
  • $\begingroup$ HY estimator is Hayashi-Yoshida estimator, used to find correlation between asynchronous time series data. I've updated the link with an explicit implementation of the paper $\endgroup$ – nimbus3000 Jul 27 '17 at 8:29

Unfortunately for you (but maybe helpful to others) I can only refer to R packages.

The R package high-frequency (link) provides rHYCov. The synchrony package (link) provides a whole plethora of methods for temporal, spatial and spatio-temporal statistics.

Furthermore, I would personally advise against HY for its boundary artefacts and instead use something more robust like cross-correlation with the Bjornstad-Falck kernel.

| improve this answer | | | | |
  • $\begingroup$ Thanks a lot for the reply, I will look in to Bjornstad-Falck kernel. In the meantime, can you tell me what kind of numbers do you get/expect for correlation for same assets that trade on different venues at the same time $\endgroup$ – nimbus3000 Jul 28 '17 at 11:54
  • 1
    $\begingroup$ I'm doing 4-fold oversampling, so if the mean arrival time is 100 ms, I'm looking for leads/lags with 25 ms resolution, I then get a correlation of about 0.95 to 0.99 on the main lag, 0.90 to 0.92 on the first side lags, 0.40 to 0.60 on the second side lags. $\endgroup$ – hroptatyr Jul 28 '17 at 13:03
  • 1
    $\begingroup$ Oh, I forgot to mention that Bjornstad-Falck is quite a bit slower, just in case you need it for low-latency HFT. $\endgroup$ – hroptatyr Jul 28 '17 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.