> > > >>>betahat = loglik.diff(beta).solve(beta) > > > solve is a function, not a method. Sum doesn't (apparently) have a method to pull out terms that are independent of the summation symbol so you have to do that by hand: get beta on the outside of the Sum. Then solve for beta. The following is not robust, but exemplifies what I am talking about:
``` >>> id = lambda f,l,i: f.as_independent(l[0])[i] >>> eq.replace(Sum,lambda f,l:id(f,l,0)*Sum(id(f,l,1), l)) -alpha*Sum(X[k], (k, 1, n))/sigma2 - beta*Sum(X[k]**2, (k, 1, n))/sigma2 + Sum(X [k]*Y[k], (k, 1, n))/sigma2 >>> solve(_, beta) [(-alpha*Sum(X[k], (k, 1, n)) + Sum(X[k]*Y[k], (k, 1, n)))/Sum(X[k]**2, (k, 1, n))] ``` solve (or some method) should be able to pull independent symbols out of the summation. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/82feb56c-a5e5-44ea-b2a5-539e6d9c771e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
