[ot-users] Bug in distribution algebra

Phil Fernandes phil.fernandes at enbridge.com
Thu Oct 5 18:03:26 CEST 2017


I am running version 1.9, but I have disabled simplifications as you suggested and it is working correctly now. Thank you for your quick replies!

From: users-bounces at openturns.org [mailto:users-bounces at openturns.org] On Behalf Of Julien Schueller | Phimeca
Sent: Thursday, October 05, 2017 1:42 AM
To: users at openturns.org
Subject: [External] Re: [ot-users] Bug in distribution algebra


After some more checking the CDF & quantile are ok with both the 1.9 version and the current master,

what version are you running ?





Here is the script I used:



import openturns as ot
from openturns.viewer import View
x_dist = ot.Weibull(0.11838, 1.6767, -0.034709)
y_dist = ot.Normal(0.354331, 0.354331*0.0235)
ls_dist = x_dist - y_dist
ls_dist.drawCDF()
View(ls_dist.drawCDF()).show()
for i in range(10):
    print(ls_dist.computeCDF(-4.0/10.0+i/50.0))

0.00042869973445390443
0.019440693720066658
0.09355158417553083
0.2053317087432412
0.3329714740337595
0.46134585220658253
0.5801972194337283
0.6835213642762484
0.7688041869759314
0.8361003299792358

for i in range(10):
    print(ls_dist.computeQuantile(i/10.0))

[-0.452745]
[-0.358691]
[-0.340872]
[-0.325076]
[-0.309661]
[-0.293729]
[-0.27641]
[-0.256451]
[-0.231363]
[-0.1938]



j



________________________________
De : users-bounces at openturns.org<mailto:users-bounces at openturns.org> <users-bounces at openturns.org<mailto:users-bounces at openturns.org>> de la part de Julien Schueller | Phimeca <schueller at phimeca.com<mailto:schueller at phimeca.com>>
Envoyé : jeudi 5 octobre 2017 08:49:27
À : users at openturns.org<mailto:users at openturns.org>
Objet : Re: [ot-users] Bug in distribution algebra


Hello Phil,



This seems to be a bug of the RandomMixture simplifications, a workaround is to disable simplifications:

ot.ResourceMap.SetAsBool("RandomMixture-SimplifyAtoms", False)



Thank you for reporting, I hope for this to get fixed for the 1.10 version.



j

________________________________
De : users-bounces at openturns.org<mailto:users-bounces at openturns.org> <users-bounces at openturns.org<mailto:users-bounces at openturns.org>> de la part de Phil Fernandes <phil.fernandes at enbridge.com<mailto:phil.fernandes at enbridge.com>>
Envoyé : jeudi 5 octobre 2017 00:31:26
À : users at openturns.org<mailto:users at openturns.org>
Objet : [ot-users] Bug in distribution algebra


I've come across some odd behavior when subtracting a normal distribution from a Weibull, e.g.,

x_dist = ot.Weibull(0.11838, 1.6767, -0.034709)

y_dist = ot.Normal(0.354331, 0.354331*0.0235)

ls_dist = x_dist - y_dist



The PDF function is correct, but the CDF and Quantile functions are nonsensical. I have uploaded figures showing this behavior here: https://imgur.com/a/GoVw3<http://smtp.datacenter.ibo.fr:32224/?dmVyPTEuMDAxJiZkNDRiMDhjNTdjZDljZjYwMD01OUQ1NjE0Nl81NDgyNV8xMjUyNF8xJiY1OGM4ZGZmNTNiNGJkMmI9MTIzMyYmdXJsPWh0dHBzJTNBJTJGJTJGaW1ndXIlMkVjb20lMkZhJTJGR29WdzM=>



Are there any caveats to be aware of when doing distribution algebra in OpenTurns? If I reverse the subtraction, i.e., y_dist - x_dist, then subtract the resulting CDF from 1, I get what appears to be the CDF I am looking for.



Thank you!



Phil Fernandes


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openturns.org/pipermail/users/attachments/20171005/31da7cce/attachment.html>


More information about the users mailing list