Message-ID: <54CEA5D0.4070304@utoronto.ca>
Date: 2015-02-01T22:16:48Z
From: Steve Walker
Subject: lme4@flexLambda Error
In-Reply-To: <14b472bb83b.bbonit@tin.it>
I'm sorry but I couldn't reproduce the error. Could you provide
sessionInfo()? Mine is below.
Steve
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lme4_2.0 Rcpp_0.11.2.1 Matrix_1.1-4 setup_0.0-1
loaded via a namespace (and not attached):
[1] MASS_7.3-33 compiler_3.1.1 grid_3.1.1 lattice_0.20-29
[5] minqa_1.2.3 nlme_3.1-117 nloptr_1.0.0 splines_3.1.1
[9] tools_3.1.1
>
On 2015-02-01 5:03 PM, bbonit at tin.it wrote:
> set.seed(2352)
> nsubj <- 20
> nreps <- 2
> length <- 20
> n <- nsubj*nreps*length
> fr <- expand.grid(
> time=1:length,
> id=factor(1:nsubj),
> rep=factor(1:nreps))
>
> rho <- .8
> sd.b <- 3
> b <- sd.b * as.vector(replicate(nsubj, arima.sim(n=length, model=list(ar=c(rho)))))
> sd.eps <- 1
> beta <- .5
> fr <- within(fr,{
> mu <- beta*time
> y <- mu + model.matrix(~0+as.factor(time):id)%*%b +
> rnorm(n, sd=sd.eps)
> })
>
> m <- flexLmer(y ~ time + ar1d(~(time|id)), data=fr)