Skip to content

varRisk in fPortfolio package

3 messages · Wei-han Liu, Cedrick Johnson, Brian G. Peterson

#
function (data, weights, alpha = 0.05)
{
    if (inherits(data, "timeSeries"))
        data <- getDataPart(data)
    weights = as.vector(weights)
    X = as.matrix(data) %*% weights
    VaR = quantile(X, alpha, type = 1)
    names(VaR) <- paste("VaR.", alpha * 100, "%", sep = "")
    VaR
}
<environment: namespace:fPortfolio>

from ?varRisk


      References

Wuertz, D., Chalabi, Y., Chen W., Ellis A. (2009); /Portfolio 
Optimization with R/Rmetrics/, Rmetrics eBook, Rmetrics Association and 
Finance Online, Zurich


-cedrick
Wei-han Liu wrote:

  
    
#
Wei-han Liu wrote:
All functions in R may be examined by simply typing the function name 
without parentesis or parameters, like so:

varRisk

?varRisk # should give you the documentation

Also, see package 'VaR'  for log-normal and general Pareto VaR 
calculated via Monte Carlo, and package PerformanceAnalytics for 
univariate, marginal, and portfolio component VaR and ES/CVaR calculated 
for historical, Gaussian, Cornish-Fisher, and kernel estimators, as well 
as charts showing rolling measures and sensitivity analysis.

Regards,

    - Brian