# Half-normal distribution in PCE and Sobol

**URL:** <https://uqworld.org/t/half-normal-distribution-in-pce-and-sobol/782>\
**Category:** Community Q&A and How To\
**Created:** [July 31, 2020, 4:00pm UTC](https://uqworld.org/t/half-normal-distribution-in-pce-and-sobol/782 "2020-07-31T16:00:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aep93](https://uqworld.org/user_avatar/uqworld.org/aep93/32/507_2.png) [@Aep93](https://uqworld.org/u/Aep93)\
**Post date:** [July 31, 2020, 4:00pm UTC](https://uqworld.org/t/half-normal-distribution-in-pce-and-sobol/782/1 "2020-07-31T16:00:34Z")

</div>

Hello all,  
I have several input parameters in my model and for some of them, I need to consider a half-normal distribution. Is it possible to create a PCE based on inputs that have half-normal distribution in uqlab?  
I want to create a PCE of my model and then find the Sobol indices using it.  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![xujia](https://uqworld.org/user_avatar/uqworld.org/xujia/32/214_2.png) [@xujia](https://uqworld.org/u/xujia)\
**Post date:** [August 2, 2020, 10:42am UTC](https://uqworld.org/t/half-normal-distribution-in-pce-and-sobol/782/2 "2020-08-02T10:42:07Z")

</div>

Hi @Aep93,

Thanks for the post here. In fact, you only need to define your variable following the half normal distribution. Then, metamodelling and sensitivity modules can be directly used without modifications. To define an input variable following the desired distribution which is a special case of truncated distributions, you can use the `.Bound` field in your input options (see Section 2.6 of the [input manual](https://uqftp.ethz.ch/uqlab_doc_pdf/1.3.0/UserManual_Input.pdf) for more details). For example, to define a half-normal distribution of \mathcal{N}(0,1), you can use the following code

```
Input.Marginals(1).Bounds = [0 +inf];
Input.Marginals(1).Type = 'Gaussian';
Input.Marginals(1).Parameters = [0 1];
myInput = uq_createInput(Input);

```

I hope this can help.
