Learn R Programming

nntmvn (version 1.3.0)

tmvn_check_converge: Check the convergence of 1st moment with m at selected indices of a TMVN distribution

Description

Check the convergence of 1st moment with m at selected indices of a TMVN distribution

Usage

tmvn_check_converge(
  cens_lb,
  cens_ub,
  covmat = NULL,
  locs = NULL,
  cov_name = NULL,
  cov_parm = NULL,
  m_vec = seq(from = 10, to = 100, by = 10),
  N = 1000,
  ind_test = NULL
)

Value

a matrix summarizing the 1st moments evaluated at increasing m at the selected indices

Arguments

cens_lb

lower bound vector for TMVN of length n

cens_ub

upper bound vector for TMVN of length n

covmat

n-by-n dense covariance matrix, either covmat or locs, cov_name, and cov_parm need to be provided

locs

location matrix n X d

cov_name

covariance function name from the GpGp package

cov_parm

parameters for the covariance function from the GpGp package

m_vec

a vector of m values (int) to be tested

N

the number of samples to generate for each test index and each m to evaluate 1st-order moment

ind_test

a vector of indices indexing the locs where we check the 1st-order moment convergence, by default, 10 random indices are used

Examples

Run this code
library(GpGp)
library(nntmvn)
library(lhs)
library(ggplot2)
set.seed(123)
n <- 500
locs <- lhs::randomLHS(n, 2)
lb <- rep(-Inf, n)
ub <- rep(0, n)

# using covariance matrix
covmat <- GpGp::matern15_isotropic(c(1, 0.1, 0.001), locs)
first_mmt <- tmvn_check_converge(lb, ub, covmat,
  m_vec = seq(from = 10, to = 50, by = 10)
)
plot(first_mmt)

# using locs, cov_name, and cov_parm
cov_name <- "matern15_isotropic"
cov_parm <- c(1, 0.1, 0.001)
first_mmt <- tmvn_check_converge(lb, ub,
  locs = locs, cov_name = cov_name, cov_parm = cov_parm,
  m_vec = seq(from = 10, to = 50, by = 10)
)
plot(first_mmt) + theme(text = element_text(size = 14))

Run the code above in your browser using DataLab