  [forwarding back to r-sig-mixed-models]

On 10-09-10 01:37 PM, Qiu, Weiyu wrote:
>
> Thanks Ben, for your suggestion. I find another function "glmmPQL"
> which can do GLMM and change the correlation structure. Your advice
> of using corSymm is very helpful in my case. But now I have another
> question. I've posted it on R list, but no one has replied. I'm
> thinking maybe you could answer this.
>
> I'm using R function "glmmPQL" in "MASS" package for generalized
> linear mixed model considering the temporal correlations in random
> effect. There are 1825 observations in my data, in which the random
> effect is called "Date", and there are five levels in "Date", each
> repeats 365 times.

  Is "Date" essentially a year indicator, with daily samples within each
year?

> When I tried
> fit.model1=glmmPQL(y~f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13+f14+f15+f16+f17+f18+f19+f20+f21+f22+f23+f24,
> family=poisson,random=~1|Date,data=mydata,correlation=corCompSymm(value=0.2,form=~1|Date)),
> the model was fitted well. But because of my particular interest, I
> need to specify the correlation structure by myself, so I tried the
> following code,
> fit.model2=glmmPQL(y~f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13+f14+f15+f16+f17+f18+f19+f20+f21+f22+f23+f24,
>
family=poisson,random=~1|Date,data=mydata,correlation=corSymm(value=B[lower.tri(B)],form=~1|Date)),
> where B is a 365*365 correlation matrix that's specified by me. Then
> there's an error message "Error in vector("double", length) : vector
> size specified is too large". Even I wrote B exactly the same as the
> one used in model1, i.e. diagonal elements 1, off-diagonal elements
> 0.2, the same error message shows.

  The problem is that the value= gives a *starting* value for the
correlation -- it doesn't fix the correlation to be exactly
as you specified.  Therefore,
glmmPQL is trying to estimate an unstructured 365*365 correlation matrix
-- 66430 unique (although not entirely
independent) values. I hope you can see why that might not work.
   If you really want to fit a complex correlation structure that has
many (but fewer than 66430) parameters, you need
to go through the (slightly horrid) step of defining your own
correlation structure.
   You could try complex ARMA structures, which are built into nlme (and
hence into glmmPQL).
   It might also be worth seeing if you can fit a deterministic model
(polynomial, sinusoidal, spline, etc.)
to the seasonal pattern -- then the autoregressive structure would have
less to clean up, and you might be able to
get away with a simple(r) AR[MA] model.

  good luck

    Ben Bolker


	[[alternative HTML version deleted]]


