[R-SIG-Finance] [Fwd: Re: problem with fPortfolio]
Brian G. Peterson
brian at braverock.com
Fri Jul 20 21:03:36 CEST 2007
Please address responses to the list
-------- Original Message --------
From: Julio Ferreira <julio.ferreira at reliance.com.br>
To: Brian G. Peterson <brian at braverock.com>
Brian,
Yes, I did after I sent the message calling for help. Actually I found
out that "isPositiveDefinite" is part of fEcofin, which apparently
should have been downloaded (I used "dependencies=TRUE", when downloaded
fPortfolio). I tried to download fEcofin from another mirror and it
solved the problem. Maybe the first downloaded was (somehow)
"corrupted"????Is it possible ?? the checks seemed to be ok....
Now i´m getting another strange problem: when calling
>assetsMeanCov(berndtAssets.ts,method="mcd")
I´m getting error message:
Erro em names(mu) = colnames(x) : tentativa de especificar um atributo
em um NULL
translation: "attempted to specify an attribute to a NULL"
The problem is that I am just reproducing what was on the fPortfolio
documentation. Any guess what was going on?
I thank you for your reply, and apologize for "abusing" from you
"goodwill", but I am learning R by myself, so don´t have no one else to
ask for help...
-------- End Original Message --------
Julio,
Try with a different data set, or check to make sure that there are no
NA's in the data you're using to test the functions. Rmetrics is a set
of functions and data which have accumulated over several years, and
fEcofin is a relative newcomer to the package set. In some cases, this
means that examples in documentation, which are not automatically
checked on package build, may no longer work properly.
In the specific case you cite above, it looks like your input data may
not have had named columns.
I'm not sure that's the case though, because when I try with a different
data set which I know is named and symetric in length of all columns, I
get a similar error to the one you describe:
> data(edhec)
> assetsMeanCov(edhec,method="mcd")
Error in `names<-.default`(`*tmp*`, value = c("Convertible.Arbitrage",
: attempt to set an attribute on NULL
When I try with a different data set with timeseries of differing
lengths, I get a different error:
> data(managers)
> assetsMeanCov(managers,method="mcd")
Error in MASS::cov.rob(x, method = "mcd") :
missing or infinite values are not allowed
When I try with a different method parameter, I get the error you
reported initially.
> assetsMeanCov(edhec,method="cov")
Error in assetsMeanCov(edhec, method = "cov") :
could not find function "isPositiveDefinite"
So, I'm suspecting that there may be a bug in the naming section (or
elsewhere) in the assetsMeanCov function.
Perhaps you should try the more primitive functions mean() and cov()
before working with wrapper functions.
Regards,
- Brian
More information about the R-SIG-Finance
mailing list