[R-SIG-Finance] varRisk in fPortfolio package
Cedrick W. Johnson
cedrick at cedrickjohnson.com
Tue Nov 17 07:43:36 CET 2009
> 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*
More information about the R-SIG-Finance
mailing list