public class MaximumLikelihoodEstimation extends Object implements Serializable, Cloneable
Constructor and Description |
---|
MaximumLikelihoodEstimation(double[] x,
ProbabilityDistribution pd,
double[] guess)
Constructor for maximum likelihood estimation
|
Modifier and Type | Method and Description |
---|---|
void |
compute()
Computes the maximum likelihood estimates.
|
double[] |
getEstimates()
Returns the parameter estimates.
|
double[][] |
getHessian()
Returns the Hessian of the log-likelihood function evaluated at the
current parameter estimates.
|
double |
getLogLikelihood(double[] x,
double[] params)
Returns the log-likelihood.
|
double |
getMinusLogLikelihood()
Returns minus the log-likelihood evaluated at the parameter estimates.
|
double[] |
getStandardErrors()
Returns the approximate standard errors of the maximum likelihood
estimates.
|
double[][] |
getVarCov()
Returns the approximate variance-covariance matrix of the maximum
likelihood estimates.
|
void |
setClosedForm(boolean cf)
Sets the flag indicating whether or not the closed form solution should
be used.
|
void |
setExact(boolean exact)
Sets the flag indicating whether or not the PDF supplies the exact
gradient and Hessian.
|
void |
setGuess(double[] guess)
Sets the guess or starting values of the parameters.
|
void |
setSample(double[] x)
Sets the sample data to use in the estimation procedure.
|
public MaximumLikelihoodEstimation(double[] x, ProbabilityDistribution pd, double[] guess)
x
- a double
array containing the sample observationspd
- an instance of ProbabilityDistribution
guess
- a double
array or a comma-separated list of
doubles giving the starting values for the parameters
Note: The argument guess
is a variable length argument list
(varargs).
public void compute() throws MinConNLP.ConstraintEvaluationException, MinConNLP.ObjectiveEvaluationException, MinConNLP.WorkingSetSingularException, MinConNLP.QPInfeasibleException, MinConNLP.PenaltyFunctionPointInfeasibleException, MinConNLP.LimitingAccuracyException, MinConNLP.TooManyIterationsException, MinConNLP.BadInitialGuessException, MinConNLP.IllConditionedException, MinConNLP.SingularException, MinConNLP.LinearlyDependentGradientsException, MinConNLP.NoAcceptableStepsizeException, MinConNLP.TerminationCriteriaNotSatisfiedException
MinConNLP.ConstraintEvaluationException
- Constraint
evaluation returns an error with current point.MinConNLP.ObjectiveEvaluationException
- Objective
evaluation returns an error with current point.MinConNLP.WorkingSetSingularException
- Working set
is singular in dual extended QP.MinConNLP.QPInfeasibleException
- QP problem
seemingly infeasible.MinConNLP.PenaltyFunctionPointInfeasibleException
- Penalty function point infeasible.MinConNLP.LimitingAccuracyException
- Limiting
accuracy reached for a singular problem.MinConNLP.TooManyIterationsException
- Maximum number
of iterations exceeded.MinConNLP.BadInitialGuessException
- Penalty function
point infeasible for original problem. Try new initial guess.MinConNLP.IllConditionedException
- Problem is
singular or ill-conditioned.MinConNLP.SingularException
- Problem is singular.MinConNLP.LinearlyDependentGradientsException
- Working set gradients are linearly dependent.MinConNLP.NoAcceptableStepsizeException
- No
acceptable stepsize in [SIGMA,SIGLA].MinConNLP.TerminationCriteriaNotSatisfiedException
- Termination criteria are not satisfied.public double[] getEstimates()
double
array containing the parameter estimatespublic double[][] getHessian()
double
matrix containing the Hessian matrixpublic double getLogLikelihood(double[] x, double[] params)
Note that this method is for convenience and does not use any of the member data or parameters. The user supplies the arguments.
x
- a double
array containing sample dataparams
- a double
array or comma separated list of
doubles containing the parameter valuesdouble
, the log-likelihood evaluated at the given
data and parameter valuespublic double getMinusLogLikelihood()
This method returns the value of the objective function, the minimum of minus the log-likelihood.
double
, minus the log-likelihoodpublic double[] getStandardErrors() throws SingularMatrixException
double
array containing the standard errorsSingularMatrixException
- The matrix is singular.public double[][] getVarCov() throws SingularMatrixException
double
matrix containing the approximate
variance-covariance matrixSingularMatrixException
- The matrix is singular.public void setClosedForm(boolean cf)
cf
- a boolean
. When true, the compute()
method returns the closed form solution if the
ProbabilityDistribution
is a
ClosedFormMaximumLikelihoodInterface
object. The option is
ignored if that is not the case.
Default: cf
= false
.
public void setExact(boolean exact)
exact
- a boolean
. When true
, the function
expects the pdf
to supply the analytic gradient and Hessian
calculation.
Default: exact
= false
.
public void setGuess(double[] guess)
guess
- a double
array of the same length as the
parameters containing proper starting values for the optimization.
guess
may also be a comma separated list of doubles giving
the parameter values.
Note: The argument guess
is a variable length argument list
(varargs).
public void setSample(double[] x)
x
- a double
array containing sample observations of
the random variableCopyright © 1970-2016 Rogue Wave Software
Built May 19 2016.