pseudo_list: Specify a pseudo-target within a given class

View source: R/pseudo_targets.R

pseudo_listR Documentation

Specify a pseudo-target within a given class

Description

Create a list of functions to evaluate a pseudo-target in a given class with supplied parameters (usually location and scale). The distribution is optionally truncated to specified bounds (and renormalized). See Heiner et al. (2026+).

Usage

pseudo_list(family, params, lb = -Inf, ub = Inf, name = NULL)

Arguments

family

String identifying the distribution family. One of t, cauchy, normal, logistic, and beta.

params

Named list identifying parameters, which vary by distribution family.

t: location loc, scale sc, and degrees of freedom df

cauchy: location loc and scale sc

normal: location loc and scale sc

logistic: location loc and scale sc

beta: shape shape1 and shape shape2

lb

Numeric scalar giving the value of left truncation. Defaults to -Inf. For family beta, this is intersected with its natural lower bound of zero.

ub

Numeric scalar giving the value of right truncation. Defaults to Inf. For family beta, this is intersected with its natural upper bound of one.

name

String appending optional message to the textual name of the distribution.

Details

The supported classes of pseudo-targets include: t, cauchy, normal, logistic, and beta.

Value

A list with named components:

d: function to evaluate the density (finite boundary points of the support evaluate to 0)

ld: function to evaluate the log density (finite boundary points of the support evaluate to -Inf)

q: function to evaluate the quantile function

p: function to evaluate the distribution function

txt: text description of the distribution

params: repeats the params argument

lb: lower boundary of support

ub: upper boundary of support

References

Heiner, M. J., Johnson, S. B., Christensen, J. R., and Dahl, D. B. (2026+), "Quantile Slice Sampling," arXiv preprint arXiv:2407.12608 \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.48550/arXiv.2407.12608")}

Examples

pseu <- pseudo_list(family = "t", params = list(loc = 0.0, sc = 1.0, df = 5),
                    lb = 0.0, ub = Inf) # half t
str(pseu)
pseu$d(1.5)
pseu$ld(1.5)
pseu$p(1.5)
# should match (F(x) - F(0)) / (1 - F(0)) below
(pt(1.5, df = 5) - pt(0.0, df = 5)) / pt(0.0, df = 5, lower.tail = FALSE)
pseu$q(0.8060963)
curve(pseu$d(x), from = -1.0, to = 5.0, n = 1000)
pseu <- pseudo_list(family = "cauchy", params = list(loc = 0.0, sc = 1.0),
                    lb = 0.0, ub = Inf) # half Cauchy
str(pseu)
pseu$d(1.5)
pseu$ld(1.5)
pseu$p(1.5)
pseu$q(0.6256659)
pseu <- pseudo_list(family = "normal", params = list(loc = 0.0, sc = 1.0),
                    lb = 0.0, ub = Inf) # half normal
str(pseu)
pseu$d(1.5)
pseu$ld(1.5)
pseu$p(1.5)
pseu$q(0.8663856)
pseu <- pseudo_list(family = "logistic", params = list(loc = 0.0, sc = 1.0),
                    lb = 0.0, ub = Inf) # half logistic
str(pseu)
pseu$d(1.5)
pseu$ld(1.5)
pseu$p(1.5)
pseu$q(0.635149)
pseu <- pseudo_list(family = "beta", params = list(shape1 = 3.0, shape2 = 2.0), lb = 0.2)
str(pseu)
pseu$d(0.5)
pseu$ld(0.5)
pseu$p(0.5)
# should match (F(x) - F(0.2)) / (1 - F(0.2)) below
(pbeta(0.5, 3.0, 2.0) - pbeta(0.2, 3.0, 2.0)) / pbeta(0.2, 3.0, 2.0, lower.tail = FALSE)
pseu$q(0.2932771)
curve(pseu$d(x), from = 0.0, to = 1.0, n = 1000)

qslice documentation built on Oct. 22, 2026, 1:06 a.m.