 # Clarifying a user defined function (skewed gaussian)

Hello,

I am trying to figure out how to use a skewed gaussian to fit my data. In the process of searching for how to implement this in root, I came across the following resource that seems relevant, but I am unsure about one thing.

My question:
What does `(x<)` do in the following line?

``````TF1 *sgf = new TF1("sgf","*exp(-0.5*pow((x-)/(+(x<)**(x-)),2))");
``````

Does anyone have a better recommendation of how to implement a skewed gaussian?

Thank you very much for your help!

Perhaps @moneta can help.

1 Like

Hi,

I don’t think what provided there is a good implementation. `(x<)` means that this term is equal to zero when false (x greater than Gaussian mean, parameter ) and has value = 1 when is true. Now in that implementation you multiply with a negative term which for some value of x <  you will get negative sigma.

For the skewed normal I would use the implementation as suggested in https://en.wikipedia.org/wiki/Skew_normal_distribution

``````TF1 * f = new TF1("f","2.*gaus(x,,,)*ROOT::Math::normal_cdf(*x,1,0)",-3,3);
f->SetParameters(1,0,1,4);
f->Draw();
``````

Lorenzo

1 Like

Thank you very much!

Thank you very much for the help!