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
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, ...
2 matches
Mail list logo