Constructs genotype x environment interaction (GxE) models where
G is a weighted sum of genetic variants (genetic score) and E is a weighted
sum of environments (environmental score) using the alternating optimization algorithm
by Jolicoeur-Martineau et al. (2017) <arXiv:1703.08111>. Alternating optimization is
an iterative process where the genetic score weights, the environmental score weights,
and the main model parameters are estimated in turn assuming the other parameters to
be constant. This approach has greatly enhanced predictive power over traditional GxE
models which include only a single genetic variant and a single environmental
exposure. Gene x gene interactions (GxG) and environment x environment interactions
(ExE) can be incorporated into the genetic and environmental scores. Any standard
model formula can be used, it doesn't have to be a two-way interaction model.
Although this approach was made for GxE modelling, the genetic score doesn't need to
contain genetic variables and the environmental score doesn't need to contain
environmental variables, therefore this approach is highly flexible.

Constructs genotype x environment interaction (GxE) models where
G is a weighted sum of genetic variants (genetic score) and E is a weighted
sum of environments (environmental score) using the alternating optimization algorithm
by Jolicoeur-Martineau et al. (2017) <arXiv:1703.08111>. This approach has greatly
enhanced predictive power over traditional GxE models which include only a single
genetic variant and a single environmental exposure. Although this approach was
originally made for GxE modelling, it is flexible and does not require the use of
genetic and environmental variables. It can also handle more than 2 latent variables
(rather than just G and E) and 3-way interactions or more. The LEGIT model produces
highly interpretable results and is very parameter-efficient thus it can even be
used with small sample sizes (n < 250).

pROC, foreach, snow, doSNOW, utils, iterators