quantile of a discrete random variabel --- again

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

quantile of a discrete random variabel --- again

L... L...
I thank all for your reply. My question was not well formulated.
I will do it again:
Suppose that the random variable X is discrete with probability mass function (pmf) F (binomial, poisson, ....) not necessarily available in R.
Is there a general method to get the quantiles (as qbinom, qpois, .....) or which is the method(s) used to get the quantiles (used in qbinom, qpois, .....)?
Regards
ML    
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: quantile of a discrete random variabel --- again

Bert Gunter-2
Well, presumably you have the pmf and can create a matrix of the form:
(where mypmf is your pmf)

x <- seq_len(1000) ## or whatever your discrete support sorted in
increasing order

## for individual quantile q:

max(x[cumsum(mypmf(x)) <= q] )

## This probably could be vectorized for a vector of quantiles . I
leave that to others both cleverer and more motivated than I.

Cheers,
Bert
Bert Gunter

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
   -- Clifford Stoll


On Thu, Jun 25, 2015 at 8:59 AM, L... L... <[hidden email]> wrote:

> I thank all for your reply. My question was not well formulated.
> I will do it again:
> Suppose that the random variable X is discrete with probability mass function (pmf) F (binomial, poisson, ....) not necessarily available in R.
> Is there a general method to get the quantiles (as qbinom, qpois, .....) or which is the method(s) used to get the quantiles (used in qbinom, qpois, .....)?
> Regards
> ML
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.