[R-SIG-Finance] troubles with the weights in the VaR function
manu
junkmanu at free.fr
Sat Dec 9 11:26:49 CET 2006
hi there
i have some troubles with VaR ( value at risk function)
to be more specific, with the weights in the VaR function
when i run the example:
equalWeights = rep(1/4, 4)
alpha = 0.10
# Value at Risk:
VaR(myAssets, equalWeights, alpha)
everything is ok
BUT
when i read my own data set, and try to have my own weights, i have the following message :
Erreur dans `names<-.default`(`*tmp*`, value = "VaR") :
attribut 'names' [1] doit être de même longueur que le vecteur [0]
which can be translated as:
error in `names<-.default`(`*tmp*`, value = "VaR") :
attribute 'names' [1] must have the same length as vector [0]
i have no idea of what it means
:-(
i printed the names of my data, and it was exactely the same as the names in the VaR example
when returning this message, R returns at the same time the computation of the VaR, but using the default (equal weights); in my case it is not possible to have different weights :-(
did anyone face the same problem?
if yes, how to solve it
thx in advance
regards
manu
More information about the R-SIG-Finance
mailing list