Example: Maximum Likelihood Estimation - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

Home : Support : Online Help : Mathematics : Optimization : GlobalOptimization Package : Example: Maximum Likelihood Estimation

Maximum Likelihood Estimation

 

Introduction

Theory

Load Packages

Generate Data Set of Random Numbers

Maximizing the Likelihood Function

Histogram

Introduction

The likelihood function describes how closely a probability distribution describes a data set.  This application will demonstrate how to:

 

• 

Generate a data set according to a Weibull distribution with a specified scale and shape parameter.

• 

Backsolve the scale and shape parameters for this data set by maximizing the likelihood function using the Global Optimization Toolbox.

• 

Compare the resulting probability distribution against a histogram of the data set.

Theory

The Weibull probability distribution has the following density function:

 

where α and β are the scale and shape parameters.  The likelihood that a data set fits this distribution is:

 

Taking the log of this gives:

 

Hence we derive the following expression describing the likelihood function:

Load Packages

Generate Data Set of Random Numbers

Number of random numbers to generate

Define the desired scale and shape parameters for the data set.

Generate a sample of random numbers according to a Weibull distribution

Maximizing the Likelihood Function

The probability density of a Weibull distribution

The likelihood function

Find the values of α and β that maximize the likelihood function with the Global Optimization Toolbox

(5.1)

(5.2)

These values match those used to generate the data set.

 

You can also match moments to find the shape and scale parameters

(5.3)

Histogram

In the above plot, the red line corresponds to the estimated parameters based on the sample population and the black line corresponds to the desired sample parameters.


Download Help Document