From 5c6e70346efc6a581a4acbec16d0b228d1bddb82 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 11 Jun 2020 14:33:01 +0200 Subject: [PATCH] gnu: Add r-tmvnsim. * gnu/packages/statistics.scm (r-tmvnsim): New variable. --- gnu/packages/statistics.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 30a0d44392..2a878a44e2 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -5289,6 +5289,35 @@ computations taking place in C++ code, and support for interrupting those comput even in multithreaded code, typically using OpenMP.") (license license:gpl3+))) +(define-public r-tmvnsim + (package + (name "r-tmvnsim") + (version "1.0-2") + (source + (origin + (method url-fetch) + (uri (cran-uri "tmvnsim" version)) + (sha256 + (base32 + "03xsvsg9bqvgl98ywid3h91mmlhax5s6wvmypp3hq91vmc5kvxlp")))) + (properties `((upstream-name . "tmvnsim"))) + (build-system r-build-system) + (native-inputs `(("gfortran" ,gfortran))) + (home-page "https://www.r-project.org") + (synopsis "Truncated multivariate normal simulation") + (description + "This package implements importance sampling from the truncated +multivariate normal using the @dfn{Geweke-Hajivassiliou-Keane} (GHK) +simulator. Unlike Gibbs sampling which can get stuck in one truncation +sub-region depending on initial values, this package allows truncation based +on disjoint regions that are created by truncation of absolute values. The +GHK algorithm uses simple Cholesky transformation followed by recursive +simulation of univariate truncated normals hence there are also no convergence +issues. Importance sample is returned along with sampling weights, based on +which, one can calculate integrals over truncated regions for multivariate +normals.") + (license license:gpl2))) + (define-public r-mnormt (package (name "r-mnormt")