Hi,
I am still new to sage, I am trying to compute use sage to do some symbolic computation. Here is my test to compute entropy of the Gaussian distribution:
x, sigma, mu,a = var('x','sigma','mu','a')
q = 1/((2*pi)^(1/2)*sigma)*exp(-(x - mu)^2/(2*sigma^2))
assume(sigma>0)
assume(mu>0)
show(q)
import sympy
integral(q,(x,-oo,oo))
integral(-q*log(q),(x,-oo,oo))
First of all, it complains if I don't assume mu is positive. It is right that sigma should be positive but why mu ?! Second, even after assuming mu>0, it produces stack overflow:
WARNING: Output truncated!
full_output.txt
;;;
;;; Binding stack overflow.
;;; Jumping to the outermost toplevel prompt
;;;
;;;
;;; Binding stack overflow.
;;; Jumping to the outermost toplevel prompt
;;;
Does anyone know why? I am sure I am missing something.