mmer
when MORE than 1 variance component needs to be estimated through the use of the average information (MAI) algorithm and the MVM argument is set to TRUE.
MAI2(Y,X=NULL,ZETA=NULL,init=NULL,maxcyc=20,tol=1e-3, tolparinv=1e-6, draw=TRUE, silent=FALSE, constraint=FALSE,EIGEND=FALSE,forced=NULL)
10 x tol
the algorithm
finishes. If each component of the change proposed by the
Newton-Raphson is lower in magnitude than tol
the algorithm
finishes. Default value is 1e-4
..
y = Xb + Zu + e
.
b ~ N[b.hat, 0] ............zero variance because is a fixed term
u ~ N[0, K*sigma(u)] .......where: K*sigma(u) = G
e ~ N[0, I*sigma(e)] .......where: I*sigma(e) = R
y ~ N[Xb, var(Zu+e)] ......where;
var(y) = var(Zu+e) = ZGZ+R = V which is the phenotypic variance
.
The function allows the user to specify the incidence matrices with their respective variance-covariance matrix in a 2 level list structure. For example imagine a mixed model with the following design:
.
fixed = only intercept.....................b ~ N[b.hat, 0]
random = GCA1 + GCA2 + SCA.................u ~ N[0, G]
.
where G is:
.
|K*sigma(gca1).....................0..........................0.........| |.............0.............S*sigma(gca2).....................0.........| = G
|.............0....................0......................W*sigma(sca)..|
.
The likelihood function optimized in this algorithm is:
.
logL = -0.5 * (log( | V | ) + log( | X'VX | ) + y'Py
.
where: | | refers to the derminant of a matrix
.
Tunnicliffe W. 1989. On the use of marginal likelihood in time series model estimation. JRSS 51(1):15-27.
Covarrubias-Pazaran G (2016) Genome assisted prediction of quantitative traits using the R package sommer. PLoS ONE 11(6): doi:10.1371/journal.pone.0156744
mmer
and mmer2
####=========================================####
#### For CRAN time limitations most lines in the
#### examples are silenced with one '#' mark,
#### remove them and run the examples
####=========================================####
data(CPdata)
CPpheno <- CPdata$pheno
CPgeno <- CPdata$geno
### look at the data
head(CPpheno)
CPgeno[1:5,1:5]
## fit a model including additive and dominance effects
Y <- CPpheno
Za <- diag(dim(Y)[1])
A <- A.mat(CPgeno) # additive relationship matrix
####================####
#### ADDITIVE MODEL ####
####================####
ETA.A <- list(add=list(Z=Za,K=A))
#ans.A <- MAI2(Y=Y, ZETA=ETA.A)
#ans.A$var.comp
Run the code above in your browser using DataLab