Re: [R] quantile of a discrete random variabel --- again

2015-06-25 Thread Bert Gunter
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 q

[R] quantile of a discrete random variabel --- again

2015-06-25 Thread 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, ...