cond_cov: Compute the conditional covariances of two-way MANOVA random...

View source: R/cond_norm.R

cond_covR Documentation

Compute the conditional covariances 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 covariance matrices of (alpha[i], beta[i1], ..., beta[iJ]) conditional on the observed data for each i.

Usage

cond_cov(init_covs, data, flat_sire = FALSE)

Arguments

init_covs

A list of prior covariance matrices with entries named ind, dam and sire indicating the between-individuals, between-dams and between-sires covariances,

data

An object inheriting halfsibdata

flat_sire

A logical indicating whether a flat prior should be used for the sire effect.

Value

A closure that takes the following arguments:

  • i: The name of sire

  • j, k: The name of dam, or "group"

The closure function returns the posterior covariance between the random effects beta[ij] and beta[ik]. If j == "group", returns the posterior covariance of alpha[i] and beta[ik]. and similarly if j == "group".


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