Hi,
I am new in OpenTURNS and i am trying to create a multivariate distribution to generate a sample of 4 variables : A, B, C and D.
The 2 first (A & B) are independent, but the 2 last one are linked between each other and depend on the 2 first variables :
The relationship are defined as :
- A : Independent uniform variable between 300 & 6000
- B : Independent uniform variable between 1.6 & 4
- C : Uniform distribution between a minimal value depending on A & B and 12490
- D : Uniform distribution between C+10 and 12500
The minimal value is respecting the following equation:
where a=3.28084 and b=12490.
I have tried to use BayesDistribution, but i did’nt figure out how to define the relationship between C & D:
ADistribution = ot.Uniform(300, 6000)
BDistribution = ot.Uniform(1.6, 4)
ComposedDistribution = ot.ComposedDistribution([ADistribution, BDistribution])
fFunction = ot.SymbolicFunction(["x0", "x1"], ["y0", "y1", "y2", "y3"], f'y0 := min(((305+x0)*tan(x1*pi_/180)*3.28084) + 152,12500); y1 := 12490; y2 := y0+10; y3 := 12500')
distribution = ot.BayesDistribution(ot.ComposedDistribution([ot.Uniform(0, 12490), ot.Uniform(0, 12500)]),
ot.ComposedDistribution([ADistribution, BDistribution]), fFunction)
sample = distribution.getSample(1000).asDataFrame()
Maybe i am not using it correctly or there is easier way to do it ?
I need the distribution and not only the samples as i am using it in a MonteCarlo DoE
Thanks in advance
Regards
Adil