markov chain matlab,Classify Markov chain states

Identify the communicating classes of a Markov chain. Then, determine whether the classes are recurrent and their periodicity.

Generate a random seven-state Markov chain. Specify that 40 random elements in the transition matrix should be zero.

rng(1); % For reproducibility

mc = mcmix(7,'Zeros',40);

Plot a directed graph of the Markov chain. Visually identify the communicating class to which each state belongs by using node colors.

figure;

graphplot(mc,'ColorNodes',true)

d62a81e8c34e83736d0a2421e26557d1.png

Identify the communicating classes in mc, and then determine:

The communicating class to which each state belongs

Whether each communicating class is recurrent

The period of each class

[bins,ClassStates,ClassRecurrence,ClassPeriod] = classify(mc)

bins = 1×7

6 4 6 3 2 5 1

ClassStates=1×6 cell array

{["7"]} {["5"]} {["4"]} {["2"]} {["6"]} {["1" "3"]}

ClassRecurrence = 1x6 logical array

0 0 0 0 0 1

ClassPeriod = 1×6

1 1 1 1 1 2

mc has seven classes. Each state is its own communicating class, except states 1 and 3, which together compose class 6. Class 6 is the only recurrent class; classes 1 through 5 are transient. Class 6 has period 2; all other classes are aperiodic.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值