[R-sig-ME] Resume terminated lmer fit if verbose=TRUE?
Mike Lawrence
Mike.Lawrence at dal.ca
Thu Jul 28 03:50:11 CEST 2011
I think I figured out how to resume a terminated fit, but I receive a
warning when the second fit completes, so I thought I'd post my work
here. To simplify, let's say I have the model:
y ~ (1|rand) + A*B
Where A and B are continuous numeric variables. The verbose=TRUE
output from lmer should look something like:
0: 826.14130: 1.07781 -6.28068 2.56251 1.44230 0.399600
where:
the "0:" labels the iteration
the "826.14130:" reports the fit statistic (I think?)
the "1.07781" reports an estimate of the standard deviation of the
random effect "rand"
the "-6.28068" reports an estimate of the global intercept
the "2.56251" reports an estimate of the slope of the A effect
the "1.44230" reports an estimate of the slope of the B effect
and the "0.399600" reports an estimate of the slope of the A:B interaction
One can store the last 5 values (all the estimates) in a vector called
"from_verbose" and then construct a list as follows:
to_start = list(
ST = list(
matrix(from_verbose[1],1,1)
)
, fixef = from_verbose[2:length(from_verbose)]
)
dimnames(to_start$ST[[1]]) = list('(Intercept)','(Intercept)')
names(to_start$fixef) = c('(Intercept)','a','b','a:b')
Now one can use "to_start" as the value of the start argument, as in:
fit = lmer(
formula = y ~ (1|rand) + a*b
, start = to_start
)
When I do this and additionally set verbose=TRUE on the resumed fit, I
indeed see that it picks off where where the terminated fit left off.
However, when the resumed fit finishes, I get the warning:
In sort(names(start)) == sort(names(FL)) :
longer object length is not a multiple of shorter object length
Should I be concerned about this warning?
More information about the R-sig-mixed-models
mailing list