powered by
An object representing a discrete distribution is created, based on explicitly given possible values and probabilities for these.
discretedistribution(vals, probs = rep(1, length(vals)))
A vector listing the possible values of the discrete distribution.
If given, probs must have the same length as vals, and should list the probabilities of the possible values. If not given, all possible values are assigned equal probabilities.
probs
vals
A discrete probability distribution.
# NOT RUN { dist <- discretedistribution(1:10) expectation(dist) variance(dist) # }
Run the code above in your browser using DataLab