Skip to contents

Compute genetic variance given betas and LD Cholesky factor.

Usage

compute_s2g(RL, beta)

Arguments

RL

Lower Cholesky factor of the p x p LD matrix for the population.

beta

Genotype effects.

Value

Genetic variance (s2g).

Details

s2g := beta' V beta = beta' L L' beta

Examples

R <- matrix(c(1, 1, 1, 1), nrow = 2, ncol = 2)  # Example LD matrix
beta <- c(1, 2)                                 # Example genotype effects
RL <- get_lower_chol(R)                         # Compute lower Cholesky decomposition
#> Error in chol.default(R): the leading minor of order 2 is not positive
compute_s2g(RL, beta)                            # Compute genetic variance
#> Error: object 'RL' not found