View source: R/betafunctions.R
LABMSU | R Documentation |
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).
LABMSU(
alpha = NULL,
beta = NULL,
u = NULL,
mean = NULL,
variance = NULL,
sd = NULL
)
alpha |
The alpha (first) shape-parameter of the target Beta probability density distribution. |
beta |
The beta (second) 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. |
sd |
Optional alternative to specifying |
A numeric value representing the required value for the Beta lower location-parameter (l
) in order to produce a Beta probability density distribution with the target moments and parameters.
# Generate some fictional data.
set.seed(1234)
testdata <- rBeta.4P(100000, 0.25, 0.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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.