BagMEN(y,X,it=500,bi=100,bag=0.5,alpha=0.5,wpe=1)
NA
is allowed.
$y = mu + Xb + e$,
where $y$ is the response variable, $mu$ is the intercept, $X$ is the genotypic matrix, $b$ is the effect of an allele substitution and $e$ is the residual term.
This function minimizes the loss:
$l = (e'e)+(w*f'f)+L(A*(b'b)+(1-A)*sum(abs(b))$
Thus minimizing both goodness-of-fit error (e) and out-of-bag prediction error (f), where f can be present (w=1) or absent (w=0). Regression coefficients are updated via coordinate descent. L is computed using variances (VarE/VarB) and A is found through a Metropolis algorithm.
data(tpod)
gen = gen[,seq(1,376,5)]
# Fit BagMEN
fit = BagMEN(y,gen)
cor(y,fit$hat)
Run the code above in your browser using DataLab