Learn R Programming

distributional (version 0.6.0)

has_symmetry: Check if a distribution is symmetric

Description

[Experimental]

Determines whether a probability distribution is symmetric around its center.

Usage

has_symmetry(x, ...)

Value

A logical value indicating whether the distribution is symmetric.

Arguments

x

The distribution(s).

...

Additional arguments used by methods.

Examples

Run this code
# Normal distribution is symmetric
has_symmetry(dist_normal(mu = 0, sigma = 1))
has_symmetry(dist_normal(mu = 5, sigma = 2))

# Beta distribution symmetry depends on parameters
has_symmetry(dist_beta(shape1 = 2, shape2 = 2))  # symmetric
has_symmetry(dist_beta(shape1 = 2, shape2 = 5))  # not symmetric

Run the code above in your browser using DataLab