Skip to content
Prev 11853 / 20628 Next

[Lme4-authors] Fixing the level 1 residual variance

On 14-05-02 05:45 PM, Douglas Bates wrote:
This is essentially the same model that is being fitted when one
computes the likelihood profile for the residual variance; that is, the
scaled deviance is computed on the basis of the theta parameters, then
the deviance is computed on the basis of the specified residual variance.

 code from devfun2:

 thpars <- Sv_to_Cv(pars,n=vlist,s=sigma)
 .Call(lmer_Deviance, pp$ptr(), resp$ptr(), thpars)
 sigsq <- sigma^2
 pp$ldL2() - ldW + (resp$wrss() + pp$sqrL(1))/sigsq +
                    n * log(2 * pi * sigsq)

where ldW  is the sum of the log weights (if any)

  Makes sense to me ...