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
I wonder if there is any tutorial explaining, step by step, how to convert a (georeferenced) map boundary (from esri shape-file) into a Spatstat window, for performing the analysis of marked point patterns surveyed inside that map. Any help on the subject will be really appreciated. Giuseppe Brundu (University of Sassari, Italy)
On Wed, 4 Apr 2007, Giuseppe Brundu wrote:> I wonder if there is any tutorial explaining, step by step, how to convert a > (georeferenced) map boundary (from esri shape-file) into a Spatstat window, > for performing the analysis of marked point patterns surveyed inside that > map. Any help on the subject will be really appreciated.Doing RSiteSearch("shapefile owin") shows that this is possible. The current route is: library(spatstat) library(maptools) your_sp <- readShapePoly("your.shp") your_sp1 <- as(your_sp, "SpatialPolygons") your_owin <- as(your_sp1, "owin") plot(your_owin) pp <- runifpoint(500, your_owin) but you may need extra steps, for example to merge polygons or to remove small polygon artefacts. Other functions in maptools would let you create a ppp object from a SpatialPointsDataFrame, if you need that too. You might also consider looking at the R-sig-Geo list for questions of this kind.> > Giuseppe Brundu > > (University of Sassari, Italy) > > ______________________________________________ > R-help at 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. >-- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no
And what does this have to do with the lead thread subject line "Transition Matrices"? I guess the only way we can start enforcing thread discipline is to stop responding to threads that hijack others? Any thoughts? Ranjan On Wed, 4 Apr 2007 11:31:33 +0200 "Giuseppe Brundu" <gbrundu at tin.it> wrote:> I wonder if there is any tutorial explaining, step by step, how to convert a > (georeferenced) map boundary (from esri shape-file) into a Spatstat window, > for performing the analysis of marked point patterns surveyed inside that > map. Any help on the subject will be really appreciated. > > Giuseppe Brundu > > (University of Sassari, Italy) > > ______________________________________________ > R-help at 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. >
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 <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 > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
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 <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 > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
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: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Richard Rowe > Sent: Wednesday, April 04, 2007 2:35 AM > To: r-help at 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 at 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. > >