Re: [R] Problem with garchFit function in fSeries

From: Spencer Graves <>
Date: Mon 10 Jul 2006 - 01:48:50 EST

          Without a self-contained example, it's difficult to say for sure. However, this looks to me like false convergence: garchFit uses a nonlinear iteration to try to maximize the likelihood by minimizing (-log(likelihood)). The matrix of second partial derivatives of (-log(likelihood)) provide an approximation to the covariance matrix of the parameter estimates. If it stops before appropriate convergence, some of the diagonal elements of this matrix might be negative. When I listed 'garchFit' just now, I found that the line before the one generating your warning was as follows:

            fit$cvar = solve(fit$hessian)

This seems consistent with what I just said.

          If you want to try to get around this, I suggest you start by focusing on the argument 'control' mentioned on the help page for 'garchFit'. If you follow that through the help pages for 'nlminb' and 'optim', plus possibly 'demo/xmpDWChapter34.R' mentioned in the examples, I believe you will likely find a way to get around that.

          First, however, I suggest you plot the data series and take a careful look at it, if you haven't already.

          Also, you say it worked fine for you with only 1000 of the 1600 observations. Was that observations 1:1000 of this same series? If yes, did you try also observations 601:1600? I just wonder if the data in the last 600 observations behave rather differently from the first 1000?

	  Hope this helps.
	  Spencer Graves

p.s. If you'd like further assistance from the listserve, please submit another post. Before you do, however, I suggest you read the posting guide! "", especially the part about including a simple, self-contained example. I would NOT recommend you include 1600 observations in an email like this. However, with common R download commands, you might be able to describe in a couple of commands how to get the data, then how you subsetted it, etc.

Ivan Kalafatic wrote:
> I used garchFit function to fit 1600 observations of EURO/USD 2-day returns
> in GARCH(1,1) model.
> As part of the summary I got warning message:
> NaNs produced in: sqrt(diag(fit$cvar))
> And didn't get any estimates for 3 params' std.error, t value or
> probability:
> Error Analysis:
> Estimate Std. Error t value Pr(>|t|)
> mu -0.004827 0.020141 -0.240 0.811
> ar1 0.010311 0.026978 0.382 0.702
> omega 0.073813 NA NA NA
> alpha1 0.100000 NA NA NA
> beta1 0.800000 NA NA NA
> When I reduced the sample size to 1000 observations output was ok.
> Can anyone help? What does this mean? What can be the cause of NA values?
> Thank you,
> Ivan
> [[alternative HTML version deleted]]
> ______________________________________________
> mailing list
> PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Mon Jul 10 01:55:48 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 10 Jul 2006 - 04:16:01 EST.

Mailing list information is available at Please read the posting guide before posting to the list.