Learn R Programming

excursions (version 2.0.6)

excursions: Excursion sets and contour credible regions for latent Gaussian models

Description

excursions is used for calculating excursion sets, contour credible regions, and contour avoiding sets for latent Gaussian models. The latent structure can be handled in several different ways. The default strategy is the EB method, which is exact for problems with Gaussian posterior distributions. For problems with non-Gaussian posteriors, the QC method can be used for improved results. Other more complicated methods for handling non-Gaussian posteriors must be implemented manually unless INLA is used to fit the model. If the model is fitted using INLA, the method excursions.inla can be used.

Usage

excursions(alpha,
           u,
           mu,
           Q,
           type,
           n.iter=10000,
           Q.chol,
           F.limit,
           vars,
           rho,
           reo,
           method='EB',
           ind,
           max.size,
           verbose=0,
           max.threads=0,
           seed,
           LDL=TRUE)

Arguments

alpha
Error probability for the excursion set.
u
Excursion or contour level.
mu
Expectation vector.
Q
Precision matrix.
type
Type of region:
  • '>'
{positive excursion region} '<'< item="">{negative excursion region} '!='{contour avoiding region} '='{contour credibility region}

Value

  • excursions returns an object of class "excurobj". This is a list that contains the following arguments:
  • EExcursion set, contour credible region, or contour avoiding set
  • GContour map set. $G=1$ for all nodes where the $mu > u$.
  • MContour avoiding set. $M=-1$ for all non-significant nodes. $M=0$ for nodes where the process is significantly below u and $M=1$ for all nodes where the field is significantly above u. Which values that should be present depends on what type of set that is calculated.
  • FThe excursion function corresponding to the set E calculated for values up to F.limit
  • rhoMarginal excursion probabilities
  • meanThe mean mu.
  • varsMarginal variances.
  • metaA list containing various information about the calculation.

item

  • n.iter
  • Q.chol
  • F.limit
  • vars
  • rho
  • reo
  • method
  • 'QC'
  • ind
  • max.size
  • verbose
  • max.threads
  • seed
  • LDL

code

alpha

eqn

$P(X>u)$

itemize

  • 'EB'

References

Bolin, D. and Lindgren, F. (2015) Excursion and contour uncertainty regions for latent Gaussian models, JRSS-series B, vol 77, no 1, pp 85-106.

Examples

Run this code
## Create a tridiagonal precision matrix
n = 21
Q.x = sparseMatrix(i=c(1:n, 2:n),
                   j=c(1:n, 1:(n-1)),
                   x=c(rep(1, n), rep(-0.1, n-1)),
                   dims=c(n, n),
                   symmetric=TRUE)

## Set the mean value function
mu.x = seq(-5, 5, length=n)

## calculate the level 0 positive excursion function
res.x = excursions(alpha=1, u=0, mu=mu.x, Q=Q.x, type='>',
                   verbose=1, max.threads=2)

## Plot the excursion function and the marginal excursion probabilities
plot(res.x$F, type="l",
     main='Excursion function (black) and marginal probabilites (red)')
lines(res.x$rho, col=2)

Run the code above in your browser using DataLab