dist <- dist_categorical(prob = list(c(0.05, 0.5, 0.15, 0.2, 0.1), c(0.3, 0.1, 0.6)))
dist
generate(dist, 10)
density(dist, 2)
density(dist, 2, log = TRUE)
# The outcomes aren't ordered, so many statistics are not applicable.
cdf(dist, 4)
quantile(dist, 0.7)
mean(dist)
variance(dist)
skewness(dist)
kurtosis(dist)
dist <- dist_categorical(
prob = list(c(0.05, 0.5, 0.15, 0.2, 0.1), c(0.3, 0.1, 0.6)),
outcomes = list(letters[1:5], letters[24:26])
)
generate(dist, 10)
density(dist, "a")
density(dist, "z", log = TRUE)
Run the code above in your browser using DataLab