tmvrnorm.RSM: '"tmvrnorm"' Sampler for '"RSM"' (Rejection Sampling from the...

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

View source: R/lineqGPsamplers.R

Description

Sampler for truncated multivariate normal distributions via RSM according to (Maatouk and Bay, 2017).

Usage

1
2
## S3 method for class 'RSM'
tmvrnorm(object, nsim, control = NULL, ...)

Arguments

object

an object with "RSM" S3 class containing: mu (mean vector), Sigma (covariance matrix), lb (lower bound vector), ub (upper bound vector).

nsim

an integer corresponding to the number of simulations.

control

extra parameters required for the MC/MCMC sampler.

...

further arguments passed to or from other methods.

Value

A matrix with the simulated samples. Samples are indexed by columns.

Author(s)

A. F. Lopez-Lopera.

References

Maatouk, H. and Bay, X. (2017), "Gaussian process emulators for computer experiments with inequality constraints". Mathematical Geosciences, 49(5):557-582. [link]

See Also

tmvrnorm.HMC, tmvrnorm.ExpT

Examples

1
2
3
4
5
6
7
8
9
n <- 100
x <- seq(0, 1, length = n)
Sigma <- kernCompute(x1 = x, type = "gaussian", par = c(1,0.2))
tmgPar <- list(mu = rep(0,n), Sigma = Sigma + 1e-9*diag(n), lb = rep(-1,n), ub = rep(1,n))
class(tmgPar) <- "RSM"
y <- tmvrnorm(tmgPar, nsim = 10)
matplot(x, y, type = 'l', ylim = c(-1,1),
        main = "Constrained samples using RSM")
abline(h = c(-1,1), lty = 2)

lineqGPR documentation built on Jan. 11, 2020, 9:23 a.m.