0

I am using boost::accumulators::tag::extended_p_square_quantile for calculating percentile. In this, I also need to feed probabilities to the accumulator so I did this m_acc = AccumulatorType(boost::accumulators::extended_p_square_probabilities = probs); where probs is a vector containing the probabilities.

Values in the prob vector are {0.5,0.3,0.9,0.7}

I provided some sample values to accumulator.

But when I try to get the percentile using boost::accumulators::quantile(m_acc, boost::accumulators::quantile_probability = probs[0]); it returns incorrect values and even nan sometimes.

What is wrong here?

1 Answer 1

0

I ran into this problem and wasted lot of time to figured out the problem and therefore want to answer this.

Problem is with the vector. Vector should be shorted in increasing order of its values.

Change the vector values to this {0.3,0.5,0.7,0.9} and it will work as expected.

So if someone is using tag::extended_p_square_quantile for percentile(which supports multiple probabilities) then (s)he needs to give probabilities(vector/array/list) in sorted order.

This isn't the case with tag::p_square_quantile because we can give only one value(probability) in it.

1
  • 1
    Can you please share your code? I am facing a similar issue. Commented Jun 15, 2017 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.