stack overflow in computing entropy
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.
The semicolons indicate this is a Maxima overflow. (Maxima handles our symbolic integration, and raises the error messages asking for the sign of various parameters.)
By the way, importing sympy would not do anything here, unless you used sympy.integral or whatever their syntax is. Which could be an interesting option for you (or so I thought until I saw your other question).