EM.MIM {QTLEMM} | R Documentation |
EM Algorithm for QTL MIM
Description
Expectation-maximization algorithm for QTL multiple interval mapping.
Usage
EM.MIM(
D.matrix,
cp.matrix,
y,
E.vector0 = NULL,
X = NULL,
beta0 = NULL,
variance0 = NULL,
crit = 10^-5,
stop = 1000,
conv = TRUE,
console = TRUE
)
Arguments
D.matrix |
matrix. The design matrix of QTL effects is a g*p matrix, where g is the number of possible QTL genotypes, and p is the number of effects considered in the MIM model. This design matrix can be conveniently generated using the function D.make(). |
cp.matrix |
matrix. The conditional probability matrix is an n*g matrix, where n is the number of individuals, and g is the number of possible genotypes of QTLs. This conditional probability matrix can be easily generated using the function Q.make(). |
y |
vector. A vector with n elements that contain the phenotype values of individuals. |
E.vector0 |
vector. The initial value for QTL effects. The number of elements corresponds to the column dimension of the design matrix. If E.vector0=NULL, the initial value for all effects will be set to 0. |
X |
matrix. The design matrix of the fixed factors except for QTL effects. It is an n*k matrix, where n is the number of individuals, and k is the number of fixed factors. If X=NULL, the matrix will be an n*1 matrix where all elements are 1. |
beta0 |
vector. The initial value for effects of the fixed factors. The number of elements corresponds to the column dimension of the fixed factor design matrix. If beta0=NULL, the initial value will be set to the average of y. |
variance0 |
numeric. The initial value for variance. If variance0=NULL, the initial value will be set to the variance of phenotype values. |
crit |
numeric. The convergence criterion of EM algorithm. The E and M steps will iterate until a convergence criterion is met. It must be a value between 0 and 1. |
stop |
numeric. The stopping criterion of EM algorithm. The E and M steps will halt when the iteration number reaches the stopping criterion, treating the algorithm as having failed to converge. |
conv |
logical. If set to False, it will disregard the failure to converge and output the last result obtained during the EM algorithm before reaching the stopping criterion. |
console |
logical. Determines whether the process of the algorithm will be displayed in the R console or not. |
Value
E.vector |
The QTL effects are calculated by the EM algorithm. |
beta |
The effects of the fixed factors are calculated by the EM algorithm. |
variance |
The error variance is calculated by the EM algorithm. |
PI.matrix |
The posterior probabilities matrix after the process of the EM algorithm. |
log.likelihood |
The log-likelihood value of this model. |
LRT |
The LRT statistic of this model. |
R2 |
The coefficient of determination of this model. This can be used as an estimate of heritability. |
y.hat |
The fitted values of trait values are calculated by the estimated values from the EM algorithm. |
iteration.number |
The iteration number of the EM algorithm. |
References
KAO, C.-H. and Z.-B. ZENG 1997 General formulas for obtaining the maximum likelihood estimates and the asymptotic variance-covariance matrix in QTL mapping when using the EM algorithm. Biometrics 53, 653-665. <doi: 10.2307/2533965.>
KAO, C.-H., Z.-B. ZENG and R. D. TEASDALE 1999 Multiple interval mapping for Quantitative Trait Loci. Genetics 152: 1203-1216. <doi: 10.1093/genetics/152.3.1203>
See Also
Examples
# load the example data
load(system.file("extdata", "exampledata.RDATA", package = "QTLEMM"))
# run and result
D.matrix <- D.make(3, type = "RI", aa = c(1, 3, 2, 3), dd = c(1, 2, 1, 3), ad = c(1, 2, 2, 3))
cp.matrix <- Q.make(QTL, marker, geno, type = "RI", ng = 2)$cp.matrix
result <- EM.MIM(D.matrix, cp.matrix, y)
result$E.vector