Description Usage Arguments Details Value See Also
This generic function computes VaR and creates an S3 class object that contains data and VaR results.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | VaR(data, ...)
## S3 method for class 'portfolioData'
VaR(data, TimeLen = 5, conf.level = 0.99,
method = c("parametric", "historical", "Monte-Carlo"), lookback.years = 5,
iteration = 10000, ...)
## S3 method for class 'optionsData'
VaR(data, TimeLen = 5, conf.level = 0.99,
method = c("parametric", "historical", "Monte-Carlo"), V0 = 10000,
lookback.years = 5, iteration = 10000, ...)
## S3 method for class 'stocksData'
VaR(data, TimeLen = 5, conf.level = 0.99,
method = c("parametric", "historical", "Monte-Carlo"), V0 = 10000,
lookback.years = 5, iteration = 10000, ...)
|
data |
an object that contains structured data of stocks, options, or a portfolio. |
... |
arguments to be passed to or from methods. |
TimeLen |
the time horizon in days that the VaR is defined over. |
conf.level |
the confidence level of VaR |
method |
the method used to calculate VaR. Must be one of |
lookback.years |
the time horizon in years that historical simulation is based on. |
iteration |
the number of iteration Monte-Carlo simulation to be performed. |
V0 |
the total value which VaR is measured upon. |
This function is able to compute portfolio VaR for portfolio data, and is also able to compute VaR for each individual stocks and/or options given stocks or options data.
In parametric method and Monte-Carlo method, the portfolio components should be firstly calibrated to a GBM model. In parametric method, the portfolio is assumed normally distributed and the options are linearly approximated by underlying stocks. In historical and Monte-Carlo method, the option values are fully evaluated.
See model documentation for details about VaR calculation methods.
An object of class "VaR"
.
backtest
to perform VaR backtesting.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.