Learn R Programming

algebraic.dist (version 0.9.1)

beta_dist: Construct a beta distribution object.

Description

Creates an S3 object representing a beta distribution with shape parameters shape1 and shape2. The PDF on \((0, 1)\) is $$f(x) = \frac{x^{a-1}(1-x)^{b-1}}{B(a,b)}$$ where \(a\) = shape1, \(b\) = shape2, and \(B(a,b)\) is the beta function.

Usage

beta_dist(shape1, shape2)

Value

A beta_dist object with classes c("beta_dist", "univariate_dist", "continuous_dist", "dist").

Arguments

shape1

First shape parameter, must be a positive scalar.

shape2

Second shape parameter, must be a positive scalar.

Examples

Run this code
x <- beta_dist(shape1 = 2, shape2 = 5)
mean(x)
vcov(x)
format(x)

Run the code above in your browser using DataLab