Pareto smooth tail function to Pareto smooth the tail of a vector. Exported for usage in other packages, not by users.
ps_tail(
x,
ndraws_tail,
smooth_draws = TRUE,
tail = c("right", "left"),
are_log_weights = FALSE,
...
)(multiple options) One of:
A matrix of draws for a single variable (iterations x chains). See
extract_variable_matrix().
An rvar.
(numeric) number of draws for the tail. If
ndraws_tail is not specified, it will be set to length(x).
(logical) Should the tails be smoothed? Default is
TRUE. If FALSE, k will be calculated but x will remain untouched.
(string) The tail to diagnose/smooth:
"right": diagnose/smooth only the right (upper) tail
"left": diagnose/smooth only the left (lower) tail
(logical) Are the draws log weights? Default is
FALSE. If TRUE computation will take into account that the
draws are log weights, and only right tail will be smoothed.
Arguments passed to individual methods (if applicable).
Aki Vehtari, Daniel Simpson, Andrew Gelman, Yuling Yao and Jonah Gabry (2024). Pareto Smoothed Importance Sampling. Journal of Machine Learning Research, 25(72):1-58. PDF
pareto_smooth for the user-facing function.