-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbeta_function.R
More file actions
executable file
·22 lines (20 loc) · 851 Bytes
/
beta_function.R
File metadata and controls
executable file
·22 lines (20 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# beta_function.R - Bill White - 2/1/19
#
# Pearson type I distribution (a generalization of the beta distribution)
# arises when the roots of the quadratic equation are of opposite sign,
# that is, a_{1}<0<a_{2}.
#
# the beta distribution is a family of continuous probability distributions
# defined on the interval [0, 1] parametrized by two positive shape parameters,
# denoted by α and β, that appear as exponents of the random variable and
# control the shape of the distribution.
source("gamma_function.R")
# ----------------------------------------------------------------------------
# https://www.wikiwand.com/en/Beta_function
amstat_beta <- function(a, b) {
(amstat_gamma(a) * amstat_gamma(b)) / amstat_gamma(a + b)
}
amstat_beta_pdf <- function(x, a, b) {
abd <- amstat_beta(a, b)
(x^(a - 1) * (1 - x) ^ (b - 1)) / abd
}