Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
Activity
NicolasDelepine
@NicolasDelepine
Hi everyone, I have an other question regarding vonMises distribution. I would like to fit data with a such distribution. But I can't. For others distributions, I have already used ot.LogNormalFactory().build(data) or ot.WeibullFactory().build(data2), but it seems that the option is not available for vonMises.
7 replies
JPelamatti
@JPelamatti
Hello! Quick question, is there a way to extract and set the diagonal values of an ot.SquareMatrix object? I'm thinking about methods that would look something like getDiagonal() and setDiagonal(), which unfortunately do not exist (expect for the HMatrix class if I'm correct)
nico nic
@nico6744_gitlab
Hi, I would like to use MCMC functionality. Do you have a simple example to illustrate it ? Many thanks in advance
nico nic
@nico6744_gitlab

@nico6744_gitlab def make_model(x):
a = pymc.Exponential('a', beta=x, value=0.5)

@pymc.deterministic
def b(a=a):
return 100-a

@pymc.stochastic
def c(value=.5, a=a, b=b):
return (value-a)**2/b

return locals()

M = pymc.MCMC(make_model(3))

nico nic
@nico6744_gitlab
I would like to use an equivalent functionality as 'py.MCMC' (below, which is a deprecated python code), but i wonder if i can implement a refinement criteria in ot.MCMC.
4 replies
Michael Baudin
@mbaudin47

Hello!
I just updated the project we use for PRACE training to OT1.16, but face an error because OpenTURNS cannot find ipopt:
https://app.circleci.com/pipelines/github/mbaudin47/hpcuqtraining/90/workflows/f3e2f47f-2cb9-4e79-bb50-f3b5e2b8a16f/jobs/93

import openturns as ot
[...]
ImportError: libipopt.so.3: cannot open shared object file: No such file or directory

Do you have an advice? @jschueller: I saw that you maintained the ipopt conda package: you may see it more clearly than I.

3 replies
Simmeene
@Simmeene

Hello everyone!
I'm writing my M.sc theses on uncertainty propagation and sensitivity analysis for a hydraulic model (finite element model). Totally new to both python and OT, but I've managed to do some things that I think will be useful.
Because the hydraulic model i'm running is quite heavy I'm planning on doing some sort of polynomial chaos expansion. I emailed the professor Bruno Sudret as well, and he recommended using sparse polynomial expansion.
1 . Do you all agree with this or would you recommend another method?

I'm using the "Sobol’ sensitivity indices from chaos" eg. borehole example together with "Polynomial chaos is sensitive to the degree" when making my setup.

I've managed to get good results with the examples. I've changed the sampling to sobol sequences, getting reasonable results for sobol indices, but when I look at the validation techniques in the examples they are based on creating new samples and doing additional model runs which I don't want. I've read a bit about Leave one out method but can't find any examples that use it for PCE.
2 . Could that be an idea or are there other alternatives?

Any help or advice would be much appreciated!
Best regards //Simon

6 replies
vchabri
@vchabri
Hi everyone!
Quick question about the ot.Sample object and its associated .sort() method. Is there any option to get a sorted sample in descending order instead of ascending one?
I could'nt find such an option in the documentation, but maybe I'm wrong.
Thanks a lot.
4 replies
efekhari27
@efekhari27

Hi everyone,

I was wondering why the KrigingResults class doesn't provide an access to the Kriging variance function. The method getConditionalMarginalVariance() allows to compute the Kriging variance on various points but getting the function object could be interesting to use it for optimization purposes (as much as we get the predictor function using the getMetaModel() method). Of course, this is not or real lack since a Python function can easily wrap getConditionalMarginalVariance().

Best,
Elias

2 replies
Hi again,
I was wondering if multiple cpus can be allocated to a SymbolicFunction(). It might sound useless since the main advantage of this analytical function is to be very quick. However, to get a reference value of a complicated toy-case, a large Monte Carlo simulation is often performed (order of 10^9). In this case, having a parallel SymbolicFunction() would save some time.
Best, Elias
5 replies
efekhari27
@efekhari27
Sorry I have a third question,
I tried the SimulatedAnneling() algorithm to optimize a LHS Design of Experiment based on a Normal distribution. I first used the L2-centered discrepancy (SpaceFillingC2()) as criterion and wanted to try using the minimum distance between the DoE points (SpaceFillingMinDist()). By simply replacing SpaceFillingC2() by SpaceFillingMinDist(), I get a bad DoE since the SimulatedAnneling() is a mimization problem while the SpaceFillingMinDist() criterion needs to be maximized. Is there a way to use the SpaceFillingMinDist() with SimulatedAnneling()?
Best, Elias
10 replies
JPelamatti
@JPelamatti
Hello everyone,
While playing a bit around with the PythonFunction class, I noticed that a user defined gradient function can only be provided by the user in the object constructor under the form of a standard python function, as this cannot be done later on with the setGradient accessor. Indeed, setGradient only seems to accept as input a GradientImplementation object, which I think can only be obtained through a getGradient accessor or by relying on finite difference gradients.
Do you think that modifying the setGradient accessor so that it can accept a standard python function could be a useful and coherent enhancement of the class?
Example:
def mySimulator(x):
y0 = 1. - x[0] * x[1]
y = [y0]
return y

