Pseudo-Realizations for Gaussian Process Excursions

Computes pseudo-realizations from the posterior distribution of a Gaussian Process (GP) with the method described in Azzimonti et al. (2016) . The realizations are obtained from simulations of the field at few well chosen points that minimize the expected distance in measure between the true excursion set of the field and the approximate one. Also implements a R interface for (the main function of) Distance Transform of sampled Functions (<>).

pGPx is a R package to generate pseudo-realizations of Gaussian process excursions sets. The paper Azzimonti et al. (2016) and the manuscript Azzimonti (2016) provide explanations for the problem and the methods.


The package provides approximate posterior realizations over large designs by simulating the field at few well chosen points and interpolating. The simulation points are chosen minimizing the (posterior) expected distance in measure between the approximate excursion set and the full excursion set. The main functions in the package are:

  • optim_dist_measure: computes the optimal simulation points e_1, ... , e_m according to algorithm A or B.

  • krig_weight_GPsimu: Given the simulations points and the interpolation points computes the kriging weights for the approximate process at the interpolation points.

  • grad_kweights: Given the simulations points and the interpolation points returns the gradient of kriging weights with respect to the interpolation points.

  • expDistMeasure: computes the expected distance in measure between the excursion set of the approximated process and the true excursion set.


  • simulate_and_interpolate: Generates nsims approximate posterior field realizations at the interpolation points given the optimized simulation points.


  • Contour length: the function compute_contourLength computes the excursion set contour length for each GP realization.

  • Distance transform: the function dtt_fast computes the distance transform of a binary image (Felzenszwalb and Huttenlocher, 2012) and the function DTV computes the distance transfom variability.

  • Volumes: the function computeVolumes computes the excursion volumes for each GP realization. It also applies a bias correction for approximate realizations.


Azzimonti, D. and Bect, J. and Chevalier, C. and Ginsbourger, D. (2016). Quantifying Uncertainties on Excursion Sets Under a Gaussian Random Field Prior. SIAM/ASA Journal on Uncertainty Quantification, 4(1), 850-874. DOI: 10.1137/141000749. Preprint at arXiv:1501.03659

Azzimonti, D. (2016). Contributions to Bayesian set estimation relying on random field priors. PhD thesis, University of Bern. Available at link

Felzenszwalb, P. F. and Huttenlocher, D. P. (2012). Distance Transforms of Sampled Functions. Theory of Computing, 8(19):415-428.


pGPx 0.1.1

Changes with respect to pGPx 0.1.0

  • fixed a major malloc bug in dt.h

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.1 by Dario Azzimonti, 3 years ago

Browse source code at

Authors: Dario Azzimonti [aut, cre, cph] , Julien Bect [ctb] , Pedro Felzenszwalb [ctb, cph] (Original dt code ,

Documentation:   PDF Manual  

GPL-3 license

Imports Rcpp, DiceKriging, pbivnorm, KrigInv, rgenoud, randtoolbox, pracma, grDevices

Suggests anMC, DiceDesign

Linking to Rcpp, RcppArmadillo

Depended on by profExtrema.

See at CRAN