View source: R/pseudo_targets.R
| pseudo_list | R Documentation |
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+).
pseudo_list(family, params, lb = -Inf, ub = Inf, name = NULL)
family |
String identifying the distribution family. One of |
params |
Named list identifying parameters, which vary by distribution family.
|
lb |
Numeric scalar giving the value of left truncation. Defaults to |
ub |
Numeric scalar giving the value of right truncation. Defaults to |
name |
String appending optional message to the textual name of the distribution. |
The supported classes of pseudo-targets include: t, cauchy,
normal, logistic, and beta.
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
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")}
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.