# Half-normal distribution in PCE and Sobol

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.

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 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.

1 Like