From sgiannerini at gmail.com  Fri Jan 18 20:22:24 2008
From: sgiannerini at gmail.com (Simone Giannerini)
Date: Fri, 18 Jan 2008 20:22:24 +0100
Subject: [Rd] Bug in pacf -- Proposed patch (PR#10455)
In-Reply-To: <20071123173531.8712F2834156@mail.pubhealth.ku.dk>
References: <20071123173531.8712F2834156@mail.pubhealth.ku.dk>
Message-ID: <3c12769c0801181122p9f6754di7e82eec597e5b3eb@mail.gmail.com>

Dear all,

regarding the bug in pacf
I have prepared a patch (attached) and tested it against the latest R devel

platform
x86_64-unknown-linux-gnu
arch
x86_64
os
linux-gnu
system         x86_64,
linux-gnu
status         Under development
(unstable)
major
2
minor          7.0

year
2008
month
01
day
18
svn rev
44040
language
R
version.string R version 2.7.0 Under development (unstable) (2008-01-18
r44040)


Here I reproduce the example I gave in my previous post to trigger the bug

> set.seed(10)
>
> x <- rnorm(1000,sd=10000)
> y <- rnorm(1000,sd=1)
> pacf(ts(cbind(x,y)),plot=FALSE,lag.max=10)

Partial autocorrelations of series 'ts(cbind(x, y))', by lag

, , x

x            y
 0.049 (  1)  0.002 ( -1)
 0.012 (  2) -0.072 ( -2)
 0.002 (  3)  0.036 ( -3)
 0.014 (  4)  0.013 ( -4)
 0.051 (  5)  0.003 ( -5)
 0.033 (  6) -0.018 ( -6)
 0.027 (  7)  0.069 ( -7)
-0.027 (  8)  0.028 ( -8)
-0.010 (  9) -0.015 ( -9)
-0.013 ( 10) -0.015 (-10)

, , y

x            y
 0.041 (  1) -0.045 (  1)
 0.008 (  2) -0.027 (  2)
-0.056 (  3) -0.030 (  3)
 0.013 (  4) -0.020 (  4)
 0.017 (  5)  0.004 (  5)
-0.021 (  6) -0.010 (  6)
 0.022 (  7)  0.061 (  7)
 0.029 (  8) -0.034 (  8)
-0.014 (  9)  0.031 (  9)
-0.002 ( 10)  0.019 ( 10)

below you can find relevant info and an example where I reproduce Wei's book
results.

http://www2.stat.unibo.it/giannerini/R/pacf.htm

The routine is pure R, on the website there is also a F95 version.
I am willing to write a FORTRAN 77 version of the patch if needed but I
think this might replace the bugged routine temporarily. Let me know.

Thanks for your attention

Simone


On Nov 23, 2007 6:35 PM, <sgiannerini at gmail.com> wrote:
> Dear all,
>
> following the thread
>
> http://tolstoy.newcastle.edu.au/R/e2/devel/07/09/4338.html
>
> regarding the bug in the partial autocorrelation function for
> multivariate time series.
> I have prepared a web page with patches and relevant information.
>
> http://www2.stat.unibo.it/giannerini/R/pacf.htm
>
> Please do not hesitate to contact me for further clarifications
>
> regards
>
> Simone
>
> --
> ______________________________________________________
>
> Simone Giannerini
> Dipartimento di Scienze Statistiche "Paolo Fortunati"
> Universita' di Bologna
> Via delle belle arti 41 - 40126  Bologna,  ITALY
> Tel: +39 051 2098262  Fax: +39 051 232153
> http://www2.stat.unibo.it/giannerini/
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



-- 
______________________________________________________

Simone Giannerini
Dipartimento di Scienze Statistiche "Paolo Fortunati"
Universita' di Bologna
Via delle belle arti 41 - 40126  Bologna,  ITALY
Tel: +39 051 2098262  Fax: +39 051 232153
http://www2.stat.unibo.it/giannerini/
______________________________________________________


[Rd] Bug in pacf -- Proposed patch (PR#10455)
Simone Giannerini