Clarifying a user defined function (skewed gaussian)

Hi,

I don’t think what provided there is a good implementation. (x<[1]) means that this term is equal to zero when false (x greater than Gaussian mean, parameter [1]) and has value = 1 when is true. Now in that implementation you multiply with a negative term which for some value of x < [1] 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,[0],[1],[2])*ROOT::Math::normal_cdf([3]*x,1,0)",-3,3);
f->SetParameters(1,0,1,4);
f->Draw(); 

Lorenzo

1 Like