# Developing the SSE metamodel based on a discrete random variable

**URL:** <https://uqworld.org/t/developing-the-sse-metamodel-based-on-a-discrete-random-variable/1553>\
**Category:** Community Q&A and How To\
**Tags:** input, metamodeling\
**Created:** [April 10, 2022, 4:21pm UTC](https://uqworld.org/t/developing-the-sse-metamodel-based-on-a-discrete-random-variable/1553 "2022-04-10T16:21:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali](https://uqworld.org/user_avatar/uqworld.org/ali/32/487_2.png) [@ali](https://uqworld.org/u/ali)\
**Post date:** [April 10, 2022, 4:21pm UTC](https://uqworld.org/t/developing-the-sse-metamodel-based-on-a-discrete-random-variable/1553/1 "2022-04-10T16:21:10Z")

</div>

Dear UQLab,

First and foremost, congratulations on your new milestone and thanks for implementing the SSE metamodel.  
**I want to build the SSE metamodel based on a discrete random variable** , e,g, X: {1,2,3,4,5,6,7}  
I read all of the related previous discussions:

- [https://uqworld.org/t/error-with-custom-distribution-discrete-uniform-in-metamodel-calculate/289/2](https://uqworld.org/t/error-with-custom-distribution-discrete-uniform-in-metamodel-calculate/289/2)
- [https://uqworld.org/t/discrete-random-variable-in-pce/1082/2](https://uqworld.org/t/discrete-random-variable-in-pce/1082/2)
- [https://uqworld.org/t/input-discrete-data-along-with/1168](https://uqworld.org/t/input-discrete-data-along-with/1168)

Furthermore, According to the discussion in User Manual Input, _Section: 2.7 Defining and using custom marginals_, it is also possible to add our arbitrary marginals.

Combining the previous discussions and the mentioned capability, I would like to know your suggestions. I will be honored if you can help me.

1. If I can define a discrete marginal distribution and construct my input model, **Can the implemented metamodels in UQLab (in particular, SSE) be constructed based on discrete input data?**

2. According to Prof. @bsudret suggestion in the 1st bullet link:

> To solve your problem anyway, I suggest you use a _continuous_ uniform distribution, and use a rounding to get the discrete values that are needed as inputs for your MODEL. This can be done after `uq_getSample` (N), e.g. using the `floor` or `ceil` functions.

It seems the new refinements are based on the previous continuous uniform marginals, **not the new defined discrete ones**. So, this idea couldn’t work in metamodels (I am not sure!).  
I am most grateful for any recommendations from RSUQ and/or the community.  
Furthermore, I am also ready to give my best shot to **add a discrete random variable type to UQLab** based on the developers’ guidance.  
Last but not least, I really appreciate your time and consideration

Kind regards,  
Ali
