How can I find a p-value when dealing with a weighted sum of chi-square distributions?
조회 수: 9 (최근 30일)
이전 댓글 표시
I am working with a test statistic that is distributed as a weighted sum of chi-square distributions. Given a particular value x, how can I find its associated p-value? I believe I can use something like 1-chi2cdf(x,d) when dealing with just one chi-square distribution with d degrees of freedom. But what can I do if I have a weighted sum of chi-square distributions?
댓글 수: 0
채택된 답변
Jeff Miller
2019년 8월 17일
편집: Jeff Miller
2019년 8월 17일
I think you have to work out the distribution of the weighted sum and then check the p value in that. Here is an example, assuming that the different chi-squares in the weighted sum are independent.
cs10 = ChiSq(10); wt10 = 0.7;
cs20 = ChiSq(20); wt20 = 0.3;
x = 25;
cs10p = 1 - cs10.CDF(x);
cs20p = 1 - cs20.CDF(x);
wtavgp = wt10*cs10p + wt20*cs20p; % Here is the weighted average of p values.
[cs10p, cs20p, wtavgp]
ans =
0.0053455 0.20143 0.064171 % Of course the weighted avg of the p's is between the two p's.
% Now look at the distribution of the weighted sum
wtsumdist = Convolution(MultTrans(cs10,wt10),MultTrans(cs20,wt20)); % this is the distribution of the weighted sum
sumdistp = 1 - wtsumdist.CDF(x); % This is the p value in the weighted sum
[cs10p, cs20p, sumdistp]
ans =
0.0053455 0.20143 0.0042652
It might at first be surprising that the p value in the weighted sum distribution is less than the p values in the individual distributions, but this actually makes sense. Imagine that you had 100 identical chi-squares, all with weights 0.01. The weighted sum (i.e., average) would have very low variance relative to the individual chi-squares, and the p value of a score in the upper tail would be tiny in the average compared to what it would be in the individual ones.
Incidentally, I think the right p value would be the weighted average of p's if your test statistic were the weighted mixture of chi-squares:
wtmixdist = Mixture(wt10,cs10,wt20,cs20);
mixdistp = 1 - wtmixdist.CDF(x);
[cs10p, cs20p, mixdistp]
ans =
0.0053455 0.20143 0.064171
By the way, the computations in the example were done with Cupid
추가 답변 (1개)
David Goodmanson
2019년 8월 16일
편집: David Goodmanson
2019년 8월 19일
HI Michael,
Since this is a weighted sum instead of a weighted mixture (as I erroneously assumed), the calculation will be along the lines of what Jeff is saying below.
참고 항목
카테고리
Help Center 및 File Exchange에서 Hypothesis Tests에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!