Learn R Programming

smmR (version 1.0.3)

simulate.mmfit: Simulates Markov chains

Description

Simulates sequences from a fitted Markov model.

Usage

# S3 method for mmfit
simulate(object, nsim = 1, seed = NULL, ...)

Arguments

object

An object of class mmfit.

nsim

An integer or vector of integers (for multiple sequences) specifying the length of the sequence(s).

seed

Optional. seed for the random number generator. If no seed is given, then seed is set by using the command set.seed(round(as.numeric(Sys.time())).

...

further arguments passed to or from other methods.

Value

A list of vectors representing the sequences.

Details

If nsim is a single integer then a chain of that length is produced. If nsim is a vector of integers, then length(nsim) sequences are generated with respective lengths.

See Also

mm, fitmm