TraitSimulation.jl
A Julia module to perform trait simulation.
Installation
TraitSimulation requires Julia 0.6. To install TraitSimulation please type the following code in a Julia REPL:
Pkg.clone("https://github.com/ericsobel/TraitSimulation.jl.git")
Uninstallation
To uninstall TraitSimulation please type the following code in a Julia REPL:
Pkg.rm("TraitSimulation")
Key Features
- Simulate trait under Generalized Linear Model (GLM) or Generalized Linear Mixed Model (GLMM)
- Allow simulation of multiple correlated traits
- Support integration with SnpArrays
- Provide convenient ways to specify the simulation model
When simulating under the GLM, traits are sampled from
Here, is the mean parameter where is the design matrix and the fixed effects, the link function, and the response distribution. Depending on the type of distribution, different distribution-specific parameters are required. For example, simulating a normally distributed trait with identity link requires the variance parameter , i.e. one samples from . To simulate a Poisson distributed trait with log link function, one samples traits from .
Simulating under the GLMM is similar to simulating under the GLM, except that random effects are allowed in , e.g. , in which is the vector of random effects. Typically, is drawn from the normal distribution , where are the variance components. Correlated traits can be simulated by allowing for cross covariances.
Contact
Eric Sobel (esobel [at] ucla [dot] edu)