Hi, Is there a way in sympy to work with symbolic vectors and matrices? Or, more specifically and low level, to use "sum" in a purely symbolic manner? E.g.:
Let's say I have two data vectors of large and unknown length, X and Y. I would like to blend them with: e = sum_i [(a*X_i + (1-a)*Y_i)^2] Now I would like to compute de/da, set that to zero, and solve. The solution, I believe, is: a = sum_i(Y_i*(Y_i - X_i)) / sum_i (X_i-Y_i)^2 But I would like to be able to double-check this with sympy. (Even if sympy can't figure out this solution on its own, it would be quite nice if I could walk it through the steps and sympy could just make sure I've made no errors.) This is a very simple example -- consider matrices along with high level operators such as diag(), matrix mul, element-wise operations... the various things numpy can do, for instance. But the question is how to be able to represent such a thing abstractly in sympy, without ever naming the size of the matrices for instance. Is there a way to do this I just haven't found yet? -Brandyn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---
