[R-sig-ME] correlation structure with AR(1)

Ben Bolker bolker at ufl.edu
Fri Sep 4 14:19:34 CEST 2009


FMH wrote:
> Hi,
> 
> Thank you for the advice. In an example from the help menu shown
> below, fm3Dial.gls specify the first value of the autocorrelation
> i.e. 0.771, but after running the script, the new phi occurred which
> was 0.7526038.
> 
> ####################################################################################
> Pinheiro and Bates, pp. 255-258:  use in gls fm1Dial.gls <-  gls(rate
> ~(pressure + I(pressure^2) + I(pressure^3) + I(pressure^4))*QB,
> Dialyzer) fm2Dial.gls <- update(fm1Dial.gls,   weights =
> varPower(form = ~ pressure)) fm3Dial.gls <- update(fm2Dial.gls,
> corr = corAR1(0.771, form = ~ 1 | Subject)) 
> ###################################################################################
> 
> 
> 
> Could you please advice me on the reason of this difference phi?
> 
> Thank you Fir
> 

  Sure.  gls found that the best-fitting phi was 0.752, rather than
0.771.  If you want to keep phi fixed at 0.771  I think you need
... corAR1(0.771,form=~1|Subject,fixed=TRUE) ... See ?corAR1


> ----- Original Message ---- From: Ben Bolker <bolker at ufl.edu> To: FMH
> <kagba2006 at yahoo.com> Cc: "r-sig-mixed-models at r-project.org"
> <r-sig-mixed-models at r-project.org> Sent: Thursday, September 3, 2009
> 5:54:58 PM Subject: Re: [R-sig-ME] correlation structure with AR(1)
> 
> FMH wrote:
>> Dear All,
>> 
>> Could someone please advice me the difference between lme function 
>> with correlation structure of the residual from AR(1) process and 
>> without this correlation structure. I found from the help menu
>> shown below that if we do not declare any value in corAR1, by
>> default, the function will assume there is no autocorrelation i.e.
>> 0.
>> 
>> Does this meant we can just simply ignore the correlation structure
>>  in the model and just use a simple command in lme without
>> including corAR1? Please correct me if i'm wrong.
>> 
>> ###################################################################################
>>  Usage corAR1(value, form, fixed)
>> 
>> Arguments value the value of the lag 1 autocorrelation, which must
>> be between -1 and 1. Defaults to 0 (no autocorrelation). 
>> ###################################################################################
>> 
>> 
> 
> You're a little confused.  What the help page means is that if you 
> simply define a "corAR1" object, it will have its autocorrelation 
> parameter set to zero:
> 
> corAR1()
> 
> However, when you pass corAR1 to the lme function, it fits the 
> autocorrelation parameter (changing it to something other than zero).
>  If you wanted to specify a starting value other than zero for phi,
> then you can specify a value.
> 
> Ben Bolker
> 
> 
> 
> 


-- 
Ben Bolker
Associate professor, Biology Dep't, Univ. of Florida
bolker at ufl.edu / www.zoology.ufl.edu/bolker
GPG key: www.zoology.ufl.edu/bolker/benbolker-publickey.asc




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