On 08-Oct-06 Gabor Grothendieck wrote: > And here is one minor improvement (rbind() rather than t(cbind()): > > p <- 1:4/8 > Re(fft(apply(mvfft(rbind(1-p, p, 0 * p[-1] %o% p)), 1, prod), inverse > = TRUE) / (length(p) + 1))
Really nice! Much better than any solution I might have found for myself. It really is worth posting to the list! This all still leaves me with one nagging question in the back of my mind -- Surely this is not the first time someone has tackled the problem (in R) of the distribution of the sum of Bernoulli RVs with unequal probabilities? R Site Search on "Bernoulli" did not seem to throw anything up. (Or maybe they just did it, and didn't think it worth saying anything about--but it's not really trivial). Best wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 094 0861 Date: 08-Oct-06 Time: 14:36:43 ------------------------------ XFMail ------------------------------ ______________________________________________ R-help@stat.math.ethz.ch 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.