[ot-users] TR: OpenTurns inquiry

regis lebrun regis_anne.lebrun_dutfoy at yahoo.fr
Tue Jul 25 18:45:34 CEST 2017

Hi Phil,

First of all, thank you for using OpenTURNS. Here is my input concerning your questions:

1. It is very easy to flip/translate (and even scale) an univariate distribution in OpenTURNS using the arithmetic of random variables, see flip_distribution.py.

2. There is currently no way to truncate multivariate distributions in OpenTURNS, but a quick and dirty (ie mathematically correct but not optimized) way to get it is given in truncated_nd_distribution.py

3. I have no idea on what is going on. I added the relevant guys to the discussion, but keep in mind that Denis and Julien are on holidays and Sofiane has a terrible workload, so you may have to wait a little bit for their input

For this kind of questions, it is better to use the users mailing list, see http://openturns.org/mailman/listinfo/users to subscribe to the list.

Best regards,

De :Phil Fernandes [mailto:phil.fernandes at enbridge.com] 
Envoyé : mardi 25 juillet 2017 00:29
À : LEBRUN, Regis; barbier at imacs.polytechnique.fr
Objet : OpenTurns inquiry
Hello Regis, Denis,
I am an engineer with Enbridge Pipelines and we have recently begun using OpenTurns for reliability analysis of our infrastructure. So far I am finding it to be an excellent and very comprehensive software library – thank you for helping develop it. 
I have run into a few of issues when using OpenTurns and was wondering if you might be able to provide some help:
1.       Is there a way of mirroring skewed distributions, for example flipping a Weibull distribution so that instead of a lower limit it has an upper limit?
2.       Is it possible to truncate a multivariate kernel density distributions? We can truncate univariate parametric distributions using the syntax
truncdist = ot.TruncatedDistribution(mydist, lower, upper)
but is there something analogous for multivariate KDEs where we can define bounds for each dimension?
3.       There is a conflict between the Python library PyMC3 and Theano and OpenTurns. If Theano is imported first, OpenTurns fails to import with the following error
Traceback (most recent call last):
  File "<ipython-input-3-704e69d30dff>", line 1, in <module>
    import openturns as ot
  File "C:\Anaconda3\lib\site-packages\openturns\__init__.py", line 61, in <module>
    from .common import *
  File "C:\Anaconda3\lib\site-packages\openturns\common.py", line 20, in <module>
    _common = swig_import_helper()
  File "C:\Anaconda3\lib\site-packages\openturns\common.py", line 19, in swig_import_helper
    return importlib.import_module('_common')
  File "C:\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_common'
If I reverse the import order (i.e., OpenTurns first, then PyMC3 or Theano), then PymC3/Theano fails to import with
                                Traceback (most recent call last):
  File "<ipython-input-2-e9f7838173a6>", line 5, in <module>
    import pymc3 as pm
  File "C:\Anaconda3\lib\site-packages\pymc3\__init__.py", line 5, in <module>
    from .distributions import *
  File "C:\Anaconda3\lib\site-packages\pymc3\distributions\__init__.py", line 1, in <module>
    from . import timeseries
  File "C:\Anaconda3\lib\site-packages\pymc3\distributions\timeseries.py", line 1, in <module>
    import theano.tensor as tt
  File "C:\Anaconda3\lib\site-packages\theano\__init__.py", line 80, in <module>
    from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
  File "C:\Anaconda3\lib\site-packages\theano\scan_module\__init__.py", line 41, in <module>
    from theano.scan_module import scan_opt
  File "C:\Anaconda3\lib\site-packages\theano\scan_module\scan_opt.py", line 60, in <module>
    from theano import tensor, scalar
  File "C:\Anaconda3\lib\site-packages\theano\tensor\__init__.py", line 9, in <module>
    from theano.tensor.subtensor import *
  File "C:\Anaconda3\lib\site-packages\theano\tensor\subtensor.py", line 26, in <module>
    import theano.gof.cutils  # needed to import cutils_ext
  File "C:\Anaconda3\lib\site-packages\theano\gof\cutils.py", line 320, in <module>
  File "C:\Anaconda3\lib\site-packages\theano\gof\cutils.py", line 285, in compile_cutils
  File "C:\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 2325, in compile_str
    return dlimport(lib_filename)
  File "C:\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 302, in dlimport
    rval = __import__(module_name, {}, {}, [module_name])
ImportError: DLL load failed: The specified procedure could not be found.
Your help would be very much appreciated.
Thank you.
Phil Fernandes   P.Eng, MASc
Engineer, Reliability Assessment

TEL: 780-420-8210  |  FAX: 780-420-5234   
7045 Enbridge Centre, 10175 101 Street NW, Edmonton, AB, T5J 0H3

Integrity. Safety. Respect.
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flip_distribution.py
Type: text/x-python
Size: 327 bytes
Desc: not available
URL: <http://openturns.org/pipermail/users/attachments/20170725/bcd4f682/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: truncated_nd_distribution.py
Type: text/x-python
Size: 1834 bytes
Desc: not available
URL: <http://openturns.org/pipermail/users/attachments/20170725/bcd4f682/attachment-0001.py>

More information about the users mailing list