-
-
Notifications
You must be signed in to change notification settings - Fork 673
Closed
Description
Although Maxima has the beta function, Sage doesn't:
sage: a, b, c = var('a b c')
sage: assume(a > 0)
sage: assume(b > 0)
sage: x = var('x')
sage: beta_dist = x**(a-1) * (1 - x)**(b-1)
sage: c = integral(beta_dist, x, 0, 1)
sage: c
beta(a, b)
sage: c(a=.5,b=.5)
beta(0.500000000000000, 0.500000000000000)
sage: c(a=.5,b=.5).n()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Users/karl-dietercrisman/<ipython console> in <module>()
/Users/karl-dietercrisman/Desktop/sage-4.4.2/local/lib/python2.6/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.n (sage/symbolic/expression.cpp:17042)()
TypeError: cannot evaluate symbolic expression numerically
This is is Ginac, though, and there is even room for defining it in symbolic/expression.pyx . It probably is also included in some of our other libraries, as a standard special function.
Apply
- Patches at Implement a symbolic version of the arg function #4498 and Mark random symbolic expression doctests with #random #12507
- attachment: trac_9130-beta_function.3.patch
- attachment: trac_9130-py_float_segfault.take2.patch
- attachment: trac_9130-reviewer.patch
- attachment: trac_9130-random-tests.2.patch
Depends on #4498
Depends on #12507
CC: @benjaminfjones
Component: symbolics
Keywords: special function, pynac, sd35.5 Cernay2012
Author: Karen Kohl, Burcin Erocal, Karl-Dieter Crisman
Reviewer: Benjamin Jones, Burcin Erocal, Karl-Dieter Crisman
Merged: sage-5.0.beta6
Issue created by migration from https://trac.sagemath.org/ticket/9130