gell_like {YEAB}R Documentation

Gellerman-like series

Description

Gellerman-like series

Usage

gell_like(n)

Arguments

n

numeric, a vector of 0 and 1 (see Details)

Details

The algorithm implements a Gellerman-like series based on Herrera, D., & TreviƱo, M. (2015). http://doi.org/10.1371/journal.pone.0136084 The algorithm samples from a binomial distribution and imposes two restrictions

  1. no more than 3 consecutive values of 0s or 1s.

  2. the number of trials 0 or 1 must be the same for a given n.

Value

a numeric vector of randomly distributed 0s and 1s

Examples

set.seed(165)
gell_like(8) # 0 0 1 1 1 0 1 0

[Package YEAB version 1.0.6 Index]