swap: Swap elements of single binary chains

Description Usage Arguments Details

Description

swap is used to swap elements of a single binary chain if doing so maintains the same number of transitions between the two states of that chain.

Usage

1
swap(bin_chain, m)

Arguments

bin_chain

A binary one dimensional integer vector.

m

A integer value representing the number of swaps to attempt.

Details

swap takes a one dimensional vector of integers bin_chain and an integer m. It attempts to swap elements of bin_chain m times, each time only completing the swap if it does not affect the number of transitions between states in the sequence.


cwcartmell/maRkov documentation built on May 14, 2019, 1:37 p.m.