| pseudo_opt | R Documentation |
Find an optimal pseudo-target in a specified family to approximate the given (unnormalized) target (Heiner et al., 2026+). Optimize over the selected utility function.
pseudo_opt(
log_target = NULL,
samples = NULL,
type = "samples",
family = "t",
df = NULL,
lb = -Inf,
ub = Inf,
utility_type = "AUC",
nbins = 100,
tol_opt = 1e-06,
init_fn = NULL,
utility_options = list(tol_int = 0.001, n_opt = 10, interval_opt = c(1e-06, 0.999999),
diagnostics = NULL),
plot = TRUE,
verbose = FALSE,
degf = NULL
)
log_target |
Function to evaluate the log density of the unnormalized univariate target. |
samples |
Optional numeric vector providing samples from the target distribution
(for use as alternative to |
type |
String specifying the input type. One of "function", "samples", or "grid". Default is to use "samples". Use of "function" requires specification of Use of "samples" requires specification of Use of "grid" requires specification of |
family |
String specifying the family of distributions for the pseudo-target. Can be any of the families accepted by pseudo_list. |
df |
Numeric vector of degrees of freedom values to try (only if |
lb |
Numeric scalar giving the value of left truncation. Defaults to |
ub |
Numeric scalar giving the value of right truncation. Defaults to |
utility_type |
String identifying utility type, either AUC (default) or MSW. |
nbins |
Positive integer specifying the number of histogram bins if using "samples" or "grid". Defaults to 100. |
tol_opt |
Positive numeric scalar that passes to |
init_fn |
Function with no arguments that returns a vector of parameter values for the initial pseudo-target, usually consisting
of a real-valued location parameter and a positive-valued scale parameter. If |
utility_options |
List containing the following. |
plot |
Logical for whether to generate two plots:
Defaults to |
verbose |
Logical for whether to print intermediate steps of optimization.
Defaults to |
degf |
(deprecated) Numeric vector of degrees of freedom values to try (only if |
Optionally supply samples from the target distribution.
A list with named components:
pseudo: a list with functions corresponding to the selected pseudo-target;
output of pseudo_list.
utility: value of the utility function using the selected pseudo-target;
output of utility_pseudo.
utility_type: repeats the input specifying the utility type.
opt: output of optim.
Other outputs repeating inputs.
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")}
oldpar <- par(mfrow = c(1,2))
(pseu <- pseudo_opt(samples = rnorm(1e3), type = "samples",
family = "t", utility_type = "AUC",
nbins = 10, plot = TRUE,
verbose = FALSE))
(pseu <- pseudo_opt(log_target = function(x) dnorm(x, log = TRUE),
type = "grid",
family = "logistic", utility_type = "MSW",
nbins = 30, plot = TRUE,
verbose = FALSE))
(pseu <- pseudo_opt(log_target = function(x) dbeta(x, 4, 2, log = TRUE),
lb = 0, ub = 1,
type = "function",
family = "cauchy", utility_type = "AUC",
init_fn = function() {c(rbeta(1, 3.0, 3.0), rgamma(1, 3.0))},
nbins = 30, plot = TRUE,
verbose = FALSE))
par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.