Hi there,
I am exploring the use of BayesDistribution
within OpenTURNS to model the dependency between two variables. My goal is to capture the correlation between these variables, and I’m curious if OpenTURNS allows for the integration of a correlation matrix or copula mechanism directly within BayesDistribution
.
Previously, I’ve applied copulas to correlate distributions, followed by a filtering criterion to eliminate samples where X1 exceeds the X2 by 19 units. This method was part of a custom Monte Carlo simulation I developed.
Now I am looking into Subset Simulation to improve efficiency, which means I need to get rid of th filter. This let me to the BayesDistribution
. However, I’m unsure how to incorporate the correlation between samples using this distribution.
Is there a methodology within OpenTURNS that would allow me to correlate samples within the context of BayesDistribution
? Alternatively, if BayesDistribution
isn’t suited for this purpose, could you recommend a more appropriate approach that aligns with the capabilities of Subset Simulation and maintains the correlation structure?
I appreciate any insights or suggestions
I used this code to describe the dependency, which is exactly what I need. Just that the samples are not correlated…
X2_distribution = ot.Normal(-5.0, 1.0)
parameter_for_X1_distribution = ot.SymbolicFunction(["X2"], ["25", "5", "0", "min(-X2 + 19, 25)"])
X1_base_distribution = ot.TruncatedNormal()
combined_2d_distribution = ot.BayesDistribution(
X1_base_distribution, X2_distribution, parameter_for_X1_distribution
)
sample = combined_2d_distribution.getSample(10_000)
print(sample)
graph = combined_2d_distribution.drawPDF()
cloud = ot.Cloud(sample)
cloud.setColor("red")
graph.add(cloud)
view = viewer.View(graph)
which looks like this:
I am quite new to OpenTURNS, if there is a similar post I missed, please let me know - and excuse me if this is a stupid question