ewmaVol: Exponentially weighted moving average (EWMA) volatility...

Description Usage Arguments Details Value Author(s) Examples

Description

Compute RiskMetrics type EWMA volatility estimator for a vector of returns.

Usage

1
2
ewmaVol(r, lambda = NULL, half.life = NULL, overlap = 1,
  demean = c("none", "sample", "ewma"))

Arguments

r

any univariate data object that can be coerced to an xts object

lambda

Scalar exponential decay parameter. Must be between 0 and 1. If lambda is NULL then half.life must be specified and the value of lambda is computed from the value of half.life using lambda = exp(log(0.5)/half.life).

half.life

Scalar half-life defined as time lag at which the exponential weights decay by one half. If lambda is not NULL then half.life is ignored and is computed internally from the given value of lambda using log(0.5)/log(lambda).

overlap

Integer value giving the aggregation period for overlapping returns. For example, if r represents daily returns and overlap=5 then r is converted to a daily time series of 5-day overlapping returns. Default value is 1.

demean

Character string indicating the method used to de-mean the returns. Valid choices are "none" for no de-meaning; "sample" for the sample mean; and "ewma" for an EWMA estimate of the mean. For daily or weekly returns the mean is typically assumed to be zero. For longer horizon returns, the mean is typically not zero. Default value is "none".

initiated with the sample variance for returns.

Details

The EWMA variance estimator satisfies the recursion s(t)^2 = lambda*r(t-1)^2 + (1-lambda)*s(t-1)^2 where r(t) is the (continuously compounded) return and lambda is the exponential decay parameter. The recursion is typically

Value

An object of class "ewmaVol" for which there are print, plot, and predict methods, and extractor functions fitted and residuals.

An object of class ewmaVol is a list with the following components:

Author(s)

Eric Zivot

Examples

1
2
3
4
## Not run: 
ewmavol(r)

## End(Not run)

MFTSR documentation built on May 2, 2019, 5:26 p.m.

Related to ewmaVol in MFTSR...