[R] How to compute a P-value for a complex mixture of chi-squared distributions in R

Duncan Murdoch murdoch.duncan at gmail.com
Thu May 22 14:44:25 CEST 2014


On 01/06/2013, 12:26 AM, Tiago V. Pereira wrote:
> Hello, R users!
>
> I am struggling with the following problem:
>
> I need to compute a P-value for a mixture of two chi-squared
> distributions. My P-value is given by:
>
> P = 0.5*prob(sqrt(chi2(1)) <= x) + 0.5*prob(sqrt(chi2(2)) <= x)

Isn't this simply

0.5*pchisq(x^2, df=1) + 0.5*pchisq(x^2, df=2)

?

Duncan Murdoch

>
> In words, I need to compute the p-value for 50–50 mixture of the square
> root of a chi-squared random variable with 1 degree of freedom and the
> square root of a chi-squared with two degrees of freedom.
>
> Although I can quickly simulate data, the P-values I am looking for are at
> the tail of the distribution, that is, alpha levels below 10^-7. Hence,
> simulation is not efficient.
>
> Are you aware of smart approach?
>
>
> All the best,
>
> Tiago
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list