alltypes              package:spatstat              R Documentation

_C_a_l_c_u_l_a_t_e _S_t_a_t_i_s_t_i_c _f_o_r _A_l_l _T_y_p_e_s _i_n _a _M_u_l_t_i_t_y_p_e _P_o_i_n_t _P_a_t_t_e_r_n

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

     Given a marked point pattern, this computes the estimates of a
     selected summary function (F,G, J or K) of the pattern, for all
     possible combinations of marks. It returns these functions in a
     list (an object of class `"fasp"') amenable to plotting by
     `plot.fasp()'.

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

       alltypes(pp, fun="K",dataname=NULL,verb=F)

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

      pp: The observed point pattern, for which summary function
          estimates are required.  An object of class `"ppp"'. If the
          pattern is not marked, the resulting ``array'' is 1 x 1. 

     fun: Character string indicating the summary function required. 
          Must be one of the letters `"F"', `"G"', `"J"', `"K"'. 

dataname: Character string giving an optional (alternative) name to the
          point pattern, different from what is given in the call. 
          This name, if supplied, may be used by `plot.fasp()' in
          forming the title of the plot. If not supplied it defaults to
          the parsing of the argument supplied as `pp' in the call. 

    verb: Logical value, meaning ``verbose''.  If verb is true then
          terse ``progress reports'' (just the values of the mark
          indices) are printed out when the calculations for that
          combination of marks are completed.  

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

     This routine is a convenient way to analyse the dependence between
     types in a multitype point pattern. Suppose that the points have
     possible types 1,2,...,m and let X[i] denote the pattern of points
     of type i only. If `fun="F"' then this routine calculates, for
     each possible type i, an estimate of the Empty Space Function
     F_i(r) of X[i]. If `fun' is `"G"', `"J"' or `"K"', the routine
     calculates, for each pair of types (i,j), an estimate of the
     cross-type function G[i,j](r), J[i,j](r) or K[i,j](r) respectively
     describing the dependence between  X[i] and X[j].

     The real work is done by the functions `Fest', `Gest', `Kest',
     `Jest', `Gcross', `Kcross', and `Jcross'. One of the first four
     functions (according to `fun') is invoked if the two marks under
     consideration are equal.  The latter three are invoked if the
     marks are distinct. (There is no `Fcross'; for the empty space
     function F(r) there is no cross-type version.)

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

     A function array (an object of class `"fasp"', see `fasp.object').
     This can be plotted using `plot.fasp'.

     If `fun="F"', the function array has dimensions n * 1 where m is
     the number of different marks in the point pattern. The entry at
     position `[i,1]' in this array is the result of applying `Fest' to
     the points of type `i' only.

     If `fun' is `"G"', `"J"' or `"K"',  the function array has
     dimensions m * m. The `[i,j]' entry of the function array (for i
     != j) is the result of applying the function `Gcross', `Jcross' or
     `Kcross' to the pair of types `(i,j)'. The diagonal `[i,i]' entry
     of the function array is the result of applying the univariate
     function `Gest', `Jest' or `Kest' to the points of type `i' only.

     Each function entry `fns[[i]]' retains the format of the output of
     the relevant estimating routine `Fest', `Gest', `Jest', `Kest', 
     `Gcross', `Jcross', or `Kcross'.

     The default formulae for plotting these functions are 
     `cbind(km,theo) ~ r' for F, G, and J, and `cbind(border,theo) ~ r'
     for K.

_N_o_t_e:

     Sizeable amounts of memory may be needed during the calculation.

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

     Adrian Baddeley adrian@maths.uwa.edu.au <URL:
     http://www.maths.uwa.edu.au/~adrian/> and Rolf Turner
     rolf@math.unb.ca <URL: http://www.math.unb.ca/~rolf>

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

     `plot.fasp', `fasp.object', `allstats', `Fest', `Gest', `Jest',
     `Kest', `Gcross', `Jcross', `Kcross'

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

        library(spatstat)
        # bramblecanes (3 marks).
        data(bramblecanes)

        X.F <- alltypes(bramblecanes,fun="F",verb=T)
        plot(X.F) 
        X.G <- alltypes(bramblecanes,fun="G",verb=T)
        X.J <- alltypes(bramblecanes,fun="J",verb=T)
        X.K <- alltypes(bramblecanes,fun="K",verb=T)



        # Swedishpines (unmarked).
        data(swedishpines)
        X.F <- alltypes(swedishpines,fun="F")
        X.G <- alltypes(swedishpines,fun="G")
        X.J <- alltypes(swedishpines,fun="J")
        X.K <- alltypes(swedishpines,fun="K")

        # simulated data

        pp <- runifpoint(350, owin(c(0,1),c(0,1)))
        pp$marks <- factor(c(rep(1,50),rep(2,100),rep(3,200)))
        X.F <- alltypes(pp,fun="F",verb=T,dataname="Fake Data")
        X.G <- alltypes(pp,fun="G",verb=T,dataname="Fake Data")
        X.J <- alltypes(pp,fun="J",verb=T,dataname="Fake Data")
        X.K <- alltypes(pp,fun="K",verb=T,dataname="Fake Data")


        # A setting where you might REALLY want to use dataname:

        xxx <- alltypes(ppp(Melvin$x,Melvin$y,
                     window=as.owin(c(5,20,15,50)),marks=clyde),
                     fun="F",verb=T,dataname="Melvin")


