simulate: simulate

Description Usage Arguments Value Examples

View source: R/dataProcessing.R

Description

Simulates HMM data using a given family of distributions, an input number of states, and a transition probability.

Usage

1
2
3
4
5
6
simulate(
  N,
  cnts = c(loh = 10, het = 15),
  switch.prob = 0.1,
  family = "poisson"
)

Arguments

N

Integer value for number of elements to randomly generate

cnts

Named integer vector for mean/lambda value for that state

switch.prob

Numeric value for transition probability (Default=0.1)

family

Family of distributions (Default=poission)

Value

A Dataframe consisting of states and the simulated observations from each state

Examples

1
2
3
set.seed(1234)
simulate(100, cnts=setNames(c(10, 20), c('loh', 'het')), 
         switch.prob=0.05, family='poisson')

quevedor2/WadingPool documentation built on Dec. 22, 2021, 10:59 a.m.