0

Functions in spatstat are mainly made for 2-3-dim data analysis. Is there a good possibility to apply them to one-dim data?

  • There is huge capability for class ppp in 2-dim.
  • There is a very general class ppx for arbitrary dimensions - but this is the problem - only very few functions are available.
  • Can I take a sledgehammer to crack a nut in inflating one-dim data to two-dim one and in the end projecting back to one-dim?
  • Or should I better rewrite functions for one-dim (rpoispp, rmpoispp, ...)?
David
  • 15,894
  • 22
  • 55
  • 66
  • maybe all you need to do is `mat1d <- matrix(my.vector,nrow=1)`, or alternatively `dim(my.vector)<-c(1,length(my.vector))` – Carl Witthoft May 01 '14 at 11:26
  • Thank you. But it's not a question of transforming a vector into a one-dim matrix. To produce an object of class `ppp` one needs two vectors. – John Snider May 01 '14 at 13:24

1 Answers1

0

It all depends on which analysis you are doing. In general I would not recommend inflating one-dim data to two-dim data.

As you state the class ppx is general, but doesn't have many functions implemented for it yet. If you just need to simulate an unmarked Poisson point process in 1-dim you can use rpoisppx.

To have more functions available one solution could be to represent your data as a point pattern on a linear network (class lpp). Here is a crude example representing a section of 1-dim space as a line in the unit square and simulating a Poisson process on the line with intensity 10:

X <- ppp(x=c(0,1), y=c(.5,.5), window=square(1))
L <- linnet(X, edges=matrix(1:2,1,2))
Y <- rpoislpp(10, L)
Ege Rubak
  • 4,347
  • 1
  • 10
  • 18
  • Very nice! I changed the model by defining an object of `lpp`: `X` as above then `L <- linnet(ppp(x=c(0,1), y=c(.5,.5), window=square(1)), edges=matrix(1:2,1,2))` and to the end `lpp(X, L)` – John Snider Jun 17 '14 at 14:52