R/RcppExports.R

# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' @title Sample from multivariate normal distribution with C++
#' @description Simulates realizations from a multivariate normal with mean mu and covariance matrix sigma.
#' @param n number of simulations.
#' @param mu mean vector.
#' @param sigma covariance matrix or Cholesky decomposition of the matrix (see chol).
#' @param chol integer, if 0 sigma is a covariance matrix, otherwise it is the Cholesky decomposition of the matrix.
#' @return A matrix of size \eqn{d x n} containing the samples.
#' @export
mvrnormArma <- function(n, mu, sigma, chol) {
    .Call('ConservativeEstimates_mvrnormArma', PACKAGE = 'ConservativeEstimates', n, mu, sigma, chol)
}

#' @title Sample from truncated multivariate normal distribution with C++
#' @description Simulates realizations from a truncated multivariate normal with mean mu, covariance matrix sigma in the bounds lower upper.
#' @param n number of simulations.
#' @param mu mean vector.
#' @param sigma covariance matrix.
#' @param lower vector of lower bounds.
#' @param upper vector of upper bounds.
#' @param verb level of verbosity: if lower than 3 nothing, 3 minimal, 4 extended.
#' @return A matrix of size \eqn{d x n} containing the samples.
#' @references Horrace, W. C. (2005). Some results on the multivariate truncated normal distribution. Journal of Multivariate Analysis, 94(1):209--221.
#'
#' Robert, C. P. (1995). Simulation of truncated normal variables. Statistics and Computing, 5(2):121--125.
#' @export
trmvrnorm_rej_cpp <- function(n, mu, sigma, lower, upper, verb) {
    .Call('ConservativeEstimates_trmvrnorm_rej_cpp', PACKAGE = 'ConservativeEstimates', n, mu, sigma, lower, upper, verb)
}
dazzimonti/ConservativeEstimates documentation built on May 15, 2019, 1:19 a.m.