Wiki

Clone wiki

ApproxWF / Calculating Transition Matrices (task transmat)

Calculating Transition Matrices (task transmat)

ApproxWF uses the mean transition time approximation to approximate transition matrices for the Wright-Fisher process. To compare these matrices to the full Wright-Fisher matrix or the approximation proposed by Malaspinas et al., ApproxWF allows for these matrices to be printed to a file. This functionality is invoked through the task transmat, followed by the arguments N, :code`s` and optionally :code:`h`(default is h=0.5).

ApproxWF task=transmat N=1000 s=0.1 h=0.5

In addition, the argument gen can be used to print transition matrices over multiple generations (e.g. gen=10 prints the transition matrix over 10 generations).

The prefix of the name of that file can be changed using the argument outName (default is "transmat").

Mean Transition Time Approximation

By default (or when setting type=Ferrer), this will write the transition matrix using the mean transition time approximation using 51 states to a file. The following additional arguments are available:

  • The number of states uses for the approximation is set with the argument nStates.
  • By default, states are distributed using a quadratic grid. To use a uniform grid over the states use the argument uniformStates.
  • The argument gammaThreshold defines the threshold of \(\gamma_s = 2Ns_k(u_2 - u_1)\) above which elements of the transition matrix will be calculated with the approximate formulae for large \(\gamma_s\) rather than through numerical integration. The default value is 10.

Approximation by Malaspinas et al.

To use the approximation proposed by Malaspinas et al. instead of the mean transition time approximation, set the argument type=Malaspinas. For thsi type of transition matrices the following arguments are available:

  • The number of states uses for the approximation is set with the argument nStates.
  • By default, states are distributed using a quadratic grid. To use a uniform grid over the states use the argument uniformStates.

Full Wright-Fisher

To generate transition matrices using the full Wright-Fisher approach, set the argument type=WrightFisher.

Updated