Skip to contents

Usage

dist_beta(shape1 = NULL, shape2 = NULL, ncp = NULL)

Arguments

shape1

First scalar shape parameter, or NULL as a placeholder.

shape2

Second scalar shape parameter, or NULL as a placeholder.

ncp

Scalar non-centrality parameter, or NULL as a placeholder.

Value

A BetaDistribution object.

Details

All parameters can be overridden with with_params = list(shape = ..., scale = ...).

Examples

d_beta <- dist_beta(shape1 = 2, shape2 = 2, ncp = 0)
x <- d_beta$sample(100)
d_emp <- dist_empirical(x)

plot_distributions(
  empirical = d_emp,
  theoretical = d_beta,
  estimated = d_beta,
  with_params = list(
    estimated = inflate_params(
      fitdistrplus::fitdist(x, distr = "beta")$estimate
    )
  ),
  .x = seq(0, 2, length.out = 100)
)
#> Warning: Removed 142 rows containing missing values (`geom_line()`).