dy0dx0 = 0.123
dy0dx1 = 0.321

# Defining the gradient in the constructor
# Output: [[ 0.123 ] [ 0.321 ]]

# Defining the gradient after the construction
f = ot.PythonFunction(2,1,mySimulator)
#output: TypeError: Object passed as argument is not convertible to a Gradient
3 replies
Irene Anello
Hi everyone,
I have to do sensitivity analysis of a defined by cases function.
The function is f = sqrt(2rDd) if d \in (0,2] and f = 2sqrt(D*r) if d>2.
I would like to use SymbolicFunction but I think it is impossibile. Do you know a way to define a function like this to perform sensitivity analysis?
Sorry for my English and thank you in advance :)
2 replies
Konstantin Kuznetsov
@kikuznetsov
Hello. I want to create a metamodel based on Code_Saturne calculations, in order to carry out uncertanty propagation. Do you have any detailed example how to get access to vtk fields from openTURNS or how to couple Code_Saturne and openTURNS. I found that it is possible to couple by YACS but it is not clear for me. Thanks!
8 replies
tom-max-lawson
@tom-max-lawson
Hello, I need to generate n different Kriging metamodels, and I am trying to run the hyperparameter optimisations for each Kriging model individually in its own process using the Python multiprocessing library. However, this is actually several times slower.
Has anyone here tried to run openturns optimisation in parallel processes? Is there anything I should know?
2 replies
Name cannot be blank

Hello all,
I am trying to find a system event but I got this error when I tried to find the union of events.

File "C:\ProgramData\Anaconda3\lib\site-packages\openturns\metamodel.py", line 9967, in init
_metamodel.UnionEvent_swiginit(self, _metamodel.new_UnionEvent(*args))

my threshold events are openturns.metamodel.ThresholdEvent which are defined like this

class=ThresholdEventImplementation antecedent=class=CompositeRandomVector function=class=Function name=Unnamed implementation=class=FunctionImplementation name=Unnamed description=[x0,x1,x2,y0] evaluationImplementation=class=QuadraticEvaluation name=Unnamed..

Any help would be very much appreciated. Thank you!

8 replies
Leejuhyoung
@Leejuhyoung
Hell all, I must need Openturns version 1.6. but i can't find it. How can i find it? Also I'm using Jupiter notebook .
3 replies
vchabri
@vchabri

Hi all,
I am doing kriging with OpenTURNS. All my inputs are assumed to be independent. Let assume I can split my input vector X into three vectors (X1, X2, X3).

• For X1, I define a productCovarianceModel of Matern covariance functions (covarianceKrigingModel = ot.MaternModel([1.0] * nb_exp, 3./2.)), with nb_exp the number of explanatory variables in X1 ;
• For X2, I would like to define a one-dimensional Matern covariance function parameterized by a single parameter (for all the components of X2). With this single parameter, the idea is to simplify the hyperparameters' optimization ;
• For X3, I model it with an homoscedastic nugget effect.

My question is the following: how is it possible to define such a covariance function for X2, with a single parameter for all the components of X2 ?

Don't hesitate to tell me if it's clear enough. I assume it's not

