Estimates the probability of a gamete dosage given the parent dosage
(G
), the parent ploidy (ploidy
), and the double reduction
parameter (alpha
). This is for biallelic loci.
dgamete(x, alpha, G, ploidy, log_p = FALSE)
A vector of numerics in seq(0, ploidy/2)
. The dosage of the
gametes.
A numeric vector containing the double reduction parameter(s).
This should be a
vector of length floor(ploidy/4)
where alpha[i]
is the probability of exactly i
pairs of IBDR alleles
being in the gamete. Note that sum(alpha)
should be less than
1, as 1 - sum(alpha)
is the probability of no double reduction.
The dosage of the parent. Should be an integer between 0
and ploidy
.
The ploidy of the species. This should be an even positive integer.
A logical. Should we return the log-probability (TRUE
)
or not (FALSE
)? Defaults to FALSE
.
A vector of length length(x)
, containing the (log)
probabilities of a gamete carrying a dosage of x
from a
parent of dosage G
who has ploidy ploidy
and a
double reduction rate alpha
.
dgamete(x = 0:2, alpha = 0, G = 2, ploidy = 4)
#> [1] 0.1666667 0.6666667 0.1666667