checkThat: Check arguments of the call to ars.

Description Usage Arguments Value

View source: R/modular_functions.R

Description

checkThat performs tests and checks to ensure functionality of the adaptive rejection sampling algorithm. For example, if no starting values are supplied, checkThat will determine viable starting values for the initialization step.

Usage

1
checkThat(f, f_params, starting_values, sample_size, supp)

Arguments

f

A function quosure representing the target sampling distribution.

f_params

A list of any associated parameters of f.

starting_values

The initial values for the k abscissae. If NULL, values will be determined using the bounds of the log-distribution where the first derivative is positive.

sample_size

The desired number of samples in the final output.

supp

The support of the sampling density.

Value

if all checks pass, a named list is returned containing an expression for the density function, the initial abscissae values, and the support of the density which may be determined by the function if no initial values were supplied.


bsearchinger/ARS documentation built on Dec. 19, 2021, 12:44 p.m.