Jun-09-2020, 02:57 PM
Hi every one,
when i am trying solve this equation using fsolve with variables as list
![[Image: 2ZOfu.png]](https://i.stack.imgur.com/2ZOfu.png)
can any help me out.
when i am trying solve this equation using fsolve with variables as list
![[Image: 2ZOfu.png]](https://i.stack.imgur.com/2ZOfu.png)
can any help me out.
from optimize import fsolve import numpy as np T = np.array([137,145,150,152,159,160,184]) Di =np.array([1,0,1,1,1,0,1]) r = 5.0 def lnL(P): mu, sigma = P return -r*np.log(sigma)-(1/2)*np.sum(Di*((T-mu)/sigma)**2)+np.sum(1-Di) sol = fsolve(lnL, (15.0,258.0)) soli am getting this error
fsolve: there is a mismatch between the input and output shape of the 'func' argument 'lnL'.Shape should be (2,) but it is (1,).