# Otagrum computeConditionalCDF

**URL:** <https://openturns.discourse.group/t/otagrum-computeconditionalcdf/405>\
**Category:** Python usage\
**Created:** [December 19, 2024, 3:23pm UTC](https://openturns.discourse.group/t/otagrum-computeconditionalcdf/405 "2024-12-19T15:23:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@Paul](https://openturns.discourse.group/u/Paul)\
**Post date:** [December 19, 2024, 3:23pm UTC](https://openturns.discourse.group/t/otagrum-computeconditionalcdf/405/1 "2024-12-19T15:23:18Z")

</div>

Hi,

I’m not an expert in statistics, but I am using OTAgrum for my master thesis. My task is to combine Bayesian Networks with copulas.

I trained the network with my data (10.000 x 5) → 5 Nodes and sampling and comparing the distributions looks good so far.

However, I don’t really understand the documentation for the [computeConditionalCDF](https://openturns.github.io/otagrum/master/user_manual/_generated/otagrum.ContinuousBayesianNetwork.html#otagrum.ContinuousBayesianNetwork.computeConditionalCDF) function.

For example if I want to compute the CDF that Node C \<= 50 under the condition that Node A = 2 and Node B = 3 (assuming A and B are parents of C)

In the code it would be something like

```auto
xj = 50 
xcond = [2, 3]

conditional_pdf = lcbn.computeConditionalCDF(xj, xcond)

print(f"Conditional PDF at {xj}, given {xcond}:")
print(conditional_pdf)`

```

But I can’t find a way e.g. to compute the CDF of e.g. parameter 3 and set parameters 0,1,2,4 as conditions.

Hope you can help me with that.

Thanks  
Paul

---

<div class="post-metadata">

**Author:** ![schueller](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/schueller/32/3_2.png) [@schueller](https://openturns.discourse.group/u/schueller)\
**Post date:** [January 3, 2025, 4:17pm UTC](https://openturns.discourse.group/t/otagrum-computeconditionalcdf/405/2 "2025-01-03T16:17:24Z")

</div>

hi, there are at least 2 possibilities for this:

- Use PointConditionalDistribution to freeze components, and call computeCDF on that object
- Use getMarginal([0, 1, 2, 4, 3]) to swap components 3 and 4 and use computeConditionalCDF on the result (hackish)
