Hi everybody,

The question raised by Henning made us find a bug in the OpenTURNS 
configuration file, hopefully easy to solve. Find the file openturns.conf in 
your installation of OpenTURNS, look for the key named 
"DistributionImplementation-Parallel" and change its value from "true" to 
"false", and that's it! You can create your own distribution and use it the way 
you want (eg use Show(myDist.drawPDF()))

Thanks to Julien for solving this bug!

Cheers

Régis


>________________________________
> De : Henning Brüske <[email protected]>
>À : "[email protected]" <[email protected]> 
>Envoyé le : Mercredi 23 mars 2016 11h17
>Objet : [ot-users] Bayesian updating
> 
>
>
> 
>Dear OT users,
> 
>Yesterday I got quick and successful help with creating a mixture 
>distribution. Thanks.
> 
>This time I try to implement a rather simple Bayesian updating of continuous 
>distributions with OT.
>Posterior = (Prior.pdf * Likelihood.pdf) / (Integral(Prior.pdf * 
>Likelihood.pdf))
> 
>But my many attempts failed. I hope have an answer. Here follows a scipy 
>example of what I want to achieve:
> 
>#==============================================================================
># beginning of code
>#==============================================================================
>import numpy as np
>from scipy.stats import norm
>from matplotlib import pyplot as plt
> 
> 
>x = np.linspace(-20, 20, 10000)
>Prior = norm(6., .8)
>Likelihood = norm(4., 1.2)
> 
>Posterior_pdf = Prior.pdf(x) * Likelihood.pdf(x) / np.sum(Prior.pdf(x) * 
>Likelihood.pdf(x) * (abs(x[0]) + abs(x[-1]))/len(x))
> 
>plt.figure()
>plt.plot(x, Prior.pdf(x), label="Prior")
>plt.plot(x, Likelihood.pdf(x), label="Likelihood")
>plt.plot(x, Posterior_pdf, label="Posterior")
>plt.xlim(0,8)
>plt.legend(loc = 'best')
>plt.show()
>#==============================================================================
># end of code
>#==============================================================================
> 
>Best regards and thanks,
> 
>Henning
> 
>_______________________________________________
>OpenTURNS users mailing list
>[email protected]
>http://openturns.org/mailman/listinfo/users
>
>
>
_______________________________________________
OpenTURNS users mailing list
[email protected]
http://openturns.org/mailman/listinfo/users

Reply via email to