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.
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.
Hi, I would like to fit the derivative of a histogram (positive peak) using the skewed Gaussian. Since the distribution is not normalized, I think I should account for the amplitude for better description of the distribution. But I dont understand How to do it. Attached is the root file with the histogram and its derivative.
I noticed this implementation doesn’t work for x different than zero. For some reason you cannot just change the mean (parameter [1]) to move the skewed gaussian along the x-axis. Instead, if you add another parameter for the mean it works beautifully. In the implementation below [0] is the amplitude, [1] is sigma, [2] is the skewness and [3] is the mean.
TF1 * f = new TF1("f","2.*gaus(x-[3],[0],0,[1])*ROOT::Math::normal_cdf([2]*(x-[3]),1,0)",-3,10);
f->SetParameters(1,1,4,5);
f->Draw();