What's the octave equivalent of eig(X, 'nobalance')

烂漫一生 提交于 2019-12-06 11:24:36

If your goal is to compute the equilibrium distribution of a Markov chain, take a look at the mcStatDist function implementation from the PMTK3 toolbox. It shows four different ways to compute the result. Example:

TR = rand(3,3);                          %# random transition matrix
TR = bsxfun(@rdivide, TR, sum(TR,2));    %# normalize so that rows sum to one

[V,D] = eig(TR');                        %'# eigen-decomposition
EQ = V(:,1) ./ sum(V(:,1));              %# state equilibrium distribution

As noted in the comments of the linked code, this method can be numerically unstable for some cases, so you might want to consider one of the other options...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!