sampleEnv: Sample from the Rejection Envelope

Description Usage Arguments Value

View source: R/modular_functions.R

Description

sampleEnv samples from the rejection envelope formed by the piecewise upper hull for the given function

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sampleEnv(
  n,
  x_abs,
  f,
  f_params = NULL,
  supp = c(-Inf, Inf),
  z = NULL,
  hx = NULL,
  dhdx = NULL
)

Arguments

n

The number of samples

x_abs

A numeric vector of length k for k > 1, representing the abscissae.

f

A function representing the target sampling distribution.

f_params

A list of any associated parameters of f.

supp

The support of f, as a two-membered numeric vector. Default is c(-Inf, Inf)

z

The tangent intersection points at given abscissae.

hx

The log of the density f at point x

dhdx

The derivative of the log of the density f at point x

Value

A numeric vector containing the sampled values.


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