pareto_khat {posterior} | R Documentation |
Pareto khat diagnostic
Description
Estimate Pareto k value by fitting a Generalized Pareto Distribution to one or two tails of x. This can be used to estimate the number of fractional moments that is useful for convergence diagnostics. For further details see Vehtari et al. (2022).
Usage
pareto_khat(x, ...)
## Default S3 method:
pareto_khat(
x,
tail = c("both", "right", "left"),
r_eff = NULL,
ndraws_tail = NULL,
verbose = FALSE,
...
)
## S3 method for class 'rvar'
pareto_khat(x, ...)
Arguments
x |
(multiple options) One of:
|
... |
Arguments passed to individual methods (if applicable). |
tail |
(string) The tail to diagnose/smooth:
The default is |
r_eff |
(numeric) relative effective sample size estimate. If
|
ndraws_tail |
(numeric) number of draws for the tail. If
|
verbose |
(logical) Should diagnostic messages be printed? If
|
Value
khat
estimated Generalized Pareto Distribution shape parameter k
References
Aki Vehtari, Daniel Simpson, Andrew Gelman, Yuling Yao and Jonah Gabry (2022). Pareto Smoothed Importance Sampling. arxiv:arXiv:1507.02646
Examples
mu <- extract_variable_matrix(example_draws(), "mu")
pareto_khat(mu)
d <- as_draws_rvars(example_draws("multi_normal"))
pareto_khat(d$Sigma)