Problem

Consider this dataset, Drand.mat, which contains a set of random numbers. Let’s make a hypothesis with regards to this dataset: We assume that this dataset is well fit by a Gaussian distribution. But, we don’t know the values of the two parameters (mean and standard deviation) of this Normal (Gaussian) distribution.

Write a script that constructs a mathematical objective function and then use an optimization algorithm of your choice to find the most likely values of the mean and standard deviation of this Gaussian distribution. Here is a best-fit Gaussian distribution using the most likely parameters to the histogram of this dataset.


MATLAB

Name your main script findBestFitParameters.m. Now when you run your script it should call fminsearch() and then output the best-fit parameters like the following,

>> findBestFitParameters
mu: -0.082001 , sigma: 1.0043

Start your parameter search via fminsearch() with the following values: $[\mu,\sigma] = [1,10]$.

Python

Name your main script findBestFitParameters.py. Here is an example expected output of such script,

findBestFitParameters
Optimization terminated successfully.
     Current function value: 142.326191
     Iterations: 50
     Function evaluations: 98
mean = -0.08200050180312446, standard-deviation = 1.0043358235352169

Start your parameter search via fmin() with the following values: $[\mu,\sigma] = [1,10]$.

Comments