ReMeDI
# Check data:
#' @keywords internal
rdatacheck <- function (rData, multi = FALSE)
if ((dim(rData)[2] < 2) & (multi))
stop("Your rData object should have at least 2 columns")
Asymptotic variance of ReMeDI estimator
DEPRECATED
DEPRECATED USE rRVar
Extract data from an xts
object for the exchange hours only
Get high frequency data from Alpha Vantage
Aggregate a time series
Aggregate a data.table
or xts
object containing quote data
Business time aggregation
Make TAQ format
Retain only data from the stock exchange with the highest trading volume
Aggregate a data.table
or xts
object containing trades data´
Inference on drift burst hypothesis
Compute log returns
DEPRECATED
use spreadPrices
Compute Liquidity Measure
Get critical value for the drift burst hypothesis t-statistic
SPY realized measures
#' @keywords internal
zgamma <- function (x, y, gamma_power)
if (x^2 < y)
out <- abs(x)^gamma_power
else
if (gamma_power == 1)
out <- 1.094 * sqrt(y)
if (gamma_power == 2)
out <- 1.207 * y
if (gamma_power == 4/3)
out <- 1.129 * y^(2/3)
return(out)
Retain only data from the stock exchange with the highest volume
Make Open-High-Low-Close-Volume bars
ReMeDI tuning parameter
Lead-Lag estimation
Aggregate a time series but keep first and last observation
# Difference of medians test
# See Fried (2012)
# Returns TRUE if H0 is rejected
# importFrom stats density
# keywords internal
DMtest <- function(x, y, alpha = 0.005)
m <- length(x)
n <- length(y)
xmed <- median(x)
ymed <- median(y)
xcor <- x - xmed
ycor <- y - ymed
delta1 <- ymed - xmed
out <- density(c(xcor, ycor), kernel = "epanechnikov")
fmed <- as.numeric(BMS::quantile.density(out, probs = 0.5))
fmedvalue <- (out$y[max(which(out$x < fmed))] +
out$y[max(which(out$x < fmed))+1])/2
test <- sqrt((m*n)/(m + n))*2*fmedvalue*delta1
return(abs(test) > qnorm(1-alpha/2))
Match trade and quote data
Jiang and Oomen (2008) tests for the presence of jumps in the price series.
Returns the positive semidefinite projection of a symmetric matrix using the eigenvalue method
Plotting method for DBH
objects
Merge multiple quote entries with the same time stamp
Merge multiple transactions with the same time stamp
Intraday jump tests
highfrequency: Tools for Highfrequency Data Analysis
Get trade direction
Plotting method for HEAVYmodel objects
Cleans quote data
Printing method for DBH
objects
Printing method for HARmodel
objects
Realized covariances via subsample averaging
to use when p,k different from range [4,6]
Predict method for objects of type HARmodel
Utility function listing the available estimators for the CholCov estimation
Delete the observations where the bid or ask is zero
Available kernels
Delete the observations where the price is zero
CholCov estimator
DEPRECATED
Realized covariance
Realized beta
Iterative multi-step-ahead forecasting for HEAVY models
DEPRECATED
rBACov
Plot Trade and Quote data
Realized multipower variation
Plotting method for HARmodel objects
DEPRECATED
Realized bipower covariance
DEPRECATED rMRC
An estimator of integrated quarticity from applying the median operator on blocks of three returns
rMedRVar
Modulated realized covariance
DEPRECATED
An estimator of integrated quarticity from applying the minimum operator on blocks of two returns
Realized outlyingness weighted covariance
Realized quad-power variation of intraday returns
Realized kernel estimator
Robust two time scale covariance estimation
Rank jump test
Realized semivariance of highfrequency return series
Realized kurtosis of highfrequency return series.
Realized quarticity
Realized semicovariance
Hayashi-Yoshida covariance
rmTradeOutliersUsingQuotes
Delete transactions with unlikely transaction prices
Threshold Covariance
Sample of cleaned quotes for stock XXX for 2 days measured in microseconds
salesCondition is deprecated. Use tradesCondition instead.
Two time scale covariance estimation
Synchronize (multiple) irregular timeseries by refresh time
DEPRECATED
rMinRVar
Remove outliers in trades without using quote data
Remove outliers in quotes
One minute data
Sample of raw quotes for stock XXX for 2 days measured in microseconds
Realized skewness
Summary for HARmodel
objects
Convert to format for realized measures
Multivariate tick by tick data
Realized tri-power quarticity
An estimator of realized variance.
DEPRECATED
Cleans trade data
Delete entries for which the spread is negative
European data
Sample of cleaned trades for stock XXX for 2 days
Delete entries for which the spread is more than maxi
times the median spread
Perform a final cleaning procedure on trade data
Retain only data from a single stock exchange
Sample of raw trades for stock XXX for 2 days
Delete entries with abnormal trades condition.
Spot Drift Estimation
Spot volatility estimation
Function returns the value, the standard error and the confidence band of the integrated variance (IV) estimator.
Estimators of the integrated variance
HEAVY model estimation
Estimators of the integrated covariance
Internal HEAVY functions
Barndorff-Nielsen and Shephard (2006) tests for the presence of jumps in the price series.
Ait-Sahalia and Jacod (2009) tests for the presence of jumps in the price series.
Heterogeneous autoregressive (HAR) model for realized volatility model estimation