Re: [R] ARCH LM test for univariant time series

2008-02-06 Thread Pfaff, Bernhard Dr.
Graves [mailto:[EMAIL PROTECTED] >Gesendet: Mittwoch, 6. Februar 2008 05:02 >An: Pfaff, Bernhard Dr. >Cc: tom soyer; r-help@r-project.org >Betreff: Re: AW: [R] ARCH LM test for univariant time series > >Dear Bernhard: > > Thanks very much. Unless you object, I shall add

Re: [R] ARCH LM test for univariant time series

2008-02-05 Thread Spencer Graves
Dear Bernhard: Thanks very much. Unless you object, I shall add it to the 'FinTS' library as "ArchTest" (comparable to the S-PLUS Finmetrics 'archTest' function) -- with a worked example in '\scripts\ch03.R'. Best Wishes, Spencer Pfaff, Bernhard Dr. wrote: > Dear All, > >

Re: [R] ARCH LM test for univariant time series

2008-02-04 Thread tom soyer
Thanks Bernhard for the beautiful code!! On 2/4/08, Pfaff, Bernhard Dr. <[EMAIL PROTECTED]> wrote: > > Dear All, > > > one can visually inspect ARCH-effects by plotting acf/pacf of the > squared residuals from an OLS-estimation. This can be as simple as a > demeaned series. Further one can run an

Re: [R] ARCH LM test for univariant time series

2008-02-04 Thread Pfaff, Bernhard Dr.
Dear All, one can visually inspect ARCH-effects by plotting acf/pacf of the squared residuals from an OLS-estimation. This can be as simple as a demeaned series. Further one can run an auxiliary regression by regressing q lagged squared values and a constant on the squared series itself. This tes

Re: [R] ARCH LM test for univariant time series

2008-02-02 Thread Spencer Graves
tom soyer wrote: > Spencer, > > The warning message is sent from VAR, it basically lets you know that the > data it used had no column names and it had to supply them using y1, y2, y3, > etc. It can be suppressed by including options(warn=-1) in the function. > > Anyway, it seems that the p

Re: [R] ARCH LM test for univariant time series

2008-02-02 Thread tom soyer
Spencer, The warning message is sent from VAR, it basically lets you know that the data it used had no column names and it had to supply them using y1, y2, y3, etc. It can be suppressed by including options(warn=-1) in the function. Anyway, it seems that the p value from my function does not matc

Re: [R] ARCH LM test for univariant time series

2008-02-02 Thread Spencer Graves
Dear Tom: Your revised function eliminates the discrepancy in the degrees of freedom but is still very different from the numbers reports on Tsay, p. 102: archTest(log(1+as.numeric(m.intc7303)), lag=12) ARCH test (univariate) data: Residual of y1 equation Chi-squared = 13.1483,

Re: [R] ARCH LM test for univariant time series

2008-02-02 Thread tom soyer
OK, it's no good. Here is the result: > data(m.intc7303) > archTest(log(1+as.numeric(m.intc7303)), lags=12) ARCH test (univariate) data: Residual of y1 equation Chi-squared = 13.1483, df = 12, p-value = 0.3584 On 2/2/08, tom soyer <[EMAIL PROTECTED]> wrote: > > Spencer, > > Sorry, I

Re: [R] ARCH LM test for univariant time series

2008-02-02 Thread tom soyer
Spencer, Sorry, I forgot that the default lag in arch is 16. Here is the fix. Can you try it again and see if it gives the correct (or at least similar compared to a true LM test) result? archTest=function(x, lags=12){ #x is a vector require(vars) s=embed(x,lags) y=VAR(s,p=1,type="const") re

Re: [R] ARCH LM test for univariant time series

2008-02-02 Thread Spencer Graves
Dear Tom, Bernhard, Ruey: I can't get that to match Tsay's example, but I have other questions about that. 1. I got the following using Tom's 'archTest' function (below): > archTest(log(1+as.numeric(m.intc7303)), lags=12) ARCH test (univariate) data: Residual of y1 equat

Re: [R] ARCH LM test for univariant time series

2008-02-01 Thread tom soyer
Spencer, how about something like this: archTest=function (x, lags= 16){ #x is a vector require(vars) s=embed(x,lags) y=VAR(s,p=1,type="const") result=arch(y,multi=F)$arch.uni[[1]] return(result) } can you, or maybe Bernhard, check and see whether this function gives the correct result? th

Re: [R] ARCH LM test for univariant time series

2008-02-01 Thread Spencer Graves
Hi, Tom: The 'arch' function in the 'vars' package is supposed to be able to do that. Unfortunately, I was unable to make it work for a univariate series. Bernhard Pfaff, the author of 'vars', said that if I read the code for 'arch', I could easily retrieve the necessary lines and put

[R] ARCH LM test for univariant time series

2008-02-01 Thread tom soyer
Hi, Does anyone know if R has a Lagrange multiplier (LM) test for ARCH effects for univariant time series? Thanks! -- Tom [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help