Description Usage Arguments Details Value Author(s) References See Also Examples

Extract the “residual process” (cf. Ogata, 1988) of a fitted
point process model specified through the conditional intensity
function, for instance a model of class `"twinSIR"`

or
`"twinstim"`

(and also `"simEpidataCS"`

).
The residuals are defined as the fitted cumulative intensities at the
event times, and are generalized residuals similar to those discussed in
Cox and Snell (1968).

1 2 3 4 5 6 |

`object` |
an object of one of the aforementioned model classes. |

`...` |
unused (argument of the generic). |

For objects of class `twinstim`

, the residuals may already be
stored in the object as component `object$tau`

if the model was
fitted with `cumCIF = TRUE`

(and they always are for
`"simEpidataCS"`

). In this case, the `residuals`

method just extracts these values. Otherwise, the residuals have to
be calculated, which is only possible with access to the model
environment, i.e. `object`

must have been fitted with
`model = TRUE`

. The calculated residuals are then also appended
to `object`

for future use. However, if `cumCIF`

and
`model`

were both set to true in the `object`

fit, then it
is not possible to calculate the residuals and the method returns an
error.

Numeric vector of length the number of events of the corresponding point
process fitted by `object`

. This is the observed residual process.

Sebastian Meyer

Ogata, Y. (1988)
Statistical models for earthquake occurrences and residual analysis
for point processes.
*Journal of the American Statistical Association*, 83, 9-27

Cox, D. R. & Snell, E. J. (1968)
A general definition of residuals.
*Journal of the Royal Statistical Society. Series B (Methodological)*, 30, 248-275

`checkResidualProcess`

to graphically check the
goodness-of-fit of the underlying model.

1 2 3 4 5 | ```
## Load the twinSIR() fit
data("foofit")
residuals(foofit)
## these residuals are, e.g., used by checkResidualProcess()
checkResidualProcess(foofit)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.