cond_mean: Compute the conditional mean of two-way MANOVA random effects

View source: R/cond_norm.R

cond_meanR Documentation

Compute the conditional mean of two-way MANOVA random effects

Description

Under the model y[ijk] == mu + a[i] + beta[ij] + epsilon[ijk], where each alpha[i], beta[ij] and epsilon[ijk] are independent mean-0, q-dimensional normal random vectors with with covariance matrices Sigma[A], Sigma[B] and Sigma[E] respectively, compute the means of (alpha[i], beta[i1], ..., beta[iJ]) conditional on the observed data for each i.

Usage

cond_mean(init_covs, cond_cov, data, prior_mean = rep(0, data$dims$q))

Arguments

init_covs

A list of prior covariances. Must have an entry $ind.

cond_cov

A function that returns conditional covariance matrices as created by halfsibdesign::cond_cov

data

An object inheriting halfsibdata

prior_mean

A vector of the prior global mean

Value

A list with entries sire and dam whose rows are the posterior means of alpha[i] and beta[ij] respectively.


damian-t-p/halfsibdesign documentation built on March 14, 2023, 4:55 a.m.