Skip to contents

Returns non-additive genetic variance for all traits (includes dominance and epistatic genetic variance)

Usage

varN(pop, simParam = NULL, nThreads = NULL)

Arguments

pop

an object of Pop-class

simParam

an object of class SimParam. If NULL, the function uses the object named SP from the global environment.

nThreads

number of threads to use if OpenMP is available. If NULL, the number is obtained from simParam$nThreads.

Value

An nTraits by nTraits matrix of variances and covariances between traits.

Details

This is the variance of total non-additive deviations in pop. Variances and covariances use the population divisor nInd, rather than the sample divisor nInd - 1 (see popVar). Since nd = dd + aa, the variance includes twice the covariance between dominance and additive-by-additive epistatic deviations.

See the Quantitative Genetics article for background theory and its demonstration.

Examples

#Create founder haplotypes
founderPop = quickHaplo(nInd=10, nChr=1, segSites=10)

#Set simulation parameters
SP = SimParam$new(founderPop)
SP$addTraitAD(10, meanDD=0.5)

#Create population
pop = newPop(founderPop, simParam=SP)
varG(pop)
#>          Trait1
#> Trait1 1.037738
varA(pop, simParam=SP)
#>        Trait1
#> Trait1      1
varN(pop, simParam=SP)
#>            Trait1
#> Trait1 0.07474702

SP = SimParam$new(founderPop)
SP$addTraitADE(10, meanDD=0.5, relAA=0.2)

#Create population
pop = newPop(founderPop, simParam=SP)
varG(pop)
#>          Trait1
#> Trait1 1.002675
varA(pop, simParam=SP)
#>        Trait1
#> Trait1      1
varD(pop, simParam=SP)
#>            Trait1
#> Trait1 0.09530971
varAA(pop, simParam=SP)
#>           Trait1
#> Trait1 0.1510963
varN(pop, simParam=SP)
#>          Trait1
#> Trait1 0.233753