Last active
December 19, 2017 09:27
-
-
Save grinsted/50f238f06b5b209c7b70e9b9e08480b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sympy import * | |
init_printing(use_unicode=False, wrap_line=False, no_global=True) | |
x = Symbol('x', positive=True) | |
xmax = Symbol('xmax', positive=True) | |
sigma = Symbol('sigma', positive=True) | |
mu = Symbol('mu') | |
lx = log(x)-log(xmax-x) | |
pdf = exp(-0.5 * ((lx - mu)/sigma)**2) / (sqrt(2*pi) * sigma) | |
E = integrate(pdf*x,(x,0,xmax)) | |
#---------------------- | |
from sympy import * | |
init_printing(use_unicode=False, wrap_line=False, no_global=True) | |
lx = Symbol('lx') | |
xmax = Symbol('xmax', positive=True) | |
sigma = Symbol('sigma', positive=True) | |
mu = Symbol('mu') | |
x = xmax*exp(lx)/(exp(lx)+1) | |
pdf = exp(-0.5 * ((lx - mu)/sigma)**2) / (sqrt(2*pi) * sigma) | |
E = integrate(pdf*x,(lx,-oo,oo)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment