[R] Having trouble getting GARCH parameters (basic/newbie)

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Dec 10 07:20:04 CET 2007


You are probably using Windows: you didn't say.  If so, this is a known 
bug in the tseries package: it uses Fortran I/O and that fails in Rgui. 
The fix (until the package is updated) is to use Rterm instead.

On Sun, 9 Dec 2007, caffeine wrote:

>
> I'm having no luck getting GARCH parameter estimations.  It seems simple
> enough, but I don't know what I'm doing.  I'm a newbie both at R and GARCH
> models, so whatever is going wrong, it's probably very basic.  Here's what I
> do:
>
> 1. I first load the tseries package with:
>
>   library("tseries")
>
> 2. I then load the data with:
>
>   g <- read.table("test.csv", header=T)
>
> 3. It appears to work because I can print the data (a "hello world" type
> dataset with only 5 datapoints):
>
>   > g
>         Data
>   1 0.002337
>   2 0.010037
>   3 0.007608
>   4 0.005620
>   5 0.006050
>
> 4. Looks good.  So now I try to get the parameters of a fitted GARCH(1,1)
> model:
>
>   > gFit <- garch( g, order=c(1,1) )
>
> Here's where the problem is.  R returns:
>
>   ***** ESTIMATION WITH ANALYTICAL GRADIENT *****
>
> and that's it.  No further output is generated; R just sits there.   My
> dataset had 5000 elements, but R just hung there after printing the above
> message.   So I cut the dataset down to 100 elements, and then down to just
> 5 elements.
>
> I'm pretty sure 5 elements should be a snap for R; I think the estimation
> would be done in seconds, so something is definitely wrong.
>
> Help?
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list