magnusdv / forrel

Forensic pedigree analysis and relatedness inference
GNU General Public License v2.0
11 stars 0 forks source link

`exclusionPower` and `founderInbreeding` #37

Closed thoree closed 4 years ago

thoree commented 4 years ago

It appears that founder inbreeding must be specified for the true alternative in exclusionPower as the below example shows. Perhaps a clarification is in place in the documentation

library(forrel)
#> Loading required package: pedtools
claim = nuclearPed(nch = 1, sex = 2)
true = list(singleton(id = 1), singleton(id = 3, sex = 2))
m1 = marker(claim)
claim = setMarkers(claim, m1)
f = 1/16
founderInbreeding(claim, "1") = f
# founderInbreeding(true[[1]], "1") = f # gives correct result.
exclusionPower(claim, true, ids = c(1,3), plot = F, verbose = F)
#> Total EP: 0.125 
#> Markers inconsistent with pedigree: 0  
#> Markers with potential mismatch: 1 (1) 
#> Expected number of mismatches: 0.125
# exclusionPower gives the same result, ep = 0.125, for f < 1
# and ep = 0.625 for f = 1. I get
p = 0.5
(f*p+(1-f)*p^2)*(1-p)^2 + (f*(1-p)+(1-f)*(1-p)^2)*p^2
#> [1] 0.1328125

Created on 2020-06-15 by the reprex package (v0.3.0)

magnusdv commented 4 years ago

This behaviour is by design, since exclusionPower() offers complete freedom in the specification of true and claim.

Both alternatives may have inbred founders (with the same or different coefficients), but this must be set individually for each.

I'd be happy to clarify this in the docs, of course. Do you have a formulation suggestion?

thoree commented 4 years ago

The sentence (in Details) " Both alternatives may have inbred founders (with the same or different coefficients), but this must be set individually for each." would clarify this for me.

Thore

man. 15. jun. 2020 kl. 11:16 skrev Magnus Dehli Vigeland < notifications@github.com>:

This behaviour is by design, since exclusionPower() offers complete freedom in the specification of true and claim.

Both alternatives may have inbred founders (with the same or different coefficients), but this must be set individually for each.

I'd be happy to clarify this in the docs, of course. Do you have a formulation suggestion?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magnusdv/forrel/issues/37#issuecomment-644008818, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSUNB4BGGOMLRYMKGHQ7STRWXRFPANCNFSM4N57AHZQ .