PerformanceAnalytics icon indicating copy to clipboard operation
PerformanceAnalytics copied to clipboard

Bug in lpm()

Open chenx26 opened this issue 9 years ago • 2 comments

Running the following code should reproduce an error

library(PerformanceAnalytics) data(edhec) lpm(edhec)

Error in [.xts(R, R < threshold, ) : 'i' or 'j' out of range

chenx26 avatar Aug 27 '16 21:08 chenx26

not actually a bug:

lpm(edhec[,1]) [1] 0.0004371911

this function only takes a single-column xts object.

We would certainly entertain a patch to handle multiple columns in the manner than many (most) other PerformanceAnalytics function do.

braverock avatar Aug 28 '16 00:08 braverock

For your case: apply(edhec,2,lpm) will work.

I was not able to implement lpm in a multivariate framework due to the conditional nature of the calculation, the lengths of data for each column will not be the same. Patches would be most welcome

kylebalkissoon avatar Nov 23 '16 23:11 kylebalkissoon