[R] Entropy of a Markov chain

Albyn Jones jones at reed.edu
Wed Jul 14 16:37:14 CEST 2010


The transition matrix is a collection of conditional distributions.   
it would seem natural to compute the entropy of the stationary  
distribution.

albyn

Quoting "Wilson, Andrew" <a.wilson at lancaster.ac.uk>:

> Does anyone have any "R" code for computing the entropy of a simple
> first or second order Markov chain, given a transition matrix something
> like the following (or the symbol vector from which it is computed)?
>
>            AGRe      ARIe      CSRe      DIRe      DSCe       eos
> HRMe      SPTe      TOBe
>    AGRe 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000
> 0.0000000 0.0000000 0.0000000
>    ARIe 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000
> 0.0000000 0.0000000 0.0000000
>    CSRe 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000
> 0.0000000 0.0000000 0.0000000
>    DIRe 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000
> 0.0000000 0.0000000 0.0000000
>    DSCe 0.1666667 0.1666667 0.0000000 0.0000000 0.1666667 0.0000000
> 0.1666667 0.1666667 0.1666667
>    eos  0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000
> 0.0000000 0.0000000 0.0000000
>    HRMe 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000
> 0.0000000 0.0000000 0.0000000
>    NMSe 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000
> 0.0000000 0.0000000 0.0000000
>    TOBe 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000
> 0.0000000 0.0000000 0.0000000
>
> [The second order matrix would have column names incorporating both
> prior states - e.g. "SPTe.TOBe".]
>
> I looked around at the various simple entropy functions but couldn't
> find anything for this specific problem - they seem mostly to assume a
> single numerical vector as input.
>
> Many thanks in advance for any help,
>
> Andrew Wilson
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



More information about the R-help mailing list