View source: R/per_marker_kl.R
| per_marker_kl | R Documentation |
Computes, for a single marker model, the expected log10 likelihood ratio
under both hypotheses and the bidirectional Kullback-Leibler divergence
between the joint H1 and H2 distributions over pedigree typings. Drives the
C++ engine introduced in F2 / F3.1; returns the same numerical content as
the internal reference engine to bit-equivalent precision.
Boundary convention follows the reference engine:
P_H1(g) > 0 and P_H2(g) = 0 contribute +Inf to
kl_h1_to_h2 and e_log10_lr_h1.
P_H1(g) = 0 and P_H2(g) > 0 contribute +Inf to
kl_h2_to_h1 and -Inf to e_log10_lr_h2.
States with P_H1 = P_H2 = 0 are skipped (already filtered by the
joint engine).
Under mutation = "none" the H2 distribution typically spans
Mendelian-incompatible states with zero mass under H1, so
kl_h2_to_h1 = +Inf. The abs_cont_violations_* and
mass_violations_* columns quantify how much probability mass falls on
violating states in each direction.
per_marker_kl(model, poi = NULL)
model |
A |
poi |
Optional character scalar naming the person of interest in the
pedigree. When |
A one-row data.frame with columns
Marker identifier (character).
Expected log10(LR) under H1.
Expected log10(LR) under H2.
KL(H1 || H2) in nats.
KL(H2 || H1) in nats.
Number of joint states with positive H2 mass but zero H1 mass (integer).
Number of joint states with positive H1 mass but zero H2 mass (integer).
Total H2 mass on states violating H1 absolute continuity (numeric).
Total H1 mass on states violating H2 absolute continuity (numeric).
Attribute "poi" records the resolved POI identifier.
marker_model(), per_marker_kl_profile().
if (requireNamespace("pedtools", quietly = TRUE)) {
ped <- pedtools::nuclearPed(1)
freqs <- c("a" = 0.3, "b" = 0.5, "c" = 0.2)
mm <- marker_model(ped, "M1", freqs,
mutation = list(model = "equal", rate = 0.005))
per_marker_kl(mm)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.