Pareto smooth tail function to Pareto smooth the tail of a vector. Exported for usage in other packages, not by users.
Source:R/pareto_smooth.R
ps_tail.RdPareto smooth tail function to Pareto smooth the tail of a vector. Exported for usage in other packages, not by users.
Usage
ps_tail(
x,
ndraws_tail,
smooth_draws = TRUE,
tail = c("right", "left"),
are_log_weights = FALSE,
...
)Arguments
- x
(multiple options) One of:
A matrix of draws for a single variable (iterations x chains). See
extract_variable_matrix().An
rvar.
- ndraws_tail
(numeric) number of draws for the tail. If
ndraws_tailis not specified, it will be set tolength(x).- smooth_draws
(logical) Should the tails be smoothed? Default is
TRUE. IfFALSE,kwill be calculated butxwill remain untouched.- tail
(string) The tail to diagnose/smooth:
"right": diagnose/smooth only the right (upper) tail"left": diagnose/smooth only the left (lower) tail
- are_log_weights
(logical) Are the draws log weights? Default is
FALSE. IfTRUEcomputation will take into account that the draws are log weights, and only right tail will be smoothed.- ...
Arguments passed to individual methods (if applicable).
References
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
See also
pareto_smooth for the user-facing function.