I've looked in the SymPy documentation and cannot find a template for this.
I apologise if I've overlooked something and the answer is trivial, but all
I wish to do create a sampler for custom probability distributions defined
using SymPy algebra e.g.:
from sympy.stats import ContinuousRV, sample
from sympy import sqrt, exp, Symbol, Interval, oo, pi
mean, prec = 1, 4
x = Symbol('x')
pdf = sqrt(prec)/sqrt(2*pi) * exp(-prec*(x-mean)**2/2)
Z = ContinuousRV(x, pdf, set=Interval(-oo, oo))
z = sample(Z)
print(next(z))
However the last line just produces a TypeError. I'd be grateful for any
guidance!
Gary.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/ec6b255f-312b-48bc-b5c5-c0a0b3b75f76n%40googlegroups.com.