Description Usage Arguments Value Author(s) References See Also Examples
View source: R/lineqGPsamplers.R
Sampler for truncated multivariate normal distributions
via exponential tilting using the package TruncatedNormal
(Botev, 2017).
1 2 |
object |
an object with |
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. |
A matrix with the simulated samples. Samples are indexed by columns.
A. F. Lopez-Lopera.
Botev, Z. I. (2017), "The normal law under linear restrictions: simulation and estimation via minimax tilting". Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(1):125-148. [link]
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) <- "ExpT"
y <- tmvrnorm(tmgPar, nsim = 10)
matplot(x, y, type = 'l', ylim = c(-1,1),
main = "Constrained samples using expontial tilting")
abline(h = c(-1,1), lty = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.