View source: R/betaDistEstimation.R
betaDistEstimation | R Documentation |
This function perform a rough estimation of the shape parameters of beta distribution
betaDistEstimation(
q,
init.pars = c(1, 1),
force.optim = FALSE,
hessian = FALSE,
method = "BFGS",
gr = NULL,
control = list(maxit = 500, abstol = (10^-8)),
lower = -Inf,
upper = Inf,
seed = 123,
...
)
q |
prior probabilities |
init.pars |
initial parameter values. Defaults to alpha = 1 & beta = 1, which imply the parsimony pseudo-counts greater than zero. |
force.optim |
Whether to force the use of |
hessian |
if TRUE, the hessian of f at the minimum is returned. |
method, control, lower, upper, gr |
(Optional). In the case that
|
control |
(Optional). In the case that |
... |
Further parameter for |
In order to obtain the estimates for shape parameters of beta
distribution, the squared of the difference between the empirical cumulative
distribution function (ecdf) & the theoretical cdf is minimized using the
Non-Linear Minimization function nlm
'stats' package.
If nlm
function fails, then an estimation using
optim
function is tried.
A list with components, which would vary depending on whether the
estimation was performed with nlm
or
optim
. In all the cases the list element carrying
the estimated parameters values is named parameters.
Robersy Sanchez <https://genomaths.com>
betaBinPost
and estimateDirichDist
### A random generation numerical values with Beta distribution
x1 <- rbeta(n = 1000, shape1 = 2, shape2 = 3)
### Parameter estimation with "nlm" function
betaDistEstimation(q = x1, gradtol = 1e-12, hessian = TRUE)
### Parameter estimation with "optim" function
betaDistEstimation(q = x1, force.optim = TRUE, hessian = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.