


Whether to print progress of the evolution. Else, a vector of the generation numbers to save. NULL means that no intermediate population will be saved. To make alleles modulus 2 to immitate SNPs. If length 1, the value is reused in creating a vector of length G. Vector of length 1 or G of growth factors (1 correspond to expected constant population size). Alternatively, a numeric vector of length r of mutation probabilities (this will create a stepwise mutation model with r loci divide the mutation probabilities evenly between upwards and downwards mutation). sum(N0) is the size of initial population.Ī mutmodel object created with init_mutmodel. The i'th element is the count of the haplotype H0. The number of loci is the length or number of columns of H0.Ĭount of the H0 haplotypes. Must be a vector or matrix (if more than one initial haplotype). Number of generations to evolve (integer, remember postfix L). ) # S3 method for class 'fwsim' plot ( x, which = 1L. ) # S3 method for class 'fwsim' summary ( object. ) # S3 method for class 'fwsim' print ( x. ) fwsim_fixed ( G, H0, N0, mutmodel, SNP = FALSE, save_generations = NULL, progress = TRUE, trace = FALSE. See init_mutmodel for details.įwsim ( G, H0, N0, mutmodel, alpha = 1.0, SNP = FALSE, save_generations = NULL, progress = TRUE, trace = FALSE, ensure_children = FALSE. It then follows that the sum of the number of haplotypes follows a Poisson(α*M) distribution (as just stated in the previous paragraph) and that n conditionally on N follows a Binomial(N, m/M) as expected. Of children n is Poisson(α*m) distributed independently of other haplotypes. Then we assume that N conditionally on M is Poisson(α*M) distributed for α > 0 ( α > 1 gives expected growth and 0 < α < 1 gives expected decrease).įor each haplotype x occuring m times in the i'th generation, the number

Let M be the population size at generation i and N the population size at generation i + 1. Intermediate generations can be saved in order to study e.g. The population sizes are either fixed (traditional/original Fisher-Wright model) or random Poisson distributed with exponential growth supported. This package provides tools to simulate a population under the Fisher-Wright model with a stepwise neutral mutation process on r loci, where mutations on loci happen independently. In fwsim: Fisher-Wright Population Simulationĭescription Usage Arguments Value Author(s) Examples
