dist_beta(shape1, shape2)
The non-negative shape parameters of the Beta distribution.
dist <- dist_beta(shape1 = c(0.5, 5, 1, 2, 2), shape2 = c(0.5, 1, 3, 2, 5))
dist
#> <distribution[5]>
#> [1] Beta(0.5, 0.5) Beta(5, 1) Beta(1, 3) Beta(2, 2) Beta(2, 5)
mean(dist)
#> [1] 0.5000000 0.8333333 0.2500000 0.5000000 0.2857143
variance(dist)
#> [1] 0.12500000 0.01984127 0.03750000 0.05000000 0.02551020
skewness(dist)
#> [1] 0.000000 -5.916080 2.581989 0.000000 5.962848
kurtosis(dist)
#> [1] -1.5000000 1.2000000 0.0952381 -0.8571429 -0.1200000
generate(dist, 10)
#> [[1]]
#> [1] 3.753879e-01 4.999051e-05 9.175055e-01 4.551090e-03 1.568926e-01
#> [6] 7.685608e-01 9.971841e-01 5.299420e-01 9.577611e-01 1.899909e-01
#>
#> [[2]]
#> [1] 0.8856235 0.4318070 0.7066478 0.5530519 0.9573196 0.8187031 0.4951331
#> [8] 0.9468135 0.5487410 0.8845661
#>
#> [[3]]
#> [1] 0.38339996 0.28147341 0.47226474 0.08416804 0.11597925 0.24043312
#> [7] 0.10730206 0.02240566 0.05798921 0.45820212
#>
#> [[4]]
#> [1] 0.7700609 0.2232235 0.9344369 0.4773273 0.2764718 0.4985823 0.6435752
#> [8] 0.1452469 0.2894101 0.6647500
#>
#> [[5]]
#> [1] 0.06340026 0.48481712 0.11965338 0.08153736 0.51951197 0.31826456
#> [7] 0.03859632 0.22553350 0.09396363 0.23394584
#>
density(dist, 2)
#> [1] 0 0 0 0 0
density(dist, 2, log = TRUE)
#> [1] -Inf -Inf -Inf -Inf -Inf
cdf(dist, 4)
#> [1] 1 1 1 1 1
quantile(dist, 0.7)
#> [1] 0.7938926 0.9311499 0.3305670 0.6367425 0.3603577