Imputes the variants in a specified group, conditional on other variants, based on the recombination model. This is intented for use a subroutine of the conditional randomization test.

impute_variant_fast(x, p1, p2, group, d, fb_result = NULL,
  lambda = 0.012, epsilon = 1e-08, window_size = 200)

Arguments

x

0-1 vector of length p. The observed haplotypes of the offspring.

p1

0-1 vector of length p. One of the parental haplotypes giving rise to x.

p2

0-1 vector of length p. The other parental haplotypes giving rise to x.

group

a subset of indices of 1:p. This subset of variants will be imputed.

d

numeric vector of length p. The genetic distance between variants

lambda

the recombination rate, in units of the vector d

epsilon

the pointwise mutation rate

window_size

when imputing the variants, look only at a window of this size surrounding the group g. A smaller window size leads to faster computation and avoids numerical issues.

Value

A vector of the same length as group containing the imputed variants.