[R-sig-ME] question about gls in nlme

Mark Leeds markleeds2 at gmail.com
Wed May 6 19:57:51 CEST 2015


Hi: I've looked around for a long while and I can't figure out something
about
the gls function in the nlme package. If someone wouldn't mind explaining
it or knows of a good reference ( I have pinheiro and bates but it's 10
states away because I lent it to someone ) that explains the following,
that would be fine also.

Suppose I am estimating a  2 predictor regression model with AR(1) errors.

So, the mode isl y_t = B_0 + B_1*x_t + B2*y_2 +  u_t         t = 1,..... T

where u_t =  phi*u_t-1 + epsilon_t

where var(epsilon_t) is sigma^2.

My first question is:

When one runs the function gls, I can't tell what the residuals represent.
In other words, are they

A) the residuals associated with the transformed regression where the error
term is epsilon_t  with variance(sigma^2).

or

B) the residuals associated with the untransformed model written above
so with covariance matrix V and elements V_ij =   phi^(|j-i| * sigma^2 /
(1-phi^2).

My second question is:

Whether  the result represents A or B, is there a way to use a gls related
 function to convert back and forth between the two  ? Thanks a lot for any
wisdom references etc. I've looked all over and can't find much related to
my question.

The other possible  option is to consider using the systemfit package but I
have a feeling there must be a way to do this using gls.

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list