spec.pgram bug (PR#2123)

jimmy@econostat.co.uk jimmy@econostat.co.uk
Tue, 8 Oct 2002 15:33:39 +0200 (MET DST)

Full_Name: Jimmy Shadbolt
Version: 1.5.1 and 1.6
OS: linux
Submission from: (NULL) (

The code for spec.pgram contains the following:

    for (i in 1:ncol(x)) {
        for (j in 1:ncol(x)) {
            pgram[, i, j] <- xfft[, i] * Conj(xfft[, j])/(N*xfreq)
    ## value at zero is invalid as mean has been removed, so interpolate
    pgram[1, i, j] <- 0.5*(pgram[2, i, j] + pgram[N, i, j])

Surely the last line should be inside the loops (and apply to all spectra, not
just the last)?

r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch