A Base R, simple implementation of the No-Underrun Sampler. This package aims to mostly directly implement the algorithm as described by th
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Cleaned up package structure

+36
+2
DESCRIPTION
··· 8 8 written in base R. This implementation attempts to stick very closely 9 9 to the algorithm described in Section 2 and Appendix A of the paper. 10 10 License: MIT + file LICENSE 11 + Imports: 12 + stats 11 13 Suggests: 12 14 matrixStats 13 15 Encoding: UTF-8
+2
NAMESPACE
··· 1 1 # Generated by roxygen2: do not edit by hand 2 2 3 3 export(NURS) 4 + importFrom(stats,rnorm) 5 + importFrom(stats,runif)
+4
R/NURS.R
··· 12 12 #' 13 13 #' @param log_vals orbit 14 14 #' @param log_eps_h log(epsilon) + log(h) 15 + #' 15 16 #' @returns True if Orbit satisfies stopping criterion. 16 17 NURS_stop <- function(log_vals, log_eps_h) { 17 18 max(log_vals[1], log_vals[length(log_vals)]) <= ··· 22 23 #' 23 24 #' @param log_vals sub orbit 24 25 #' @param log_eps_h log(epsilon) + log(h) 26 + #' 25 27 #' @returns True if sub orbit satisfies stopping criterion. 26 28 NURS_sub_stop <- function(log_vals, log_eps_h) { 27 29 n <- length(log_vals) ··· 39 41 #' @param epsilon density threshold 40 42 #' @param h lattice size 41 43 #' @param M maximum number of doublings 44 + #' 42 45 #' @returns next draw 43 46 NURS_step <- function(logpdf, theta, epsilon, h, M) { 44 47 d <- length(theta) ··· 110 113 #' @param epsilon non-negative density threshold 111 114 #' @param h positive lattice size 112 115 #' @param M maximum number of doublings 116 + #' 113 117 #' @returns a sequence of draws 114 118 #' 115 119 #' @export
+8
R/R.NURS-package.R
··· 1 + #' @keywords internal 2 + "_PACKAGE" 3 + 4 + ## usethis namespace: start 5 + #' @importFrom stats rnorm 6 + #' @importFrom stats runif 7 + ## usethis namespace: end 8 + NULL
+2
README.Rmd
··· 20 20 21 21 A Base R, simple implementation of the No-Underrun Sampler. This implementation aims to mostly directly implement the algorithm as described by the paper, with at most small changes for code aesthetics and performance. This version uses the memory saving technique described in section 2.2. 22 22 23 + This code doesn't parallelize the density calculation for orbit extensions but doing so is trivial. 24 + 23 25 ## Installation 24 26 25 27 You can install the development version of R.NURS from [GitHub](https://github.com/) with:
+3
README.md
··· 13 13 and performance. This version uses the memory saving technique described 14 14 in section 2.2. 15 15 16 + This code doesn’t parallelize the density calculation for orbit 17 + extensions but doing so is trivial. 18 + 16 19 ## Installation 17 20 18 21 You can install the development version of R.NURS from
+15
man/R.NURS-package.Rd
··· 1 + % Generated by roxygen2: do not edit by hand 2 + % Please edit documentation in R/R.NURS-package.R 3 + \docType{package} 4 + \name{R.NURS-package} 5 + \alias{R.NURS} 6 + \alias{R.NURS-package} 7 + \title{R.NURS: R Implementation of No-Underrun Sampler} 8 + \description{ 9 + A bare-bones R implementation of the No-Underrun Sampler (Nawaf Bou-Rabee, Bob Carpenter, Sifan Liu, Stefan Oberdörster. 2025.) written in base R. This implementation attempts to stick very closely to the algorithm described in Section 2 and Appendix A of the paper. 10 + } 11 + \author{ 12 + \strong{Maintainer}: Visruth Srimath Kandali \email{public@visruth.com} 13 + 14 + } 15 + \keyword{internal}