R/estimateBetaDist.R
estimateBetaDist.Rd
This function perform a nonlinear estimation of the shape parameters of beta distribution
estimateBetaDist(
q,
init.pars = NULL,
via.optim = TRUE,
loss.fun = c("linear", "huber", "smooth", "cauchy", "arctg"),
maxiter = 1024,
maxfev = 1e+05,
ftol = 1e-12,
ptol = 1e-12
)
prior probabilities
initial parameter values. Defaults is NULL and an initial guess is estimated using the method of moments, which probably is the best approach to estimate the initial parameter values of beta distribution.
Logical. Whether to estimate beta distribution parameters
via optim
or nls.lm
. If any of
this approaches fail then parameters used init.pars will be returned.
Loss function(s) used in the regression (see (Loss function)). This fitting uses the approach followed in in the R package usefr. After \(z = 1/2 * sum((f(x) - y)^2)\) we have:
"linear": linear function which gives a standard least squares: \(loss(z) = z\).
"huber": Huber loss, \(loss(z) = ifelse(z \leq 1, z, sqrt(z) -1)\).
"smooth": Smooth approximation to the sum of residues absolute values: \(loss(z) = 2*(sqrt(z + 1) - 1)\).
"cauchy": Cauchy loss: \(loss(z) = log(z + 1)\).
"arctg": arc-tangent loss function: \(loss(x) = atan(z)\).
the estimated values of the shape parameters of the selected beta distribution.
To obtain the estimates for shape parameters from the best fitted
beta distribution model, a nonlinear regression Levenberg-Marquardt algorithm
implemented in function nls.lm
is applied. Several
(loss functions)) are
available to accomplish the model fitting to the data. If
nls.lm
function fails, then a new try will be
accomplish with nlsLM
function. If the previous
algorithms fail, then the parameters will be estimated using BFGS" algorithm
implemented in optim
function.