I am trying to fit a generalised least squares model using gls in the nlme
The model seems to fit very well when I plot the fitted values against the
values, and the model parameters have quite narrow confidence intervals
significant at p<5%).
The problem is that the log likelihood is always given as -Inf. This
doesn't seem to make sense because the model seems to fit my data so well.
I have checked that the residuals are stationary using an adf test. I
can't work out whether
- the model really doesn't fit at all
- there is something in my data that stops the implementation of logLik
working correctly (the -Inf value says the calculation hasn't worked)
Possible causes are:
- There are lots of NAs in my data (model and response variables)
- There is some autocorrelation in the data that is not accounted for by
the model (most is accounted for).
But, I've tried recreating the problem using a simpler data set, and have
never found the same problem.