lfa {lfa}R Documentation

Logistic factor analysis

Description

Fit a factor model of dimension d for binomial data. Returns logistic factors.

Usage

lfa(X, d, adjustments = NULL, override = FALSE, safety = FALSE)

Arguments

X

a matrix of SNP genotypes, i.e. an integer matrix of 0's, 1's, and 2's. Sparse matrices of class Matrix are not supported (yet).

d

number of logistic factors, including the intercept

adjustments

a matrix of adjustment variables to hold fixed during estimation.

override

optional boolean to bypass Lanczos bidiagonalization SVD. Usually not advised unless encountering a bug in the SVD code.

safety

optional boolean to bypass checks on the genotype matrices, which require a non-trivial amount of computation.

Details

This function performs logistic factor analysis on SNP data. As it stands, we follow the convention where d=1 is intercept only, and for d>1 we compute d-1 singular vectors and postpend the intercept.

Value

matrix of logistic factors, with the intercept at the end.

Note

Genotype matrix is expected to be a matrix of integers with values 0, 1, and 2. Note that the coding of the SNPs does not affect the algorithm.

Examples

LF <- lfa(hgdp_subset, 4)
dim(LF)
head(LF)

[Package lfa version 1.22.0 Index]