Returns the result of the forward backward algorithm for a sepcified group. Intended for use as a pre-computation step for the linear_crt function.

get_fb_results(H, H_parent, anc, group, d, lambda = 0.012,
  epsilon = 1e-08, window_size = 200)

Arguments

H

an (n x p) matrix of the subject haplotypes

H_parent

and (n_2 x p) matrix of the parental haplotypes

anc

a (n x 2) table of ancestries. anc[i, 1] and and[i, 2] give the rows of H_parent corresponding to the parents of subject i

group

a list of of indices of the group to test. Should be a continuous region, such as 10:20.

d

a vector of length p giving the genetic distances between sites

lambda

the recombination rate, in units of d

epsilon

the pointwise mutation rate

window_size

the number of sites to on each size of the group to use when computing the forward-backward probabilities. Smaller groups improve speed and avoid numerical issues.

Value

a (n x 3) matrix giving the results of the forward-backward algorithm. See the documentation of the forward_backward_ function for output information.