msr: Signed or Vector-Valued Measure

View source: R/measures.R

msrR Documentation

Signed or Vector-Valued Measure

Description

Defines an object representing a signed measure or vector-valued measure on a spatial domain.

Usage

  msr(qscheme, discrete, density, check=TRUE)

Arguments

qscheme

A quadrature scheme (object of class "quad" usually extracted from a fitted point process model).

discrete

Vector or matrix containing the values (masses) of the discrete component of the measure, for each of the data points in qscheme.

density

Vector or matrix containing values of the density of the diffuse component of the measure, for each of the quadrature points in qscheme.

check

Logical. Whether to check validity of the arguments.

Details

This function creates an object that represents a signed or vector valued measure on the two-dimensional plane. It is not normally called directly by the user.

A signed measure is a classical mathematical object (Diestel and Uhl, 1977) which can be visualised as a collection of electric charges, positive and/or negative, spread over the plane. Electric charges may be concentrated at specific points (atoms), or spread diffusely over a region.

An object of class "msr" represents a signed (i.e. real-valued) or vector-valued measure in the spatstat package.

Spatial residuals for point process models (Baddeley et al, 2005, 2008) take the form of a real-valued or vector-valued measure. The function residuals.ppm returns an object of class "msr" representing the residual measure. Various other diagnostic tools such as dfbetas.ppm and dffit.ppm also return an object of class "msr".

The function msr would not normally be called directly by the user. It is the low-level creator function that makes an object of class "msr" from raw data.

The first argument qscheme is a quadrature scheme (object of class "quad"). It is typically created by quadscheme or extracted from a fitted point process model using quad.ppm. A quadrature scheme contains both data points and dummy points. The data points of qscheme are used as the locations of the atoms of the measure. All quadrature points (i.e. both data points and dummy points) of qscheme are used as sampling points for the density of the continuous component of the measure.

The argument discrete gives the values of the atomic component of the measure for each data point in qscheme. It should be either a numeric vector with one entry for each data point, or a numeric matrix with one row for each data point.

The argument density gives the values of the density of the diffuse component of the measure, at each quadrature point in qscheme. It should be either a numeric vector with one entry for each quadrature point, or a numeric matrix with one row for each quadrature point.

If both discrete and density are vectors (or one-column matrices) then the result is a signed (real-valued) measure. Otherwise, the result is a vector-valued measure, with the dimension of the vector space being determined by the number of columns in the matrices discrete and/or density. (If one of these is a k-column matrix and the other is a 1-column matrix, then the latter is replicated to k columns).

The class "msr" has methods for print, plot and [. There is also a function Smooth.msr for smoothing a measure.

Value

An object of class "msr".

Guide to using measures

Objects of class "msr", representing measures, are returned by the functions residuals.ppm, dfbetas.ppm, dffit.ppm and possibly by other functions.

There are methods for printing and plotting a measure, along with many other operations, which can be listed by typing methods(class="msr").

The print and summary methods report basic information about a measure, such as the total value of the measure, and the spatial domain on which it is defined.

The plot method displays the measure. It is documented separately in plot.msr.

A measure can be smoothed using Smooth.msr, yielding a pixel image which is sometimes easier to interpret than the plot of the measure itself.

The subset operator [ can be used to restrict the measure to a subregion of space, or to extract one of the scalar components of a vector-valued measure. It is documented separately in [.msr.

The total value of a measure, or the value on a subregion, can be obtained using integral.msr. The value of a measure m on a subregion B can be obtained by integral(m, domain=B) or integral(m[B]). The values of a measure m on each tile of a tessellation A can be obtained by integral(m, domain=A).

Some mathematical operations on measures are supported, such as multiplying a measure by a single number, or adding two measures.

Measures can be separated into components in different ways using as.layered.msr, unstack.msr and split.msr.

Internal components of the data structure of an "msr" object can be extracted using with.msr.

Author(s)

\adrian

References

Baddeley, A., Turner, R., \Moller, J. and Hazelton, M. (2005) Residual analysis for spatial point processes. Journal of the Royal Statistical Society, Series B 67, 617–666.

Baddeley, A., \Moller, J. and Pakes, A.G. (2008) Properties of residuals for spatial point processes. Annals of the Institute of Statistical Mathematics 60, 627–649.

Diestel, J. and Uhl, J.J. Jr (1977) Vector measures. Providence, RI, USA: American Mathematical Society.

Halmos, P.R. (1950) Measure Theory. Van Nostrand.

See Also

plot.msr, Smooth.msr, [.msr, with.msr, split.msr, Ops.msr, measureVariation, measureWeighted, measureContinuous.

Examples

   X <- rpoispp(function(x,y) { exp(3+3*x) })
   fit <- ppm(X, ~x+y)
   
   rp <- residuals(fit, type="pearson")
   rp

   rs <- residuals(fit, type="score")
   rs
   colnames(rs)

   # An equivalent way to construct the Pearson residual measure by hand
   Q <- quad.ppm(fit)
   lambda <- fitted(fit)
   slam <- sqrt(lambda)
   Z <- is.data(Q)
   m <- msr(Q, discrete=1/slam[Z], density = -slam)
   m

spatstat.model documentation built on Sept. 30, 2024, 9:26 a.m.