IMSLS_N_PARAMETERS, int*n_parameters (Output) The number of parameters in the distribution specified by ipdf.
IMSLS_NUMBER_OF_TRIALS, intn_trials (Input) The number of trials. n_trials is required for the binomial distribution, (ipdf = 2).
Default: Not used, except for ipdf = 2.
IMSLS_NUMBER_OF_FAILURES, intn_failures (Input) The number of failures. n_failures is required for the negative binomial distribution, (ipdf = 3).
Default: Not used, except for ipdf = 3.
IMSLS_MLOGLIKE, float*mloglike (Output) Minus log-likelihood evaluated at the parameter estimates.
IMSLS_STD_ERRORS, float**se (Output) Address of a pointer to an internally allocated array of length n_parameters containing the standard errors of the parameter estimates.
IMSLS_STD_ERRORS_USER, floatse[] (Output) Storage for array se is provided by the user. See IMSLS_STD_ERRORS.
IMSLS_HESSIAN, float**hess (Output) Address of a pointer to an internally allocated array of length n_parameters×n_parameters containing the Hessian matrix.
IMSLS_HESSIAN_USER, floathess[] (Output) Storage for array hess is provided by the user. See IMSLS_HESSIAN.
IMSLS_RETURN_USER, floatparam[] (Output) User-allocated array of length n_parameters containing the estimated parameters.
Note: The following optional arguments are used in cases in which a quasi-Newton method is used to solve the likelihood problem (ipdf = 7,9,10,12,13,15,18,19).
IMSLS_PARAM_LB, floatparamlb[] (Input) Array of length n_parameters containing the lower bounds of the parameters.
Exceptions
paramlb
Extreme value distribution (ipdf = 12)
paramlb[1] = 0.25, for the scale parameter
Generalized Pareto distribution (ipdf = 15)
paramlb[1] = -5.0, for the shape parameter
Generalized extreme value distribution (ipdf = 13)
paramlb[2] = -10.0, for the shape parameter
Default: The default lower bound depends on the range of the parameter. That is, if the range of the parameter is positive for the desired distribution, paramlb[i] = 0.01. If the range of the parameter is non-negative (≥ 0), then paramlb[i] = 0.0. If the range of the parameter is unbounded, then paramlb[i] = -10000.00.
IMSLS_PARAM_UB, floatparamub[] (Input) Array of length n_parameters containing the upper bounds of the parameters.
Exceptions
paramlb
Generalized Pareto distribution (ipdf = 15)
paramub[1] = -5.0, for the shape parameter
Generalized extreme value distribution (ipdf = 13)
paramub[2] = -10.0, for the shape parameter
Default: paramub[i] = 10000.0.
IMSLS_INITIAL_ESTIMATES, floatinitial_estimates[] (Input) Array of length n_parameters containing the initial estimates of the parameters.
Default: Method of moments estimates are used for initial estimates.
IMSLS_XSCALE, floatxscale[] (Input) Array of length n_parameters containing the scaling factors for the parameters. xscale is used in the optimization algorithm in scaling the gradient and the distance between two points.
Default: xscale[i] = 1.0.
IMSLS_MAX_ITERATIONS, intmaxit (Input) Maximum number of iterations.
Default: maxit = 100.
IMSLS_MAX_FCN, intmaxfcn (Input) Maximum number of function evaluations.
Default: maxfcn = 400.
IMSLS_MAX_GRAD, intmaxgrad (Input) Maximum number of gradient evaluations.
Default: maxgrad = 400.
Description
Function imsls_f_max_likelihood_estimates calculates maximum likelihood estimates for the parameters of a univariate probability distribution, where the distribution is one specified by ipdf and where the input data x is (assumed to be) a random sample from that distribution.
Let {xi, i=1, ..., N} represent a random sample from a probability distribution with density function , which depends on a vector containing the values of the parameters of the distribution. The values in θ are fixed but unknown and the problem is to find an estimate for θ given the sample data.
The likelihood function is defined to be the product
The estimator
That is, the estimator that maximizes L also maximizes log L and is the maximum likelihood estimate, or MLE for θ.
The likelihood problem is in general a constrained non-linear optimization problem, where the constraints are determined by the permissible range of θ. In some situations, the problem has a closed form solution. Otherwise, imsls_f_max_likelihood_estimates uses a quasi-Newton method to solve the likelihood problem. If optional argument IMSLS_INITIAL_ESTIMATES is not supplied, method of moments estimates serve as starting values of the parameters. In some cases, method of moments estimators may not exist, such as when certain moments of the true distribution do not exist; thus it is possible that the starting values are not truly method of moments estimates.
Upper and lower bounds, when needed for the optimization, have default values for each selection of ipdf (defaults will vary depending on the allowable range of the parameters). It is possible that the optimization will fail. In such cases, the user may try adjusting upper and lower bounds using the optional arguments IMSLS_PARAM_LB, IMSLS_PARAM_UB, or adjusting up or down the scaling factors using optional argument IMSLS_XSCALE, which can sometimes help the optimization converge.
Standard errors and covariances are supplied, in most cases, using the asymptotic properties of MLestimators. Under some general regularity conditions, MLestimates are consistent and asymptotically normally distributed with variance-covariance equal to the inverse Fisher’s Informationmatrix evaluated at the true value of the parameter, θ0:
imsls_f_max_likelihood_estimates approximates the asymptotic variance using the negative inverse Hessian evaluated at the MLestimate:
The Hessian is approximated numerically for all but a few cases where it can be determined in closed form.
In cases when the asymptotic result does not hold, standard errors may be available from the known sampling distribution. For example, the MLestimate of the Pareto distribution location parameter is the minimum of the sample. The variance is estimated using the known sampling distribution of the minimum or first order-statistic for the Pareto distribution.
For further details regarding the properties of the estimators and the theory of the maximum likelihood method, see Kendall and Stuart (1979). The different probability distributions have wide coverage in the statistical literature. See Johnson and Kotz (1970a, 1970b, or later editions).
Parameter estimation (including maximum likelihoood) for the generalized Pareto distribution is studied in Hosking and Wallis (1987) and Giles and Feng (2009), and estimation for the generalized extreme value distribution is treated in Hosking, Wallis, and Wood (1985).
Remarks
1. The location parameter is not estimated for the generalized Pareto distribution (ipdf=15). Instead, the minimum of the sample is subtracted from each observation before the estimation procedure.
2. Only the probability of success parameter is estimated for the binomial and negative binomial distributions, (ipdf = 2,3). The number of trials and the number of failures, respectively, must be provided using optional arguments IMSLS_NUMBER_OF_TRIALS or IMSLS_NUMBER_OF_FAILURES.
3. imsls_f_max_likelihood_estimates issues an error if missing or NaN values are encountered in the input data. Missing or NaN values should be removed before calling imsls_f_max_likelihood_estimates.
Examples
Example 1
The data are N= 100 observations generated from the logistic distribution with location parameter and parameter .
Maximum likelihood estimation for the logistic distribution
Starting Estimates: 0.90677 0.51128
Initial -log-likelihood: 132.75304
-log-likelihood 132.61490
MLE for parameter 1 0.95321
MLE for parameter 2 0.50953
Std error for parameter 1 0.08825
Std error for parameter 2 0.04354
Hessian
1 2
1 -128.5 -7.6
2 -7.6 -527.9
Example 2
The data are N = 100 observations generated from the generalized extreme value distribution with location parameter , scale parameter , and shape parameter .