paperKB
coga / coga-kb
Help
Sign in

Chunk #27 — Findings — Improvements in PLINK 1.9 — Other noteworthy algorithms — Partial sum lookup

Source
Second-generation PLINK: rising to the challenge of larger and richer datasets.
Embedded
yes

Text

Then, we need to perform the update \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document} $$A_{jk} := A_{jk} + f_{0}(x_{0}) + f_{1}(x_{1}) + \ldots + f_{19}(x_{19}) $$ \end{document}Ajk:=Ajk+f0(x0)+f1(x1)+…+f19(x19) where the xi’s are bit trios, and the fi’s map them to increments. This could be done with 20 table lookups and floating point addition operations. Or, the update could be restructured as \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document} $$A_{jk} := A_{jk} + f_{\{0-4\}}(x_{\{0-4\}}) + \ldots + f_{\{15-19\}}(x_{\{15-19\}}) $$ \end{document}Ajk:=Ajk+f{0−4}(x{0−4})+…+f{15−19}(x{15−19}) where x{0−4} denotes the lowest-order 15 bits, and f{0−4} maps them directly to f0(x0)+f1(x1)+f2(x2)+f3(x3)+f4(x4); similarly for f{5−9}, f{10−14}, and f{15−19}. In exchange for some precomputation—four tables with 215 entries each; total size 1 MB, which is not onerous for modern L2/L3 caches—this restructuring licenses the use of four table lookups and adds per update instead of twenty. See fill_weights_r() and incr_dists_r() in plink_calc.c for source code.