Description Usage Arguments Details Value Note Author(s) References See Also Examples
Computes univariate (moving average, weighted average, Risk Metrics) and multivariate (Risk Metrics) volatility models.
1 2 3 4 |
returns |
A univariate (multivariate) return series in the case of univariate (multivariate) volatility models. |
width |
How many past observations should be use to calculate the predicted volatility for the next day? Default is 30. |
lambda |
Weight of previous day's volatility. Ignored for models of type "MovingAverage". The value must be between 0 and 1. If a negative value is supplied to the function, lambda is estimated from the data. |
type |
Specifies the type of volatility model. |
center |
Should returns be centered before computing the volatility? Included for comparability reasons in |
exchange |
Stock exchange at which the asset is traded. Default is NYSE. See the details of |
UnivVola
computes univariate volatility models. Currently simple moving average models as well as both types of exponentially weighted moving average models are implemented. MultiEWMA
computes the multivariate exponentially weighted moving average model in RiskMetrics form. The default value of lambda
is 0.94, as suggested for daily data by RiskMetrics (J.P.Morgan/Reuters, 1996). However, when a negative value for lambda is supplied, an optimal lambda will be estimated from the data, assuming a multivariate standard normal distribution and using a conditional maximum likelihood approach (see Ruppert and Matteson (2015) for further details).
Variance |
|
Returns |
|
variant |
Character string indicating the type of volatility model used. |
width |
Numeric value indicating the number of past observations that have been used to calculate the predicted volatility. |
lambda |
Value of the lambda parameter used. Only available for univariate and multivariate models of type "RiskMetrics" or "WeightedAverage". |
lambda.se |
Standard error of lambda, if estimated. |
llh |
Value of the log-likelihood, if lambda is estimated. |
centered |
Whether the return series has been centered within the function or not. |
Note that the models as implemented here implicitly assume that the time series of returns have a conditional expectation of zero, following the usual risk management conventions. Where this is not the case in practical applications, you may estimate a model for the conditional expected value before using the functions herein and use the residuals of that model instead of the original returns as inputs.
Bernhard Eder
Danielsson (2011). Financial Risk Forecasting. Wiley. Chichester.
J.P.Morgan/Reuters (1996). RiskMetrics - Technical Document. 4th. New York.
Jorion (2007). Value at Risk, 3rd. McGraw-Hill. New York.
Ruppert and Matteson (2015). Statistics and Data Analysis for Financial Engineering, 2ed. Springer. New York.
residuals
, mse
, varcov
, vola
, NextBusinessDay
.
1 2 3 4 5 6 7 8 9 10 11 12 | # Load returns
data("CRSPday_zoo")
y <- CRSPday_zoo
# Compute univariate volatility models
ma <- UnivVola(y[, 1], type = "MovingAverage", center = TRUE)
wa <- UnivVola(y[, 1], type = "WeightedAverage", center = TRUE)
# Access variances and compare returns
head(ma$Variances)
head(ma$Returns)
head(y[, 1])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.