R/eblup.mse.f.c2.ai.R

Defines functions eblup.mse.f.c2.ai

Documented in eblup.mse.f.c2.ai

eblup.mse.f.c2.ai <- function(lme.obj, n.i, gamma.i, X.i,...)
{
        var.e <- as.numeric(VarCorr(lme.obj)[,1])[2]
        ## var.v <- as.numeric(VarCorr(lme.obj)[,1])[1]
        ## V.i <- var.e * diag(n.i) + var.v * rep(1,n.i) %*% t(rep(1,n.i))
        ## solve(V.i)#the same indeed
            #7.2.2
        V.i.inv <- 1/var.e * ( diag(n.i) - gamma.i/n.i * rep(1,n.i) %*% t(rep(1,n.i)))
            #7.2.7
        A.i <- t(X.i) %*% V.i.inv %*% X.i
        #class(A.i) <- "eblup.mse.f"
        return(A.i)
    }

Try the JoSAE package in your browser

Any scripts or data that you put into this service are public.

JoSAE documentation built on May 6, 2018, 5:04 p.m.