[R] Chi square convolution?

Spencer Graves
Wed, 15 Jun 2005 19:10:36 -0000

Have you considered the "distr" package?

	  Consider the following:

 > library(distr)
 > C1234 <- Chisq(df=1, ncp=2)+Chisq(df=3, ncp=4)
 > # = Chisq(df=1+3, ncp=2+4)
 > q(C1234)(c(.025, .975))
[1]  1.823846 23.435932
 > qchisq(c(.025, .975), 4, 6)
[1]  1.823846 23.435932
 >
 > C12345 <- Chisq(df=1, ncp=2)+3*Chisq(df=4, ncp=5)
Warning message:
Grid for approxfun too wide, increase DefaultNrFFTGridPointsExponent in:
Chisq(df = 1, ncp = 2) + 3 * Chisq(df = 4, ncp = 5)
 > # NOT a standard distribution
 > q(C12345)(c(.025, .975))
[1]  6.562148 68.498397

	  spencer graves

Roy Werkman wrote:

> Hi,
>
> I want to determine the confidence interval on the sum of two sigma's.
> Is there an easy way to do this in R? I guess I have to use some sort of
> chisquare convolution algorithm???
>
> Thanx,
> Roy
>
>