pseudo_list {qslice}R 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. (2024+).

Usage

pseudo_list(family, params, lb = -Inf, ub = Inf, log_p = FALSE, 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 degf

cauchy: location loc and scale sc

norm: location loc and scale sc

logistic: location loc and scale sc

beta: scale scale1 and scale scale2

lb

Numeric scalar giving the value of left truncation. Defaults to -Inf. Not operative in family beta.

ub

Numeric scalar giving the value of right truncation. Defaults to Inf. Not operative in family beta.

log_p

(Not implemented) Logical: evaluate distribution and quantile functions using the log probability.

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

ld: function to evaluate the log density

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. (2024+), "Quantile Slice Sampling," arXiv preprint arXiv:###

Examples

pseu <- pseudo_list(family = "t", params = list(loc = 0.0, sc = 1.0, degf = 5),
                    lb = 0.0, ub = Inf) # half t
str(pseu)
pseu$d(1.5)
pseu$ld(1.5)
pseu$p(1.5)
pseu$q(0.8060963)
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 = 2.0, shape2 = 1.0))
str(pseu)
pseu$d(0.5)
pseu$ld(0.5)
pseu$p(0.5)
pseu$q(0.25)

[Package qslice version 0.3.1 Index]