2 replies
Aurore Parrot
@amparrot_gitlab
Hi everyone, is it possible to fit a LogNormal distribution on a sample forcing the gamma parameter to zero ? I use LogNormalFactory() to fit the distribution but I don't want this aditional location parameter. Thank you by advance for your help.
3 replies
Akhilnandh
@Akhilnandh
Hello everyone,
12 replies
I am a researcher working on fitting distribution models ( a combination of both discrete and continuous distribution models ) to predict demand for inventory system. I find Open turns to be very useful. particularly, when selecting between different models. I came across the following test, which I am trying to use. https://openturns.github.io/openturns/1.16/user_manual/_generated/openturns.FittingTest_BestModelAIC.html#openturns.FittingTest_BestModelAIC
However, in this link, it is mentioned that the method returns the best model as per BIC
best_modelDistribution
The best distribution for the sample according to Bayesian information criterion. This may raise a warning if the best model does not perform well.
I implemented both BestModelBIC and BestModelAIC on a dataset and found them to be similar. I'd like to know if AIC is computed on the basis of BIC in this method or it is a typo
vchabri
@vchabri
Hi there!
I'm trying to install OpenTURNS 1.17 on a MacOS (macOS Catalina) and I get some trouble following this page:
https://openturns.github.io/openturns/latest/install.html
Is there any specific command or things to get this work?
Thanks a lot.
12 replies
Akhilnandh
@Akhilnandh
Hi there ! I was wondering if for model selection on the basis of distributions, after fitting a distribution, we can just take a sample and calculate the RMSE and MAE with the actual values. Is there any particular reason we go for goodness of fit tests and statistics rather than simple error metric
jnrobinson
@jnrobinson
Hi all, is there any simple trick to inverting a SymbolicFunction in openTURNS? I'm working with S/N curves which are traditionally written with S as a function of N, but I need to find N as a function of S
2 replies
jnrobinson
@jnrobinson
Is there any way to do something like a CompositeDistribution but with a function of 6 variables? I have a ot.PythonFunction which accepts 6 variables as inputs and returns one output. I would like to be able to input six ot.Distibutions and get a single distribution out. I looked at the CompositeDistribution documentation and it seems like it only works with scalar functions
8 replies
BinglinW
@BinglinW
Hi everyone, When I want to construct a Kriging, there are many warning as follows. How can I fix I?
WRN - Warning! For coherency we set scale upper bounds = [193.979,88.0434,4.76471,2.51277,1.84872,486.715]
WRN - (previous message repeated 1 time)
WRN - Warning! For coherency we set scale upper bounds = [193.979,88.0434,4.76471,2.51277,1.84872,486.715,100,100,100,100,100,100]#12
WRN - The basis of functions will be applied to all output marginals
WRN - set the component 1 of contributor 0=0 to zero as it is too small
WRN - set the component 2 of contributor 0=0 to zero as it is too small
2 replies
BinglinW
@BinglinW
Hi everyone, When I want to construct a Kriging, there are a wrong as follows. How can I fix it?

openturns\metamodel.py", line 4961, in run
return _metamodel.KrigingAlgorithm_run(self)

TypeError: InvalidArgumentException : Error: the maximum absolute coefficient is 0. Are all coefficients null?

BinglinW
@BinglinW
Hi everyone, I would like to know if the optimization objective (space_filling) can be defined by myself when I use SimulatedAnnealingLHS(lhs, space_filling, temperatureProfile). I didn't find a way to do it. The background of the question is that I already have some experimental points and I want to add some points to them to make all the points have better uniformity. Thank you for your help!
2 replies
jnrobinson
@jnrobinson

I'm building some ot.ConditionalDistributions with some pretty complex ot.PythonFunctions as the link functions. It works well for most cases, but for a few I get the following error:

InvalidArgumentException : Collection of distributions has atoms with too small total weight=3.31006e-13 for a threshold equal to Mixture-SmallWeight=1e-12

Do you have any thoughts on what might be causing this error? I'm trying to track down the problem but I'm in the dark since I don't really understand the code behind ot.ConditionalDistribution

