condDist: Obtain the conditional distribution of the states

Description Usage Arguments Value References Examples

Description

Function to calculate the conditional distribution of states given a distribution of initial states.

Usage

1
condDist(trMatrix, initialstate = NULL, steps)

Arguments

trMatrix

Transition matrix of the Markov chain

initialstate

A vector of distribution of the initial states.

steps

The number of steps

Value

A vector of n-step transition probabilities of the states given a distribution of initial states

References

Grimmett, G., & Stirzaker, D. (2001). Probability and Random Processes (3rd ed.). New York: Oxford University Press.

Examples

1
2
3
4
5
6
7
8
egstate <- c("a", "b", "c")
MC <- matrix(data = c(1, 0, 0, 0, 1, 0, 0, 0, 1),
         nrow = 3, byrow = TRUE,
         dimnames = list(egstate, egstate))

initial <- c(0.5,0.5,0)
n <- 5
condDist(MC,initial,n)

ZiqingHo/BasicMC documentation built on May 21, 2019, 2:29 a.m.