Optimization for a generalized logistic distribution
genlog_mle.Rd
Maximum likehood estimation of parameters for a generalized logistic distribution.
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
.
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.
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.
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)
#> $par
#> [1] 1.484366194 2.089755702 1.986711890 0.003616087
#>
#> $value
#> [1] 8133.552
#>
#> $counts
#> function gradient
#> 60 13
#>
#> $convergence
#> [1] 0
#>
#> $message
#> NULL
#>
#> $outer.iterations
#> [1] 2
#>
#> $barrier.value
#> [1] 0.0002070442
#>
## Select parameters starting values with genlog_slider
# \donttest{
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)
#> $par
#> [1] 1.4492678976 2.0815986172 1.9026278731 0.0004114579
#>
#> $value
#> [1] 8185.873
#>
#> $counts
#> function gradient
#> 37 8
#>
#> $convergence
#> [1] 0
#>
#> $message
#> NULL
#>
#> $outer.iterations
#> [1] 2
#>
#> $barrier.value
#> [1] 0.0002145797
#>
# }