I am trying to calculate CoVariance on data frame:
cov_test <- CoVariance(returns, returns)
returns looks ~like that:
A B C
28/02/1999 -0.018816 -0.011451 -0.026870
31/03/1999 0.004001 0.006580 0.002293
Error I get:
Error in merge.zoo(e1, e2, all = FALSE, retclass = NULL) : series cannot be merged with non-unique index entries in a series In addition: Warning messages: 1: In zoo(cd, order.by = index(x), ...) : some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique 2: In zoo(rval, index(x)[i]) : some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique 3: In zoo(rval, index(x)[i]) : some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique 4: In zoo(cd, order.by = index(x), ...) : some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique 5: In zoo(rval, index(x)[i]) : some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique 6: In zoo(rval, index(x)[i]) : some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique
However, when I use simple cov function in R, it works just fine...
Could anyone advise what could be the issue? I checked for duplicated rows with anyDuplicated(returns) and it returned 0. Also, broadly speaking, what is the main difference between CoVariance function from PerformanceAnalytics and simple cov function? Thank you.