dmc_tp: Transient probabilities of a discrete-time Markov chain

Description Usage Arguments Value See Also Examples

View source: R/dmc_tp.R

Description

dmc_tp can calculate transient probabilities at a specific step, and also can give a graph about transient probabilities from initial step to that specific step. The graph describes transient probabilities in gray levels; zero indicates "white" and one indicates "black".

Usage

1
dmc_tp(MC, time, graph = F)

Arguments

MC

is an object in class 'stat2003.d'

time

an interger, total number of steps that the process will run in this simulation.

graph

Logical. If True the function will also return a graph about transient probabilities, otherwise the function will not return the graph.

Value

dmc_tp returns transient probabilities at a specific step for each state and can also give a graph about transient probabilities from step zero to that specific step.

See Also

stat2003.d-class A class type of discrete-time finite state space Markov chain in stat2003 package.

dmc_simu simulates a discrete-time Markov chain by returning one possible sequence and a states against steps plot.

dmc_equi returns the equilibrium distribution for a discrete-time Markov chain.

dmc_inv returns the invariant distribution for a discrete-time Markov chain.

dmc_irreclass focuses on irreducible classes for a given discrete-time Markov chain.

dmc_period returns the period of each state for a given discrete-time Markov chain.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
m <- matrix(c(0, 1, 0, 0, 0, 0, 0,
              0, 0, 1, 0, 0, 0, 0,
              0, 1/3, 0, 2/3, 0, 0, 0,
              0, 0, 0, 0, 2/3, 1/3, 0,
              0, 2/3, 0, 1/3, 0, 0, 0,
              0, 0, 0, 0, 0, 1/3, 2/3,
              0, 0, 0, 0, 0, 1/4, 3/4), nrow = 7, ncol=7, byrow = TRUE)

A <- new("stat2003.d", p_start = c(1, 0, 0, 0, 0, 0, 0), p = m,
         statespace = c("A", "B", 2 : 6) )

dmc_tp(A, time = 9, graph = TRUE)




m <- matrix(c(1/3, 2/3, 0, 0,
              1, 0, 0, 0,
              1/4, 1/4, 1/4, 1/4,
              0, 0, 1, 0), nrow = 4, ncol=4, byrow = TRUE)
p_start <- c(0,0,0,1)

A <- new("stat2003.d", p_start = c(0, 0, 0, 1), p = m,
         statespace = c("A", "B", "C", "D") )

dmc_tp(A, time = 10, graph = TRUE)

paulnorthrop/stat2003 documentation built on May 24, 2019, 10:31 p.m.