# Help in understanding if the maximum likelhood estimation is working properly

I am learning estimation theory and need help in understanding for educational purpose how the concept of ML works with the help of a step by step implementation. I am trying to find out the ML estimates of the coefficients of a moving average model. I am unable to understand what I need to do in order to get the log-likelihood curve, so that I can select the coefficients based on the curve. There are implementations in the internet but I wanted to make my own in order to get a clear picture. The way I have done is for the model

 y(i) =  0.6*x(i-1) ;
z(i) = y(i) + w(i)


where the true coefficient is h = [ 0.6], the input is x and w is zero mean additive white gaussian noise with variance 1. I have used 4 different values of the estimates out of which one value is the true. If the implementation is correct, then I should get estimated coefficient as 0.6 because I am using the true known coefficient in the estimation procedure. However, this is not so. Where am I going wrong?

The maximum likelihood estimator will give you precisely the true value for the parameter for a vanishingly small number of instances --- unless the noise is zero.

Your noise instance w is not zero-mean, which will probably give more of a bias away from the true value.

If I take your numbers are just change the last entry in w from -0.65 to 0.1 then I get the "right" answer. Note that this changes the mean of w form -0.16 to -0.042 (i.e. closer to zero).

• Thank you for the details. I corrected my implementation and have got correct values till $(h*x-z)*(h*x-z)$. But, the values of the likelihood in the last column are very different from mine as a result I am getting the ML estimate of h as 0.4692. – SKM Nov 12 '16 at 0:41