Skip to content

iwasherefirst2/closest-reversible-markov-chain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

What is this?

A matlab script to compute the nearest reversible Markov chain.

For any Markov chain exists according to a given norm and probability vector a unique closest reversible Markov chain. For example, consider the followin Markov chain:

This Markov chain is not reversible. According to the Frobenius norm the closest reversible Markov chain according to

can be computed as

If we choose the probability vector as

then the closest reversible Markov chain according to the Frobenius norm is approximately given by

For the full theory check out the paper or the Wikipedia article

How to use it?

Go with Matlab in the folder where you have saved the file getClosestSparse.m.

Assume you have a NxN dimensonal Markov chain A and a N-dimensional probability vector m then you can compute the closest reversible NxN dimensonal Markov chain U according to the Frobenius-Norm with the command

U = getClosestSparse(A,m)

If you want that A and U have similar rare events (this implies that they have similar eigenvalues, see the above mentioned paper) then you can compute the closest reversible NxN dimensonal Markov chain U according to a special weighted norm with the command

U = getClosestSparse(A,m,1)

Note that the computation of the Markov chain U according to a special weighted norm is only usable if m has no zero entries. For the closest reversible Markov chain U according to the Frobenius-Norm zero entries are allowed.

About

A matlab script to compute the nearest reversible Markov chain

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages