An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20091116/168dc184/attachment.pl>
varRisk in fPortfolio package
3 messages · Wei-han Liu, Cedrick Johnson, Brian G. Peterson
varRisk
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:
Hi R Users:
I am curious about the computational algorithm of the function listed below in fPortfolio package. Or there is some relevant literature to develop this function?
varRisk(data,weights,alpha=0.05)
Thanks.
Wei-han
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. -- If you want to post, subscribe first.
============================= *Cedrick W. Johnson* **note new updated phone #'s office) 203.340.3442 cell) 646.434.8052 aolim) cedrickjcvgr www.cedrickjohnson.com *New York - Chicago*
Wei-han Liu wrote:
Hi R Users: I am curious about the computational algorithm of the function listed below in fPortfolio package. Or there is some relevant literature to develop this function? varRisk(data,weights,alpha=0.05)
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
Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock