resid.etas: Residuals Analysis and Diagnostics Plots

View source: R/resid.etas.R

resid.etasR Documentation

Residuals Analysis and Diagnostics Plots


A function to compute and plot spatial and temporal residuals as well as transformed times for a fitted ETAS model.


   resid.etas(fit, type="raw", n.temp=1000, dimyx=NULL)



A fitted ETAS model. An object of class "etas".


A character string specifying the type residuals to be computed. Options are "raw" (the default case), "reciprocal" and "pearson".


An integer specifying the number of partition points for temporal residuals.


Dimensions of the discretization for the smoothed spatial residuals. A numeric vector of length 2.


The function computes the temporal residuals

R^{temp}(I_j, h) = ∑_{i=1}^{N} δ_i 1[t_i \in I_j] h(t_i) λ^{temp}(t_i|H_{t_i}) - \int_{I_j} h(t)λ^{temp}(t|H_t) d t

for I_j=((j-1)T/n.temp, jT/n.temp], j=1,...,n.temp, and the (smoothed version of) spatial residuals

R^{spat}(B_j, h) = h(\tilde{x}_i, \tilde{y}_i) λ^{spat}(\tilde{x}_i, \tilde{y}_i)(\tilde{δ}_i - \tilde{w}_i)

for a Berman-Turner quadrature scheme with quadrature points (\tilde{x}_i, \tilde{y}_i) and quadrature weights \tilde{w}_i, i=1,...,n.spat. Raw, reciprocal and Pearson residuals obtain with h=1, h=1/λ and h=1/√{λ}, respectively.

In addition, the function computes transformed times

τ_j=\int_{0}^{t_j} λ^{temp}(t|H_t) d t


U_j = 1 - \exp(-(t_j - t_{j-1}))


The function produces plots of temporal and smoothed spatial residuals, transformed times τ_j against j and Q-Q plot of U_j.

It also returns a list with components

  • tau the transformed times

  • U related quantities with the transformed times

  • tres the temporal residuals

  • sres the smoothed spatial residuals


Abdollah Jalilian


Baddeley A, Rubak E, Turner R (2015). Spatial Point Patterns: Methodology and Applications with R. Chapman and Hall/CRC Press, London.

Baddeley A, Turner R (2000). Practical Maximum Pseudolikelihood for Spatial Point Patterns. Australian & New Zealand Journal of Statistics, 42(3), 283–322. doi: 10.1111/1467-842X.00128.

Baddeley A, Turner R, Moller J, Hazelton M (2005). Residual Analysis for Spatial Point Processes. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(5), 617–666. doi: 10.1111/j.1467-9868.2005.00519.x.

Ogata Y (1988). Statistical Models for Earthquake Occurrences and Residual Analysis for Point Processes. Journal of the American Statistical Association, 83(401), 9–27. doi: 10.2307/2288914.

Zhuang J (2006). Second-order Residual Analysis of Spatiotemporal Point Processes and Applications in Model Evaluation Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(4), 635–653. doi: 10.1111/j.1467-9868.2006.00559.x.

See Also


Examples <- catalog(iran.quakes, time.begin="1973/01/01",
     study.start="1986/01/01", study.end="2016/01/01",
     lat.range=c(26, 40), long.range=c(44, 63), mag.threshold=5)
  ## Not run: 
## End(Not run)

  # setting initial parameter values
  param0 <- c(0.46, 0.23, 0.022, 2.8, 1.12, 0.012, 2.4, 0.35)

  # fitting the model
  ## Not run: <- etas(, param0=param0)

  # diagnostic plots
## End(Not run)

ETAS documentation built on Nov. 28, 2022, 5:23 p.m.