Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

methods.rhohat

Methods for Intensity Functions of Spatial Covariate


Description

These are methods for the class "rhohat".

Usage

## S3 method for class 'rhohat'
print(x, ...)

## S3 method for class 'rhohat'
plot(x, ..., do.rug=TRUE)

## S3 method for class 'rhohat'
predict(object, ..., relative=FALSE,
             what=c("rho", "lo", "hi", "se"))

## S3 method for class 'rhohat'
simulate(object, nsim=1, ..., drop=TRUE)

Arguments

x,object

An object of class "rhohat" representing a smoothed estimate of the intensity function of a point process.

...

Arguments passed to other methods.

do.rug

Logical value indicating whether to plot the observed values of the covariate as a rug plot along the horizontal axis.

relative

Logical value indicating whether to compute the estimated point process intensity (relative=FALSE) or the relative risk (relative=TRUE) in the case of a relative risk estimate.

nsim

Number of simulations to be generated.

drop

Logical value indicating what to do when nsim=1. If drop=TRUE (the default), a point pattern is returned. If drop=FALSE, a list of length 1 containing a point pattern is returned.

what

Optional character string (partially matched) specifying which value should be calculated: either the function estimate (what="rho", the default), the lower or upper end of the confidence interval (what="lo" or what="hi") or the standard error (what="se").

Details

These functions are methods for the generic commands print, plot, predict and simulate for the class "rhohat".

An object of class "rhohat" is an estimate of the intensity of a point process, as a function of a given spatial covariate. See rhohat.

The method plot.rhohat displays the estimated function rho using plot.fv, and optionally adds a rug plot of the observed values of the covariate.

The method predict.rhohat computes a pixel image of the intensity rho(Z(u)) at each spatial location u, where Z is the spatial covariate.

The method simulate.rhohat invokes predict.rhohat to determine the predicted intensity, and then simulates a Poisson point process with this intensity.

Value

For predict.rhohat the value is a pixel image (object of class "im" or "linim"). For simulate.rhohat the value is a point pattern (object of class "ppp" or "lpp"). For other functions, the value is NULL.

Author(s)

See Also

Examples

X <-  rpoispp(function(x,y){exp(3+3*x)})
  rho <- rhohat(X, function(x,y){x})
  rho
  plot(rho)
  Y <- predict(rho)
  plot(Y)
  plot(simulate(rho), add=TRUE)
  # 
  fit <- ppm(X, ~x)
  rho <- rhohat(fit, "y")
  opa <- par(mfrow=c(1,2))
  plot(predict(rho))
  plot(predict(rho, relative=TRUE))
  par(opa)
  plot(predict(rho, what="se"))

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.