rRVar {highfrequency}R Documentation

An estimator of realized variance.

Description

Calculates the daily Realized Variance. Let r_{t,i} be an intraday return vector with i=1,...,M number of intraday returns.

Then, the realized variance is given by

\mbox{RVar}_{t}=\sum_{i=1}^{M}r_{t,i}^{2}

Usage

rRVar(rData, alignBy = NULL, alignPeriod = NULL, makeReturns = FALSE, ...)

Arguments

rData

an xts or data.table object containing returns or prices, possibly for multiple assets over multiple days.

alignBy

character, indicating the time scale in which alignPeriod is expressed. Possible values are: "ticks", "secs", "seconds", "mins", "minutes", "hours"

alignPeriod

positive numeric, indicating the number of periods to aggregate over. For example, to aggregate based on a 5-minute frequency, set alignPeriod = 5 and alignBy = "minutes".

makeReturns

boolean, should be TRUE when rData contains prices instead of returns. FALSE by default.

...

used internally, do not change.

Value

See Also

IVar for a list of implemented estimators of the integrated variance.

Examples

rv <- rRVar(sampleOneMinuteData, makeReturns = TRUE)
plot(rv[, DT], rv[, MARKET], xlab = "Date", ylab = "Realized Variance", type = "l")

[Package highfrequency version 1.0.1 Index]