Last active
July 26, 2019 07:31
-
-
Save StuartGordonReid/a91c5a15148354f31c20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' @title Compute the Mr statistic. | |
#' | |
#' @description Compute the Mr statistic. The Md statistic is the ratio between | |
#' two estimate values for Sigma computed using the calibrateSigma function for | |
#' sampling intervals 1 and the estimate value for Sima computed using the | |
#' CalibrateSigmaOverlapping function for sampling inveral q minus 1. | |
#' This statistic should converge to zero. | |
#' | |
#' @inheritParams calibrateSigma | |
#' @return Mr double :: The Mr statistic defined by Lo and MacKinlay. | |
#' | |
mRatio <- function(X, q, annualize = FALSE, unbiased = TRUE) { | |
# Estimate the value of sigma at sampling intervals 1 and q. | |
sigmaA <- calibrateSigma(X, q = 1, annualize, unbiased) | |
sigmaB <- calibrateSigmaOverlapping(X, q = q, annualize, unbiased) | |
Mr <- (sigmaB / sigmaA) - 1 | |
return(Mr) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment