View source: R/realizedMeasures.R
rRVar | R Documentation |
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}
rRVar(rData, alignBy = NULL, alignPeriod = NULL, makeReturns = FALSE, ...)
rData |
an |
alignBy |
character, indicating the time scale in which |
alignPeriod |
positive numeric, indicating the number of periods to aggregate over. For example, to aggregate
based on a 5-minute frequency, set |
makeReturns |
boolean, should be |
... |
used internally, do not change. |
In case the input is an xts
object with data from one day, a numeric of the same length as the number of assets.
If the input data spans multiple days and is in xts
format, an xts
will be returned.
If the input data is a data.table
object, the function returns a data.table
with the same column names as the input data, containing the date and the realized measures.
IVar
for a list of implemented estimators of the integrated variance.
rv <- rRVar(sampleOneMinuteData, makeReturns = TRUE)
plot(rv[, DT], rv[, MARKET], xlab = "Date", ylab = "Realized Variance", type = "l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.