I am trying to fit some experimental data which is described by a negative binomial (Polya) distribution. The problem is that the Polya distribution looks like:
with parameters such as:
SPE->SetParameter(0,1.0);
SPE->SetParameter(1,10);
SPE->SetParameter(2,40);
The problem arises because my histograms are (0,1000) in x and so the TMath::Power(a,x) overflows the
limits of a Double_t variable. So I âinf/nanâ propagated to pad errors. Since I am using this distribution with the root fitting routines and the build-in Root TMath functions it is not so simple to change all of the variables to long double.
I am beating my head against this problem to find a solution, but I havenât come up with anything yet. Any ideas wold be great.
I am trying to fit a distribution with negative binomial distribution ( NBD) . It works with small values of ânâ but for large values of ânâ it throws out. I tried using the fit function below but it returns me same values of parameters as given by SetParameter
TF1 * tf2 = new TF1(âtf2â,"[0]*ROOT::Math::negative_binomial_pdf(x,[1],[2])");
tf2->SetParameter(0,2000);// normalization constant
tf2->SetParameter(1,130); // k parameter
tf2->SetParameter(2,55); // mean multiplicity
Earlier I had used
TF1 *fit1 = new TF1(âfit1â,"[0]TMath::Gamma(x+[1])/(TMath::Gamma(x+1)TMath:: Gamma([1]))(TMath::Powe
r(([2]/([2]+[1])),x))(TMath::Power(([1]/([2]+[1])) ,[1]))");
fit1->SetParameter(0,1e5);// normalization constant
fit1->SetParameter(1,130); // k parameter
fit1->SetParameter(2,60); // mean multiplicity
This did not work. It works for small value of ânâ.
Interesting choice of words. Almost have a bit of arrogance. If itâs 6 years old and you donât reply to forums thatâs old , why is it still up? And why did you respond so quickly?
The inquiry was from Scientist from a National lab pertaining to a polya equation .once it was entered it directed us to the question. Honestly i donât think you saw the question. I could be wrong. My question was simply what was the k in the equation.
If you have become bored , overwhelmed, or filled with who because you have mastered root , why not let someone humble answers emails and questions.
Your comment is being used to show students âwhen arrogance go wrongâ
Excuse all typos. Go read the question idiot and answer it.
Bumping one thatâs 6 years old? Ummm
Interesting choice of words. It almost have a bit of arrogance hidden in the words.Question, If itâs 6 years old and you donât reply to forums thatâs old , why is it still up? And why did you respond so quickly?
The inquiry was from Scientist/Physicist , from a National lab pertaining to a polya equation for fitting .We entered the keywords and it directed us to the question to this site. Honestly i donât think you saw the question. I could be wrong. My question was simply what was the( k )in the equation.
If you have become bored , overwhelmed, or filled with ego because you have mastered root , why not let someone humble answers emails and questions.
Your comment is being used to show students âwhen arrogance go wrongâ
Excuse all typos. Go read the question idiot and answer it.
Hi Anthony,
Iâm sorry my quick reply came off as arrogant, it was not my intention.
The thread is still up because we never delete any content that might turn useful. Necro-bumping (not my choice of words) threads is typically discouraged in forums for the reasons explained e.g. at this link.
About your question: my answer was admittedly terse, but the link I provided to the negative_binomial_pdf function documentation should clarify what k represents in the equation. Sometimes links within forum posts do not display correctly in email clients â in case thatâs the source of the misunderstanding, here is the full link: https://root.cern.ch/doc/master/group__PdfFunc.html#ga4a9cab35372227aa21c2de11f625325e. To save you a click, if I understand correctly k represents the number of failures.