Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimise p(I=2|z=0) term a little more #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void Kinship::addGenotypes(int *gt_arr, float p)
_n11 += 2 * p * q; ///2ppq + 2qqp = 2pq(p+q) = 2pq == Hij
_n10 += 4 * p * q * (p * p + q * q); ///4pppq + 4qqqp = 4pq(pp + qq)

_n20 += p * p * p * p + q * q * q * q + 4 * q * q * p * p; ///pppp + qqqq + 4ppqq
_n20 += p * p * p * p + q * q * q + 2 * p * q; /// p^4 + q^4 + 4p^2q^2 = p^4 + q^4 + 2pq^2 + 2qp^2 = p^4 + q^4 + 2pq(p+q) = p^4 + q^4 + 2pq
_n21 += p * p + q * q; ///ppp + qqq + ppq + pqq = pp(p+q) + qq(q+p) = pp + qq
_n22 += 1;
_af.push_back(p);
Expand Down