# Q_mu tilde test statistic

Hi All,

I have seen that in the asymptotic calculator you can enable the use of the q_mu tilde by using

``SetQTilde(true);``

This uses the Wald approximations to calculate the relevant test statistic based on the value of mu hat. (Preferred mu value).

I am doing a study where we are not in the asymptotic region and I am using the Frequentist Calculator to throw toy experiments. We have a model which assume the presence of the signal will add events so we need to use the alternative q_mu tilde test statistic for use in upper limits since mu should be >= 0.

Is there any class like the ProfileLikelihoodTestStat class that implements this? Or is it recommended to create my own testStat class?

Thanks a lot!
Rob

I asked our Math expert to look at it.

Hi,

Sorry for the late reply. Yes, the case of upper limit for process where the parameter of interest must be >=0 is supported you use the FrequentistCalculator with the ProfileLikelihoodTestStatistics and you set
ProfileLikelihoodTestStat::SetOneSided(true);

Best Regards

Lorenzo

Hi Lorenzo,

I have been looking at the source code and I am uncertain if setting the oneSided is actually enabling the q_mu tilde test statistic.

Looking through the source code here:
root.cern.ch/doc/master/Profile … ource.html

I see that line 151 correctly gives zero if mu_hat >= mu

What I cannot see is when mu_hat < 0 it should calculate the unconditional using mu = 0. Am I missing something? I say this since q_mu tilde has three conditions, when mu_hat < 0 , when mu_hat is between 0 and mu, and when mu_hat > mu.

I cannot see any checks on mu_hat other than the last condition when the test statistic is set to zero.

Thanks!
Rob

Hi,

Yes this is true. We do not explicitly let the value of mu going to be negative because it can be problematic in some fitting cases. It is preferable in this cases force the fitted value of mu to be always larger than zero and use q_mu. As stated in the paper describing the asymptotic formula, the results are equivalent but it is preferable to use q_mu. We don’t currently have in the RooStats ProfileLikelihoodTestStatistic an implementation for q_mu(tilde) as defined in eq. 16 of the paper.

Best Regards

Lorenzo

Hi,

Great thanks a lot!

I wanted to clarify is it equivalent for asymptotic cases only or also for cases like the frequentist approach? I got the feeling from the asymptotic paper that its preferable to force mu >= 0 and use q_mu since there are certain approximations that can be made in the asymptotic region.

So from what you wrote its safe to force mu >= 0 in the workspace and then use the q_mu from the ProfileLikelihoodTestStat and just set the oneSided to true. This would be equivalent to the q_mu tilde test statistic? Even for non asymptotic cases?

Thanks Cheers,
Rob