Learn R Programming

paradox (version 0.7.1)

Sampler1DRfun: Sampler1DRfun Class

Description

Arbitrary sampling from 1D RNG functions from R.

Arguments

Super classes

paradox::Sampler -> paradox::Sampler1D -> Sampler1DRfun

Public fields

rfun

(function()) Random number generator function.

trunc

(logical(1)) TRUE enables naive rejection sampling, so we stay inside of [lower, upper].

Methods

Public methods

Method new()

Creates a new instance of this R6 class.

Usage

Sampler1DRfun$new(param, rfun, trunc = TRUE)

Arguments

param

(Param) Domain / support of the distribution we want to sample from.

rfun

(function()) Random number generator function, e.g. rexp to sample from exponential distribution.

trunc

(logical(1)) TRUE enables naive rejection sampling, so we stay inside of [lower, upper].

Method clone()

The objects of this class are cloneable with this method.

Usage

Sampler1DRfun$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

See Also

Other Sampler: Sampler1DCateg, Sampler1DNormal, Sampler1DUnif, Sampler1D, SamplerHierarchical, SamplerJointIndep, SamplerUnif, Sampler