Re: [R] transition matrices

2007-04-04 Thread Ranjan Maitra
On Wed, 4 Apr 2007 07:46:37 -0500 Ranjan Maitra <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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@stat.math.ethz.ch 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.
> > 
>

__
R-help@stat.math.ethz.ch 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.


Re: [R] transition matrices

2007-04-04 Thread Christos Hatzis
I think what you are looking for is also called seriation or ordination,
i.e. find the "best" enumeration order of a set of objects.

Take a look at the following link for more information and on criteria for
defining "best"

http://www.lirmm.fr/~caraux/PermutMatrix/EN/Seriation.htm

The link is for a windows application (PermutMatrix) that can perform
seriation on distance matrices used in hierarchical clustering, but might be
useful in your context as well.

-Christos

Christos Hatzis, Ph.D.
Nuvera Biosciences, Inc.
400 West Cummings Park
Suite 5350
Woburn, MA 01801
Tel: 781-938-3830
www.nuverabio.com
 
  

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Richard Rowe
> Sent: Wednesday, April 04, 2007 2:35 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] transition matrices
> 
> 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@stat.math.ethz.ch 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.
> 
>

__
R-help@stat.math.ethz.ch 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.


Re: [R] transition matrices

2007-04-04 Thread hadley wickham
Hi Richard,

You might want to have a look at Bertin's reorderable matrices, which
seem to be solving a similar problem.  Googling for bertin reorderable
matrix gives a few automatic implementations.

Hadley

On 4/4/07, Richard Rowe <[EMAIL PROTECTED]> 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@stat.math.ethz.ch 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.
>

__
R-help@stat.math.ethz.ch 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.


Re: [R] transition matrices

2007-04-04 Thread Ranjan Maitra
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. 

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 <[EMAIL PROTECTED]> 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@stat.math.ethz.ch 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.
>

__
R-help@stat.math.ethz.ch 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.


[R] transition matrices

2007-04-04 Thread Richard Rowe
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@stat.math.ethz.ch 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.