zsegarray {hwep} | R Documentation |
Zygote segregation distributions.
Description
Obtains offspring genotype probabilities given parental probabilities, the ploidy of the species, and the overdispersion parameter, for all possible parental genotypes.
Usage
zsegarray(alpha, ploidy)
Arguments
alpha |
A numeric vector containing the double reduction parameter(s).
This should be a
vector of length |
ploidy |
The ploidy of the species. This should be an even positive integer. |
Value
An array of probabilities. Element (i, j, k) contains the probability of offspring dosage k-1 given parental dosages i-1 and j-1.
Author(s)
David Gerard
Examples
ploidy <- 10
alpha <- c(0.5, 0.1)
p1 <- 4
p2 <- 3
segarray <- zsegarray(alpha = alpha, ploidy = ploidy)
graphics::plot(x = 0:10,
y = segarray[p1 + 1, p2 + 1, ],
type = "h",
ylab = "Pr(dosage)",
xlab = "dosage")
graphics::mtext(paste0("P1 dosage = ",
p1,
", ",
"P2 dosage = ",
p2))
[Package hwep version 2.0.2 Index]