% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pareto_smooth.R
\name{ps_tail}
\alias{ps_tail}
\title{Pareto 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{
\item{x}{(multiple options) One of:
\itemize{
\item A matrix of draws for a single variable (iterations x chains). See
\code{\link[=extract_variable_matrix]{extract_variable_matrix()}}.
\item An \code{\link{rvar}}.
}}

\item{ndraws_tail}{(numeric) number of draws for the tail. If
\code{ndraws_tail} is not specified, it will be set to \code{length(x)}.}

\item{smooth_draws}{(logical) Should the tails be smoothed? Default is
\code{TRUE}. If \code{FALSE}, \code{k} will be calculated but \code{x} will remain untouched.}

\item{tail}{(string) The tail to diagnose/smooth:
\itemize{
\item \code{"right"}: diagnose/smooth only the right (upper) tail
\item \code{"left"}: diagnose/smooth only the left (lower) tail
}}

\item{are_log_weights}{(logical) Are the draws log weights? Default is
\code{FALSE}. If \code{TRUE} computation will take into account that the
draws are log weights, and only right tail will be smoothed.}

\item{...}{Arguments passed to individual methods (if applicable).}
}
\description{
Pareto smooth tail
function to Pareto smooth the tail of a vector. Exported
for usage in other packages, not by users.
}
\references{
Aki Vehtari, Daniel Simpson, Andrew Gelman, Yuling Yao and
Jonah Gabry (2024). Pareto Smoothed Importance Sampling.
\emph{Journal of Machine Learning Research}, 25(72):1-58.
\href{https://jmlr.org/papers/v25/19-556.html}{PDF}
}
\seealso{
\code{\link{pareto_smooth}} for the user-facing function.
}
