# [R] transition matrices

Ranjan Maitra maitra at iastate.edu
Wed Apr 4 19:48:14 CEST 2007

```On Wed, 4 Apr 2007 07:46:37 -0500 Ranjan Maitra <maitra at iastate.edu> wrote:

> Hi,
>
> It appears that you are trying to separate the states in the transition matrix such that you have recurrent classes all next to each other.

Sorry, I meant non-communicating classes. Btw, thinking about this some more, I think you can do this in a quick and dirty way: convert your transition probability matrix into 0 and 1 which is 0 if the entry is (+)ve. Then, make this into a distance matrix (using as.dist()), use hclust and single linkage and cut the tree at 1(?) to get the equivalence classes. The ordering of the tpm after this is easy.

HTH,
Ranjan

> Here is an idea off the top of my head: make equivalence classes from your statespace and then use that to create a block diagonal matrix. I did a search on equivalence classes on RSiteSearch and came up with 17 articles> You can take a look and see if any of these are useful.
>
> http://search.r-project.org/cgi-bin/namazu.cgi?query=equivalence+classes&max=20&result=normal&sort=score&idxname=Rhelp02a&idxname=functions&idxname=docs
>
> HTH,
> Ranjan
>
>
> On Wed, 04 Apr 2007 16:34:44 +1000 Richard Rowe <richard.rowe at jcu.edu.au> wrote:
>
> > I am working with transition matrices of sequences of animal
> > behaviours.  What I would like to do is parse the original matrices,
> > adjusting row/column order so that the matrix has its main values in blocks
> > surrounding the diagonal.  This would cause behaviours involved in
> > functional groupings (e.g. grooming, resting, foraging etc) to appear as
> > blocks.
> > This can be done manually by applying subjective 'prior knowledge' of
> > sequences, however I would like to have an algorithmic/objective method to
> > generate at least a first cut ...
> > Any suggestions or hints (even just thoughts) would be much appreciated,
> >
> > Richard Rowe
> >
> > Dr Richard Rowe
> > Zoology & Tropical Ecology
> > School of Tropical Biology
> > James Cook University
> > Townsville 4811
> > AUSTRALIA
> >
> > ph +61 7 47 81 4851
> > fax +61 7 47 25 1570
> > JCU has CRICOS Provider Code 00117J
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help