genlog_mle: Optimization for a generalized logistic distribution

View source: R/optim_genlogis.R

genlog_mleR Documentation

Optimization for a generalized logistic distribution

Description

Maximum likehood estimation of parameters for a generalized logistic distribution.

Usage

genlog_mle(parameters, data, hessian = F, alpha = 0.05)

Arguments

parameters

Initial values for the parameters to be optimized over in the following order c(a, b, p, mu), mu can be omitted and will be set to 0.

data

This is the the data to be utilized for the estimation.

hessian

logical value that returns hessian, also returns the parameters estimation's confidence interval.

alpha

Type I error given to calculate confidence intervals, used when hessian = T.

Details

Maximum likehood estimation of parameters for the distribution proposed in this package.
This function is an application of constrOptim as a particular case needed for this distribution using the method "BFGS".
For more information of the output check help(constrOptim).

The used distribution for this package is given by:

f(x) = ((a + b*(1+p)*(abs(x-mu)^p))*exp(-(x-mu)*(a+b*(|x-mu|^p)))) / ((exp(-(x-mu)*(a + b* (|x-mu|^p)))+1)^2)

help(dgenlog) for parameters restrictions.

Value

Return a list of components as constrOptim \(for more information, check this function\) with some extras:

par The best set of parameters found.

value The value of the loglikelihood function corresponding to par.

counts A two-element integer vector giving the number of calls to the likelihood function and BFGS respectively. This excludes those calls needed to compute the Hessian, and any calls to likelihood function to compute a finite-difference approximation to the gradient.

convergence An integer code. 0 indicates successful completion, 1 indicates that the iteration limit maxit had been reached. For more errors help(constrOptim).

message A character string giving any additional information returned by the optimizer, or NULL.

outer.iterations gives the number of outer iterations (calls to optim).

barrier.value giving the value of the barrier function at the optimum.

For hessian = T add:

hessian A symmetric matrix giving an estimate of the (negative) Hessian at the solution found. Note that this is the Hessian of the unconstrained problem even if the box constraints are active.

bounds Return the best parameters found and the upper and lower bounds for the estimation.

References

Rathie, P. N. and Swamee, P. K. (2006) On a new invertible generalized logistic distribution approximation to normal distribution, Technical Research Report in Statistics, 07/2006, Dept. of Statistics, Univ. of Brasilia, Brasilia, Brazil.

Byrd, R. H., Lu, P., Nocedal, J. and Zhu, C. (1995) A limited memory algorithm for bound constrained optimization. SIAM J. Scientific Computing, 16, 1190-1208.

Examples


## Using generic parameter starting values
datas <- rgenlog(10000, 1.5,2,2, 0)
genlog_mle(c(.5,1.6, 1.5, 0),datas)

## Select parameters starting values with genlog_slider

datas <- rgenlog(10000, 1.5,2,2, 0)

if (manipulate::isAvailable()) {
  genlog_slider(datas, return_var = 'parameters') ## choose parameters
} else {
  parameters <- c(1.345, 2, 2, -0.00510)
}

genlog_mle(parameters,datas)



pinduzera/genlogis documentation built on Feb. 12, 2024, 3:30 a.m.