1. Introduction
This is a Matlab implementation for the Bayesian genetic sparse factor model proposed in Runcie and Mukherjee (Genetics 2013). This code uses a Gibbs sampler to draw samples from the posterior distribution of a multivariate linear mixed effect model, where the random effects are generally unobserved genetic values (breeding values) with known covariance (ex. based on a pedigree). The focus of the model is on estimating the matrix of genetic (and residual) covariances among traits, called the G-matrix. Download here.
2. A Brief Tutorial
Unzip the downloaded file. To start, make sure the folder "BSF-G/" is in the search path of Matlab. The ``setup.mat" file should be in the current working directory. This file contains:Parameter | description |
Y |
![]() |
X |
![]() |
Z_1 |
![]() |
Z_2 |
![]() |
A |
![]() |
U_act |
![]() ![]() |
E_act |
![]() ![]() |
gen_factor_Lambda |
![]() ![]() |
error_factor_Lambda |
![]() ![]() |
G |
![]() ![]() |
R |
![]() ![]() |
h2s |
![]() ![]() |
factor_h2s |
![]() ![]() |
where
is the number of individuals,
the number of genetic effects (ex. lines or individuals),
is the number of 2nd random effects. Parameters marked with an * are optional. Those marked with a
are necessary if the data is from a simulation and you want to compare to the known values.
The main function is: fast_BSF_G_sampler(). This function reads ``setup.mat", and takes as input prior hyperparameters and various control parameters for the Gibbs sampler. The file ``model_setup.m" is set up to run the analysis for either of the example datasets. Type ``help fast_BSF_G_sampler" for more details.