mardi 4 février 2020

Expectation of a product in python sympy

In python sympy I have the following code

from sympy.stats import P, E, variance, covariance, Normal

mu, sigma = symbols('mu sigma')
epsilon_t = Normal('epsilon_t', 0, sigma)
epsilon_t1 = Normal('epsilon_t+1', 0, sigma)

which defines two (presumably independent) normal random variables. Now, I would expect that

E(epsilon_t1*epsilon_t)

is equal to zero, but when I run this through sympy, I get something a lot more complicated. It tells me it is zero for pi/2 > 2|larg(sigma)| and something much more complicated otherwise. I don't care about the second part, I just want it to be zero. How can I do that?




Aucun commentaire:

Enregistrer un commentaire