R/RcppExports.R

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Get n prime numbers
#' @param n the number of prime numbers to get, starting from 3
#' @export getPrimes
getPrimes <- function(n) {
    .Call('halton_getPrimes', PACKAGE = 'halton', n)
}

#' Generate a halton sequence from a base number
#' @param H the length of the halton sequnce
#' @param prime the base number used to construct the Halton sequence, defaults to 3
#' @param burn the number of elements to "burn" from the beginning of the halton sequence, defualts to 30
#' @export hseq
hseq <- function(H, prime = 3L, burn = 30L) {
    .Call('halton_hseq', PACKAGE = 'halton', H, prime, burn)
}

#' Generate uniformly distributed numbers using a Halton sequence
#' @param H the length of the halton sequnce
#' @param min the lower bound of the distribution
#' @param max the upper bound of the distribution
#' @param prime the base number used to construct the Halton sequence, defaults to 3
#' @param burn the number of elements to "burn" from the beginning of the halton sequence, defualts to 30
#' @export hunif
hunif <- function(H, min = 0, max = 1, prime = 3L, burn = 30L) {
    .Call('halton_hunif', PACKAGE = 'halton', H, min, max, prime, burn)
}

#' Simulate draws from a normal distribution using a halton sequence
#' @param H the length of the halton sequnce
#' @param mean the mean of the normal distribution
#' @param sd the standard deviation of the normal distribution
#' @param prime the base number used to construct the Halton sequence, defaults to 3
#' @param burn the number of elements to "burn" from the beginning of the halton sequence, defualts to 30
#' @export hnorm
hnorm <- function(H, mean = 0.0, sd = 1.0, prime = 3L, burn = 30L) {
    .Call('halton_hnorm', PACKAGE = 'halton', H, mean, sd, prime, burn)
}

#' Simulate draws from a gamma distribution using a halton sequence
#' @param H the length of the halton sequnce
#' @param shape the shape parameter of the gamma distribution
#' @param scale the scale parameter of the gamma distribution
#' @param prime the base number used to construct the Halton sequence, defaults to 3
#' @param burn the number of elements to "burn" from the beginning of the halton sequence, defualts to 30
#' @export hgamma
hgamma <- function(H, shape = 0, scale = 1, prime = 3L, burn = 30L) {
    .Call('halton_hgamma', PACKAGE = 'halton', H, shape, scale, prime, burn)
}

#' Simulate draws from a Log-Normal distribution using a halton sequence
#' @param H the length of the halton sequnce
#' @param mean the mean of the distribution
#' @param sd the standard deviation of the distribution
#' @param prime the base number used to construct the Halton sequence, defaults to 3
#' @param burn the number of elements to "burn" from the beginning of the halton sequence, defualts to 30
#' @export hlnorm
hlnorm <- function(H, mean = 0.5, sd = 0.25, prime = 3L, burn = 30L) {
    .Call('halton_hlnorm', PACKAGE = 'halton', H, mean, sd, prime, burn)
}

#' Multivariate normal inversion.
#' @param H the length of the halton sequnce
#' @param means the mean of the distribution
#' @param sigma the covariance matrix
#' @export mvhnormInv
mvhnormInv <- function(H, means, sigma, burn = 30L) {
    .Call('halton_mvhnormInv', PACKAGE = 'halton', H, means, sigma, burn)
}

#' Multivariate normal.
#' @param H the length of the halton sequnce
#' @param means the mean of the distribution
#' @param sigma the covariance matrix
#' @export mvhnorm
mvhnorm <- function(H, means, sigma, burn = 30L) {
    .Call('halton_mvhnorm', PACKAGE = 'halton', H, means, sigma, burn)
}

# Register entry points for exported C++ functions
methods::setLoadAction(function(ns) {
    .Call('halton_RcppExport_registerCCallable', PACKAGE = 'halton')
})
bamonroe/halton documentation built on May 11, 2019, 6:19 p.m.