title: Maximize Multi-parameter summation with python
body: <p>I am trying to fit a wind data set <code>v=v1,.....,vm</code> using a two component mixture weibull distribution.</p>
  
  <p>I found a paper suggesting to use the Maximum Likelihood method and in particular to maximize the following equation:</p>
  
  <p><a href="https://i.stack.imgur.com/mHejA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mHejA.png" alt="equation to maximize"></a></p>
  
  <p><code>Omega</code>, <code>a1</code>, <code>a2</code>, <code>b1</code> and <code>b2</code> are the parameters I want to change in order to maximize the function and <code>v=v1,.....,vm</code> is a series of known wind speeds.</p>
  
  <p>I have been trying to use the SciPy minimization algorithm but without success.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>def minimizer_function(v,omega,a1,b1,a2,b2):
     return np.reciprocal(np.sum((omega*(a1/b1)*((v/b1)**(a1-1))*(np.exp(-((v/b1)**a1)))+(1-omega)*(a2/b2)*((v/b2)**(a2-1))*(np.exp(-((v/b2)**a2))))))
  
  x0 = np.array([0.5,1.0,1.0,1.0,1.0])
  res = optimization.minimize(minimizer_function, x0, method='nelder-mead',options={'xtol': 1e-8, 'disp': True})
  </code></pre>
  
  <p>However I keep on getting the following error:</p>
  
  <blockquote>
    <p>minimizer_function() missing 5 required positional arguments: 'omega', 'a1', 'b1', 'a2', and 'b2'</p>
  </blockquote>
  
  <p>I am pretty sure I am missing something.</p>