title: MLE in python for 2 parameters
body: <p>I have a data set X which i need to use to maximise the parameters by MLE. I have the log likelihood function</p>
  <pre><code>def llh(alpha, beta):
    a = [0]*999
    for i in range(1, 1000):
      a[i-1] = (-0.5)*(((1/beta)*(X[i]-np.sin((alpha)*X[i-1])))**2)
    return sum(a)
  </code></pre>
  <p>I need to maximise this but i have no idea how. I can only think of plotting 3d graphs to find the maximum point but that gives me weird answers that are not what I want.</p>
  <p>This is the plot I got</p>
  <p><a href="https://i.stack.imgur.com/tdo5d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tdo5d.png" alt="enter image description here" /></a></p>
  <p>Is there any other possible way to get my maximum parameters or am I going about this the wrong way? My dataset model function is Xk = sin(alphaXk-1) + betaWk where Wk is normally distributed with mean 0 and sigma 1. Any help would be appreciated.Thank you!</p>