diff --git a/R/gpd.R b/R/gpd.R index 3c98521..3cffd77 100644 --- a/R/gpd.R +++ b/R/gpd.R @@ -53,6 +53,7 @@ qgeneralized_pareto <- function(p, mu = 0, sigma = 1, k = 0, lower.tail = TRUE, #' Zhang, J., and Stephens, M. A. (2009). A new and efficient estimation method #' for the generalized Pareto distribution. *Technometrics* **51**, 316-325. #' +#' @noRd gpdfit <- function(x, wip = TRUE, min_grid_pts = 30, sort_x = TRUE) { # see section 4 of Zhang and Stephens (2009) if (sort_x) { diff --git a/R/pareto_smooth.R b/R/pareto_smooth.R index e9b558f..e5f1aff 100644 --- a/R/pareto_smooth.R +++ b/R/pareto_smooth.R @@ -637,6 +637,7 @@ ps_tail_length <- function(ndraws, r_eff, ...) { #' @param are_weights (logical) are the diagnostics for weights #' @param ... unused #' @return diagnostic message +#' @noRd pareto_k_diagmsg <- function(diags, are_weights = FALSE, ...) { khat <- diags$khat min_ss <- diags$min_ss diff --git a/man/ps_convergence_rate.Rd b/man/ps_convergence_rate.Rd new file mode 100644 index 0000000..535f0eb --- /dev/null +++ b/man/ps_convergence_rate.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/pareto_smooth.R +\name{ps_convergence_rate} +\alias{ps_convergence_rate} +\title{Pareto convergence rate} +\usage{ +ps_convergence_rate(k, ndraws, ...) +} +\arguments{ +\item{k}{pareto-k values} + +\item{ndraws}{number of draws} + +\item{...}{unused} +} +\value{ +convergence rate +} +\description{ +Given number of draws and scalar or array of k's, compute the +relative convergence rate of PSIS estimate RMSE. See Appendix B of +Vehtari et al. (2024). This function is exported to be usable by +other packages. For user-facing diagnostic functions, see +\code{\link{pareto_convergence_rate}} and \code{\link{pareto_diags}}. +} +\seealso{ +Other helper-functions: +\code{\link{ps_khat_threshold}()}, +\code{\link{ps_min_ss}()}, +\code{\link{ps_tail_length}()} +} +\concept{helper-functions} diff --git a/man/ps_khat_threshold.Rd b/man/ps_khat_threshold.Rd new file mode 100644 index 0000000..d82ebcb --- /dev/null +++ b/man/ps_khat_threshold.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/pareto_smooth.R +\name{ps_khat_threshold} +\alias{ps_khat_threshold} +\title{Pareto k-hat threshold} +\usage{ +ps_khat_threshold(ndraws, ...) +} +\arguments{ +\item{ndraws}{number of draws} + +\item{...}{unused} +} +\value{ +threshold +} +\description{ +Given number of draws, computes khat threshold for reliable Pareto +smoothed estimate (to have small probability of large error). See +section 3.2.4, equation (13) of Vehtari et al. (2024). This +function is exported to be usable by other packages. For +user-facing diagnostic functions, see \code{\link{pareto_khat_threshold}} and +\code{\link{pareto_diags}}. +} +\seealso{ +Other helper-functions: +\code{\link{ps_convergence_rate}()}, +\code{\link{ps_min_ss}()}, +\code{\link{ps_tail_length}()} +} +\concept{helper-functions} diff --git a/man/ps_min_ss.Rd b/man/ps_min_ss.Rd new file mode 100644 index 0000000..533cfa3 --- /dev/null +++ b/man/ps_min_ss.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/pareto_smooth.R +\name{ps_min_ss} +\alias{ps_min_ss} +\title{Pareto-smoothing minimum sample-size} +\usage{ +ps_min_ss(k, ...) +} +\arguments{ +\item{k}{pareto k value} + +\item{...}{unused} +} +\value{ +minimum sample size +} +\description{ +Given Pareto-k computes the minimum sample size for reliable Pareto +smoothed estimate (to have small probability of large error). See +section 3.2.3 in Vehtari et al. (2024). This function is exported +to be usable by other packages. For user-facing diagnostic functions, see +\code{\link{pareto_min_ss}} and \code{\link{pareto_diags}}. +} +\seealso{ +Other helper-functions: +\code{\link{ps_convergence_rate}()}, +\code{\link{ps_khat_threshold}()}, +\code{\link{ps_tail_length}()} +} +\concept{helper-functions} diff --git a/man/ps_tail_length.Rd b/man/ps_tail_length.Rd new file mode 100644 index 0000000..036afe3 --- /dev/null +++ b/man/ps_tail_length.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/pareto_smooth.R +\name{ps_tail_length} +\alias{ps_tail_length} +\title{Pareto tail length} +\usage{ +ps_tail_length(ndraws, r_eff, ...) +} +\arguments{ +\item{ndraws}{number of draws} + +\item{r_eff}{relative efficiency} + +\item{...}{unused} +} +\value{ +tail length +} +\description{ +Calculate the tail length from number of draws and relative efficiency +r_eff. See Appendix H in Vehtari et al. (2024). This function is +used internally and is exported to be available for other packages. +} +\seealso{ +Other helper-functions: +\code{\link{ps_convergence_rate}()}, +\code{\link{ps_khat_threshold}()}, +\code{\link{ps_min_ss}()} +} +\concept{helper-functions}