Estimation using maximum likelihood
In this recipe, we discuss how you can perform the optimization of a likelihood function using Julia.
Getting ready
Maximum likelihood is one of the basic techniques for the estimation of the parameters of a statistical model; see http://mathworld.wolfram.com/MaximumLikelihood.html or https://en.wikipedia.org/wiki/Maximum_likelihood_estimation for a more detailed discussion. In this recipe, we estimate the mean and standard deviation of a sample coming from a normal distribution. In this case, an analytical solution to this optimization problem is known and the estimate of the mean is the mean of the sampleÂ
and the estimate of standard deviation is
, whereÂ
is the sample size and
 are sample points.
We chose a problem whose analytical solution is known in order to compare whether the results using optimization and exact calculation are similar.
In this recipe, we will use the Optim.jl
package. If you do not have it installed, please add it using these commands...