calcLL: Calculate log likelihood for a given heritability

View source: R/lmm.R

calcLLR Documentation

Calculate log likelihood for a given heritability

Description

Calculate the log likelihood for a given value of the heritability, hsq.

Usage

calcLL(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

The log likelihood value, with the corresponding estimates of beta and sigmasq included as attributes.

Examples

data(recla)
e <- eigen_rotation(recla$kinship, recla$pheno[,1], recla$covar)
loglik <- calcLL(0.5, e$Kva, e$y, e$X)
many_loglik <- calcLL(seq(0, 1, by=0.1), e$Kva, e$y, e$X)

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