Description Usage Arguments Details Examples
A function of the response vector or matrix (multi-trait case) returning a SPD matrix of conforming dimensions.
1 2 3 4 5 6 7 | default_initial_variance(
x,
dim = 1,
cor.trait = NULL,
cor.effect = 0.1,
digits = NULL
)
|
x |
numeric vector or matrix with the phenotypic observations. Each trait in one column. |
dim |
integer. dimension of the random effect for each trait. Default is 1. |
cor.trait |
a number strictly in (-1, 1). The initial value for the correlation across traits. Default is NULL, which makes the function to take the value from the data. See Details. |
cor.effect |
a number strictly in (0, 1). The initial value for the correlation across the different dimensions of the random effect. Default is 0.1. |
digits |
numeric. If not NULL (as default), the resulting matrix is rounded up to 2 significant digits. |
The default initial covariance matrix across traits is computed as half the
empirical covariance kronecker times a Positive-Definite matrix with Compound
Symmetry Structure with a constant diagonal with value 1 and constant
off-diagonal elements with the positive value given by cor.effect
,
i.e.
Σ = Var(x)/2 \%*\% ψ(dim).
This implies that the default
initial correlations across traits equal the empirical correlations,
except if cor.trait
is not NULL
.
ψ(dim) is intended to model correlated random effects within
traits, and only has an effect when dim
> 1.
If any column in x
is constant (i.e. empirical variance of 0) then the
function stops. It is better to remove this trait from the analysis.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.