ModelOfDiagnostic {diemr} | R Documentation |
Estimates a diagnostic marker for the state counts of all genomic markers for all individuals. Using the hypothetical, diagnostic marker, calculates individual state counts with respect to their weighted similarity to the diagnostic marker states.
ModelOfDiagnostic(I4, OriginalHI, epsilon = 0.99, verbose = FALSE, ...)
I4 |
a matrix or data.frame with 4 numeric columns representing character state counts for missing data, homozygots for allele 1, heterozygots, and homozygots for allele 2. Individuals in rows. |
OriginalHI |
numeric vector of length equal to number of rows in |
epsilon |
numeric, specifying how much the hypothetical diagnostic markers should
contribute to the likelihood calculations. Must be in |
verbose |
logical or character with path to directory where run diagnostics will be saved. |
... |
parameters to be passed to other functions. |
The OriginalHI
can be calculated with pHetErrOnStateCount
.
Matrix with dimensions of I4.
diem
for utilising the model to determine appropriate marker
polarisation in estimating barriers to geneflow.
# state count matrix
dat <- matrix(c(0, 0, 1, 3, 1, 2, 2, 0, 2, 1, 4, 1), ncol = 4)
# hybrid index calculation, assuming diploid markers
HI <- apply(dat * 2, MARGIN = 1, FUN = pHetErrOnStateCount)[1, ]
# run model of diagnostics, with the weight of the ideal diagnostic marker being 0.8
ModelOfDiagnostic(I4 = dat, OriginalHI = HI, epsilon = 0.8)
# [,1] [,2] [,3] [,4]
# [1,] 0.0 5.4 0.4 0.2
# [2,] 0.0 0.2 0.0 5.6
# [3,] 0.4 4.4 0.8 0.4