knitr::opts_chunk$set(echo = TRUE)

Setup

Load the package

library(rcombinator)

Create the sequences and set the basic parameters.

num_sequences <- 8
num_jumps <- 10^3
burst_threshhold <- 0.1
poisson_mean <- 0.5
sequences <- create_sequence_counts(rep(1, num_sequences),
                                    rep(poisson_mean, num_sequences),
                                    (1:num_sequences))

Simulation

Simulate the various kinds of bursts and plot the appropriate sequence counts over time.

data1 <- simulate_bursts(sequences, num_jumps, burst_threshhold, "equal")
p1 <- plot_sequence_counts(data1, "Simulating bursts equally")
print(p1)

data2 <- simulate_bursts(sequences, num_jumps, burst_threshhold, "accumulate")
p2 <- plot_sequence_counts(data2, "Simulating bursts in proportion to existing number of copies")
print(p2)

data3 <- simulate_bursts(sequences, num_jumps, burst_threshhold, "parameters")
p3 <- plot_sequence_counts(data3, "Simulating bursts with respect to a fixed distribution")
print(p3)


sams25/rcombinator_old documentation built on May 28, 2019, 8:40 a.m.