I am trying to fit a wind data set v=v1,.....,vm using a two component mixture weibull distribution.
I found a paper suggesting to use the Maximum Likelihood method and in particular to maximize the following equation:
Omega, a1, a2, b1 and b2 are the parameters I want to change in order to maximize the function and v=v1,.....,vm is a series of known wind speeds.
I have been trying to use the SciPy minimization algorithm but without success.
Here is what I have so far:
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})
However I keep on getting the following error:
minimizer_function() missing 5 required positional arguments: 'omega', 'a1', 'b1', 'a2', and 'b2'
I am pretty sure I am missing something.
