# Discrete Random Variable in PCE

**URL:** <https://uqworld.org/t/discrete-random-variable-in-pce/1082>\
**Category:** UQ Discussion Forum\
**Tags:** pce\
**Created:** [March 15, 2021, 10:22am UTC](https://uqworld.org/t/discrete-random-variable-in-pce/1082 "2021-03-15T10:22:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bsudret](https://uqworld.org/user_avatar/uqworld.org/bsudret/32/224_2.png) [@bsudret](https://uqworld.org/u/bsudret)\
**Post date:** [March 16, 2021, 8:16am UTC](https://uqworld.org/t/discrete-random-variable-in-pce/1082/2 "2021-03-16T08:16:28Z")

</div>

Dear Gian Marco

Thanks for your question. So far there is no support for discrete variables in UQLab, but guess what : we’re working on it! The INPUT module is currently being enriched with such type of variables. This should appear in the next version.

Meanwhile you could address your problem as follows.

- if your discrete variable has many possible outcomes, say 5-10 or more, you can definitely use a continuous uniform, and indeed round the outcomes to fit your real discrete realizations. It’s an approximation that should work.

- if you have only 2 realizations of your discrete variable, say 0 or 1, you could fix it and compute Sobol’ indices conditioned on this value. And see if you observe the same patterns of sensitivity.

Hope this helps !  
Best regards  
Bruno

---

_[View the full topic](https://uqworld.org/t/discrete-random-variable-in-pce/1082)._
