simulation: Markov Chain Simulation

Description Usage Arguments Details Value Author(s) Examples

Description

Simulates discrete markov chain with state space

Usage

1
mc.simulation(pijdef, type, N, initial.state,...)

Arguments

pijdef

The transition probabilities, either in matrix form or a function For now only matrix form, until the infinite case is incorporated

type

Type of markov chain, either 'discrete' or 'continuous'.

N

Number of steps of the markov chain being simulated

initial.state

Initial state that the chain will start from

...

Additional argument for continuous markov chain type.

Details

This function will simulate discrete markov chain for a given transition probability matrix, if the initial state is not specified then it will be randomly generated from the state space.

Value

pijdef

The original transition matrix

simulated.states

N Simulated states based on the transition matrix

Author(s)

Teresa Filshtein <teresa.filshtein@gmail.com>, Ozan Sonmez <osonmez@ucdavis.edu>, Rex Cheung <rccheung@ucdavis.edu>, and Norm Matloff <matloff@cs.ucdavis.edu>

Examples

1
2
t.matrix = t(matrix(c(0.1,0.2,0.7,0.4,0.5,0.1,0,0.4,0.6),3,3))
mc.simulation(t.matrix, "discrete", 100, 1)$simulated.states

SonmezOzan/mc_1.0.3 documentation built on May 9, 2019, 9:57 p.m.