temporalAtRisk.function: temporalAtRisk.function function

View source: R/temporalAtRiskClassDef.R

temporalAtRisk.functionR Documentation

temporalAtRisk.function function

Description

Create a temporalAtRisk object from a function.

Usage

## S3 method for class ''function''
temporalAtRisk(obj, tlim, xyt = NULL, warn = TRUE, ...)

Arguments

obj

a function accepting single, scalar, numeric argument, t, that returns the temporal intensity for time t

tlim

an integer vector of length 2 giving the time limits of the observation window

xyt

an object of class stppp. If NULL (default) then the function returned is not scaled. Otherwise, the function is scaled so that f(t) = expected number of counts at time t.

warn

Issue a warning if the given temporal intensity treated is treated as 'known'?

...

additional arguments

Details

Note that in the prediction routine, lgcpPredict, and the simulation routine, lgcpSim, time discretisation is achieved using as.integer on both observation times and time limits t_1 and t_2 (which may be stored as non-integer values). The functions that create temporalAtRisk objects therefore return piecewise cconstant step-functions. that can be evaluated for any real t in [t_1,t_2], but with the restriction that mu(t_i) = mu(t_j) whenever as.integer(t_i)==as.integer(t_j).

A temporalAtRisk object may be (1) 'assumed known', corresponding to the default argument xyt=NULL; or (2) scaled to a particular dataset (argument xyt=[stppp object of interest]). In the latter case, in the routines available (temporalAtRisk.numeric and temporalAtRisk.function), the dataset of interest should be referenced, in which case the scaling of mu(t) will be done automatically. Otherwise, for example for simulation purposes, no scaling of mu(t) occurs, and it is assumed that the mu(t) corresponds to the expected number of cases during the unit time interval containnig t.

Value

a function f(t) giving the temporal intensity at time t for integer t in the interval [tlim[1],tlim[2]] of class temporalAtRisk

  1. Brix A, Diggle PJ (2001). Spatiotemporal Prediction for log-Gaussian Cox processes. Journal of the Royal Statistical Society, Series B, 63(4), 823-841.

  2. Diggle P, Rowlingson B, Su T (2005). Point Process Methodology for On-line Spatio-temporal Disease Surveillance. Environmetrics, 16(5), 423-434.

See Also

temporalAtRisk, spatialAtRisk, temporalAtRisk.numeric, constantInTime, constantInTime.numeric, constantInTime.stppp, print.temporalAtRisk, plot.temporalAtRisk


lgcp documentation built on Oct. 3, 2023, 5:08 p.m.