betafunctions (version 1.4.0)

LABMSU: Lower Location Parameter Given Shape Parameters, Mean, Variance, and Upper Location Parameter of a Four-Parameter Beta PDD.

Description

Calculates the lower-bound value required to produce a Beta probability density distribution with defined moments and parameters. Be advised that not all combinations of moments and parameters can be satisfied (e.g., specifying mean, variance, skewness and kurtosis uniquely determines both location-parameters, meaning that the value of the lower-location parameter will take on which ever value it must, and cannot be specified).

Usage

LABMSU(
  alpha = NULL,
  beta = NULL,
  u = NULL,
  mean = NULL,
  variance = NULL,
  skewness = NULL,
  kurtosis = NULL,
  sd = NULL
)

Arguments

alpha

The Alpha shape-parameter of the target Beta probability density distribution.

beta

The Beta shape-parameter of the target Beta probability density distribution.

u

The upper-bound of the Beta distribution. Default is NULL (i.e., does not take a specified u-parameter into account).

mean

The mean (first raw moment) of the target Standard Beta probability density distribution.

variance

The variance (second central moment) of the target Standard Beta probability density distribution.

skewness

The skewness (third standardized moment) of the target Beta probability density distribution.

kurtosis

The kurtosis (fourth standardized moment) of the target Beta probability density distribution.

sd

Optional alternative to specifying var. The standard deviation of the target Standard Beta probability density distribution.

Value

A numeric value representing the required value for the Beta shape-parameter in order to produce a Standard Beta probability density distribution with the target mean and variance, given specified lower- and upper bounds of the Beta distribution.

Examples

Run this code
# NOT RUN {
# Generate some fictional data.
set.seed(1234)
testdata <- rBeta.4P(100000, .25, .75, 5, 3)
hist(testdata, xlim = c(0, 1), freq = FALSE)

# Suppose you know three of the four necessary parameters to fit a four-
# parameter Beta distribution (i. e., u = 0.75, alpha = 5, beta = 3) to this
# data. To find the value for the necessary l parameter, estimate the mean
# and variance of the distribution:
M <- mean(testdata)
S2 <- var(testdata)

# To find the l parameter necessary to produce a four-parameter Beta
# distribution with the target mean, variance, and u, alpha, and beta
# parameters using the LMSBAU() function:
(l <- LABMSU(alpha = 5, beta = 3, mean = M, variance = S2, u = 0.75))
curve(dBeta.4P(x, l, .75, 5, 3), add = TRUE, lwd = 2)
# }

Run the code above in your browser using DataCamp Workspace