Description Usage Arguments Details Value Author(s) See Also Examples
This function allows running Cross Validation using clmm
.
All the formulation is equal to clmm
except for the phenotypes, which
are being passed as a list of equally sized vectors.
The main advantage of the function is that several threads can access the very same
data once assigned, which means that the design matrices only have to be allocated once.
The parallel scaling of this function is almost linear.
1 2 |
y |
list of phenotype vectors |
X |
Fixed effects design matrix of type: |
random |
list of design matrices for random effects - every element of the list represents one random effect and may be of type: |
par_random |
list of options for random effects. If passed, the list must have as many elements as
|
niter |
number of iterations |
burnin |
number of iterations to be discarded as burnin |
verbose |
prints progress to the screen |
scale_e |
scale parameter for the inverse chi-square prior for the residuals |
df_e |
degrees of freedom for the inverse chi-square prior for the residuals |
seed |
seed for the random number generator. If omitted, a seed will be generated based on machine and time |
In C++: For every element of the phenotype list a new instance of an MCMC-object will be created. All the memory allocation needed for running the model is done by the major thread. The function then iterates over all objects and runs the gibbs sampler. This step is parallelized, which means that as many models are being run at the same time as threads available. All MCMC-objects are totally independent from each other, they only share the same design-matrices. Every object has its own random-number generator with its own seed which allows perfectly reproducible results.
List of length(Y)
with elements equal to the output of clmm
Claas Heuer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ### Running a 4-fold cross-validation with one repetition:
## Not run:
# generate random data
rand_data(500,5000)
### compute the list of masked phenotype-vectors for CV
y_CV <- cCV(y,fold=4,reps=1)
### Cross Validation using GBLUP
G.A <- cgrm.A(M,lambda=0.01)
### generate the list of design matrices for clmm
random = list(t(chol(G.A)))
### specify options
par_random = list(list(method="random",scale=var(y)/2,df=5))
### run
fit <- clmm.CV(y_CV,random=random,par_random=par_random,niter=5000,burnin=2500)
### inspect results
str(fit)
### obtain predictions
pred <- get_pred(fit)
### prediction accuracy
get_cor(pred,y_CV,y)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.