title: Restart mixed effect model estimation with previously estimated values
body: <p>I'm using <code>lmer()</code> in package <code>lme4</code> to estimate mixed effects models.  This works well, but now I want to run the estimation process for a fixed number of iterations, then resume the process by specifying start values, as calculated by the last estimation process.</p>
  
  <p>According to the help for <code>?lmer</code> this is possible, by setting the arguments:</p>
  
  <ul>
  <li><code>start</code> - these are the new start values, and according to the help one can extract the value in slot <code>ST</code> from a fitted model and use these, i.e. use <code>x@ST</code></li>
  <li><code>maxiter</code> - supplied as a named argument to <code>control</code></li>
  </ul>
  
  <p>So, for example, suppose I want to fit a <code>lme</code> using the <code>iris</code> data, one can try this:</p>
  
  <pre><code>library(lme4)
  
  # Fit model with limited number of iterations
  
  frm &lt;- "Sepal.Length ~ Sepal.Width | Species"
  
  x &lt;- lmer(frm, data=iris, 
            verbose=TRUE, control=list(maxIter=1), model=FALSE)
  
  # Capture starting values for next set of iterations
  start &lt;- list(ST=x@ST)
  
  # Update model
  twoStep &lt;-  lmer(frm, data=iris, 
            verbose=TRUE, control=list(maxIter=100), model=TRUE, 
            start=start)
  </code></pre>
  
  <p>This works.  Take a look at the output, where the <strong>first column</strong> is the REML, i.e. the random effect maximum likelihood.  Notice especially that the REML in model 2 starts where model 1 terminates:</p>
  
  <pre><code>&gt; x &lt;- lmer(frm, data=iris, 
  +           verbose=TRUE, control=list(maxIter=1), model=FALSE)
    0:     264.60572: 0.230940 0.0747853  0.00000
    1:     204.22878: 0.518239  1.01025 0.205835
    1:     204.22878: 0.518239  1.01025 0.205835
  
  &gt; # Capture starting values for next set of iterations
  &gt; start &lt;- list(ST=x@ST)
  
  &gt; # Update model
  &gt; twoStep &lt;-  lmer(frm, data=iris, 
  +           verbose=TRUE, control=list(maxIter=100), model=TRUE, 
  +           start=start)
    0:     204.22878: 0.518239  1.01025 0.205835
    1:     201.51667: 0.610272  2.00277 0.286049
    2:     201.46706: 0.849203  1.94906 0.358809
    3:     201.44614: 0.932371  1.88581 0.482423
    4:     201.39421:  1.00909  1.71078 0.871824
    5:     201.36543:  1.00643  1.60453  1.01663
    6:     201.31066:  1.00208  1.35520  1.27524
    7:     201.28458:  1.08227  1.22335  1.35147
    8:     201.24330:  1.50333 0.679759  1.31698
    9:     201.11881:  1.95760 0.329767 0.936047
  </code></pre>
  
  <p>However, when I have a different value of <code>maxIters</code> this no longer works:</p>
  
  <pre><code>x &lt;- lmer(frm, data=iris, 
            verbose=TRUE, control=list(maxIter=3), model=FALSE)
  start &lt;- list(ST=x@ST)
  twoStep &lt;-  lmer(frm, data=iris, 
                   verbose=TRUE, control=list(maxIter=100), model=TRUE, 
                   start=start)
  </code></pre>
  
  <p>Notice that <strong>the REML value restarts at 264</strong>, i.e. the beginning:</p>
  
  <pre><code>&gt; x &lt;- lmer(frm, data=iris, 
  +           verbose=TRUE, control=list(maxIter=3), model=FALSE)
    0:     264.60572: 0.230940 0.0747853  0.00000
    1:     204.22878: 0.518238  1.01025 0.205835
    2:     201.94075:  0.00000  1.51757 -1.18259
    3:     201.71473:  0.00000  1.69036 -1.89803
    3:     201.71473:  0.00000  1.69036 -1.89803
  
  &gt; # Capture starting values for next set of iterations
  &gt; start &lt;- list(ST=x@ST)
  
  &gt; # Update model
  &gt; twoStep &lt;-  lmer(frm, data=iris, 
  +           verbose=TRUE, control=list(maxIter=100), model=TRUE, 
  +           start=start)
    0:     264.60572: 0.230940 0.0747853  0.00000
    1:     204.22878: 0.518238  1.01025 0.205835
    2:     201.94075:  0.00000  1.51757 -1.18259
    3:     201.71473:  0.00000  1.69036 -1.89803
    4:     201.64641:  0.00000  1.82159 -2.44144
    5:     201.63698:  0.00000  1.88282 -2.69497
    6:     201.63649:  0.00000  1.89924 -2.76298
    7:     201.63649: 4.22291e-08  1.90086 -2.76969
    8:     201.63649: 4.22291e-08  1.90086 -2.76969
  </code></pre>
  
  <hr>
  
  <p><strong>Question: How can I reliably restart <code>lmer()</code> with start values obtained from a previously fitted model?</strong></p>
  
  <hr>
  
  <p>Session information:</p>
  
  <pre><code>packageVersion("lme4")
  [1] ‘0.999999.2’
  </code></pre>