For long vectors the hdi.vector method is slow, because it sorts the values. Ways to speed up or avoid sorting would be good.
The matrixStats package has a fast function to get ranks, and it might be possible to use that, maybe just extracting and ordering the lowest and highest 5% of values (for a 95% HDI).
For long vectors the hdi.vector method is slow, because it sorts the values. Ways to speed up or avoid sorting would be good.
The matrixStats package has a fast function to get ranks, and it might be possible to use that, maybe just extracting and ordering the lowest and highest 5% of values (for a 95% HDI).