getMLsoln: Get MLEs for coefficients and variance

View source: R/lmm.R

getMLsolnR Documentation

Get MLEs for coefficients and variance

Description

For a fixed value for hsq, the heritability, calculate the corresponding maximum likelihood estimates of beta and sigmasq, with the latter being the total variance, sigmasq_g + sigmasq_e.

Usage

getMLsoln(hsq, Kva, y, X, reml = TRUE, use_cpp = TRUE)

Arguments

hsq

heritability

Kva

eigenvalues of K (calculated by eigen_rotation())

y

rotated phenotypes (calculated by eigen_rotation())

X

rotated covariate matrix (calculated by eigen_rotation())

reml

If TRUE, use REML; otherwise use ordinary maximum likelihood.

use_cpp

= if TRUE, use c++ version of code

Value

list containing beta and sigmasq, with residual sum of squares and (if reml=TRUE, log det (XSX)) as attributes.

Examples

data(recla)
e <- eigen_rotation(recla$kinship, recla$pheno[,1], recla$covar)
ml <- getMLsoln(0.5, e$Kva, e$y, e$X)

kbroman/lmmlite documentation built on May 10, 2023, 6:05 p.m.