rIPCP                 package:ecespa                 R Documentation

_S_i_m_u_l_a_t_e _I_n_h_o_m_o_g_e_n_e_o_u_s _P_o_i_s_s_o_n _C_l_u_s_t_e_r _P_r_o_c_e_s_s

_D_e_s_c_r_i_p_t_i_o_n:

     Generate a random point pattern, a simulated realisation of the
     Inhomogeneous Poisson Cluster Process.

_U_s_a_g_e:

     rIPCP(x, lambda = NULL, type = 1, lmax = NULL, win = owin(c(0, 1), c(0, 1)), ...)

_A_r_g_u_m_e_n_t_s:

       x: an object of class ''ecespa.minconfit'', resulting from the
          function 'ipc.estK'. 

  lambda: Optional. Values of the estimated intensity function as a
          pixel image (object of class "im" of 'spatstat') giving the
          intensity values at all locations. 

    type: Type of 'prethining' employed in the simulation. See details. 

    lmax: Optional. Upper bound on the values of lambda. 

     win: Optional. Window of the simulated pattern. 

     ...: Optional. Arguments passed to 'as.im'. 

_D_e_t_a_i_l_s:

     This function simulates the Inhomogeneous Poisson Cluster process
     from an object of class ''ecespa.minconfit'', resulting from
     fitting an IPCP to some 'original' point pattern using the
     function 'ipc.estK'.   Following the approach of Waagepetersen
     (2007), the simulation involves a first step in which an
     homogeneous aggregated pattern  is simulated (from the fitted
     parameters  of the ''ecespa.minconfit'' object, using function
     'rThomas'   of 'spatstat') and a second one in which the
     homogeneous pattern is thinned with a spatially varying thinning
     probability _f (s)_ proportional to the spatially varying
     intensity, i.e. _f (s) = lambda(s) / max[lambda(s)]_. To obtain a
     'final' density similar to that of the original point pattern, a
     "prethinning" must be performed. There are two alternatives. If
     the argument ''type'' is set equal to '1',  the expected number of
     points per cluster (_mu_ parameter of 'rThomas' is thinned as _mu
     <- mu.0 / mean[f(s)]_, where _mu.0_ is the  mean number of points
     per cluster of the original pattern. This alternative produces
     point patterns most similar to the 'original'.  If the argument
     ''type'' is set equal to '2',  the fitted intensity of the Poisson
     process of cluster centres (_kappa_ parameter of 'rThomas', i.e.
     the intensity of 'parent' points) is thinned  as _kappa <- kappa /
     mean[f(s)]_. This alternative produces patterns more uniform than
     the 'original' and it is provided only for experimental purposes.

_V_a_l_u_e:

     A point pattern, with the format of the 'ppp' objects of
     'spatstat'.

_A_u_t_h_o_r(_s):

     Marcelino de la Cruz Rot marcelino.delacruz@upm.es

_R_e_f_e_r_e_n_c_e_s:

     Waagepetersen, R. 2007. An estimating function approach to
     inference for inhomogeneous Neyman-Scott processes. _Biometrics_
     63:252-258.

_S_e_e _A_l_s_o:

     'sim.poissonc' to simulate homogeneous PCP; 'rNeymanScott'  and
     'rThomas' in 'spatstat' are the basis of this function

_E_x_a_m_p_l_e_s:

       ## Not run: 
       
         data(gypsophylous)
       
         plot(gypsophylous) 
         
         ## It 'seems' that the pattern is clustered, so 
         ## fit a Poisson Cluster Process. The limits of integration 
         ## rmin and rmax are setup to 0 and 60, respectively.
         
        cosa.pc2 <- ipc.estK(gypsophylous, r = seq(0, 60, by=0.2))

        ## Create one instance of the fitted PCP:

        pointp <- rIPCP( cosa.pc2)
        
        plot(pointp)
        
        
        
         #####################
         ## Inhomogeneous example

         data(urkiola)

         # get univariate pp
         I.ppp <- split.ppp(urkiola)$birch

         plot(I.ppp)

         #estimate inhomogeneous intensity function
         I.lam <- predict (ppm(I.ppp, ~polynom(x,y,2)), type="trend", ngrid=200)

         # It seems that there is short scale clustering; lets fit an IPCP: 

         I.ki <- ipc.estK(mippp=I.ppp, lambda=I.lam, correction="trans")

         ## Create one instance of the fitted PCP:

         pointpi <- rIPCP( I.ki)
        
         plot(pointpi)
      ## End(Not run)