9 replies
LiuLiangCDUT
@LiuLiangCDUT
Hi all, I would like to customized a GaussianKDE distribution as marginal distribution for copula with a given correlation matrix. Can you tell me how to customized the GaussianKDE distribution. I have studied this link (https://openturns.github.io/openturns/latest/auto_probabilistic_modeling/distributions/plot_python_distribution.html). Thank you so much for your help!
12 replies
BinglinW
@BinglinW
Hello everyone, in the model of Kriging, OpenTurns can choose a variety of parameters, such as Basis and CovarianceModel, I want to know if there is a way in OpenTurns to automatically select the best parameters. Thank you for your attention.
9 replies
BinglinW
@BinglinW
josephmure
@josephmure
Friedrich Menhorn
@FMenhorn_gitlab
Hi, I am having trouble installing openturns on macOS (Mojave 10.14.6, quite old, I know). I am using the miniforge installation as described on your website. When I use Python 3.9 and openturns 1.19, I get a library error for libglog: "Library not loaded: @rpath/libglog.1.dylib
Referenced from: <PATH>/miniforge3/envs/openturns/lib/libOT.0.20.0.dylib, Reason: image not found" and indeed I can only find libglog.0.dylib in the lib folder. (I tried just renaming the library file but that didn't work.) Then I tried an older version using Python 3.7 and openturns 1.15/1.16 and I get a similar error but for a different library "Library not loaded: @rpath/libipopt.3.dylib. Referenced from: <PATH>/miniforge3/envs/openturns_py3.7/lib/libOT.0.dylib
Reason: image not found" Have you seen these errors before and have maybe a solution for it. Thanks a lot!
6 replies
Friedrich Menhorn
@FMenhorn_gitlab
Edgar Jaber
@EdgarJaber
Hi all! I am new to OpenTURNS, I am trying to plot a cobweb graph with the DrawParallelCoordinates() procedure. However, when I try to do ot.VisualTest.DrawParallelCoordinates(inputSample, outputSample), I get the: AttributeError: type object 'VisualTest' has no attribute 'DrawParallelCoordinates'. I use OpenTURNS 1.19 in a jupyter notebook! Thank you for your help!
3 replies
BinglinW
@BinglinW
Hi, in my last question, I was suggested to use OTGU Kriging. But it can't be imported by "import otgu". How can I use it?
2 replies
BlackMartian
@BlackMartian
Hello everyone! I'm a beginner in the field of making PCE metamodels, so any help regarding the following question will mean a lot. I need to get the variance based on the PCE metamodel and I know that I can calculate it with coefficients of polynomials. In OpenTURNS there is a way to get the coefficients with getCoefficients(), but after getting the values of the coefficients I have to square them and add together (without the first coefficient). In order to do this, my idea was to append the values of the coefficients to an array, but with the values in my array I also get other things, which I don't really understand the meaning of, like: class, name and dimension. Is there a way to only access the values of the coefficients or maybe an easier way to estimate the variance?
4 replies
Thomas Saigre
@thomas-saigre

Hi !

I discovered that Openturns is also a c++ library.
I installed on my computer the deb libopenturns-dev and libopenturns0.15, but I did not manage to find how to use it in a c++ program, and I did not find a page about it in the documentation, (only how to install it)
I tried this :

#include <openturns/OT.hxx>
int main(int, char *[])
{
OT::Point P;
}

compiling with the following command : g++ ot.cpp -ltbb -std=c++11, I get the following error :

/usr/bin/ld : /tmp/ccBgGP0q.o : dans la fonction « main » :
ot.cpp:(.text+0x71) : référence indéfinie vers « OT::Point::Point() »
/usr/bin/ld : /tmp/ccBgGP0q.o : dans la fonction « OT::Object::Object() » :
ot.cpp:(.text._ZN2OT6ObjectC2Ev[_ZN2OT6ObjectC5Ev]+0xf) : référence indéfinie vers « vtable for OT::Object »

(among many errors of that kind, for other function where the reference is undefined…)

What can I do to compile sucessfully the code ?

Thanks

7 replies
hfidelin
@hfidelin

Hi everyone !

I just discovered OpenTurn and I'm tryong to use it for sensitivity analysis, especially polynomial chaos.
I first followed the "Advanced polynomial chaos construction" from the website, and I was wondering :

Can we get rid of the function "model = ot.SymbolicFunction([vars],[formulas])", and instead using data from personal text files ? (something like "model = ot.something(input.txt, output.txt) )
Or does the function "ot.FunctionChaosAlgorith" absolutly needs an analytic expression of it's model ?

2 replies
BinglinW
@BinglinW
Hi, everyone. I want to know something more about the plot. 1. How can I change the font to Time New Roman; 2. May I set the Range of coordinate axes? I only find the setXMargin(0.01), but I want to limit it to x in [0, 100] for comparing different Figures. 3. For the cloud, may I change the size of the points? I did not find any API for it. Thanks for your attention!
6 replies
BlackMartian
@BlackMartian
BlackMartian
@BlackMartian
Hi everyone! I am making a PCE metamodel for a model of a simple cantilever beam where I don't have a fixed value of its width (w), rather a set of values, like w = [1, 1.1, 1.2, 1.3] and I would like to get some results for each of its widths. In order to do that by making a PCE metamodel, I used a for loop as shown in the picture above (I accidentally uploaded it while typing, really sorry about that). In the continuation of the code is a standard procedure of making the metamodel by using the Least Square Method and Fixed Strategy for truncation. After getting the metamodel, I obtain an experiment of 10000 samples based on my metamodel. I do get the results of the experiment that I need, but they are stored in the following way: [ v0 ]
0 : [ -0.222308 ]
1 : [ -0.427048 ]
2 : [ -0.507228 ]
.....
[ v0 ]
0 : [ -0.209906 ]
1 : [ -0.338272 ]
2 : [ 0.0976371 ]
...... (four times)
What I need is to get the number of the values (sepparately for each v0) that are greater than 0, but I don't really know how to do that. I would really appreciate your help. Thank you in advance!
3 replies
hfidelin
@hfidelin

Hello everyone ! When I do a polynomial chaos analysis with :

chaosalgo = ot.FunctionalChaosAlgorithm(inputTrain, outputTrain)
chaosalgo.run()
result = chaosalgo.getResult()

Is there a way to get the confidence interval for the Sobol indice ? Thanks for you attention !

4 replies