How this calculation works
Pareto-smoothed importance sampling stabilizes the largest importance ratios before normalizing weights and computing an expectation. Its fitted tail-shape diagnostic helps identify unstable proposal-to-target reweighting. The page starts with supplied log ratios and function values; it does not evaluate either density or automatically perform leave-one-out model assessment.
Raw weights∝exp(log r−max log r); PSIS replaces selected upper order statistics by fitted generalized-Pareto quantiles before normalization; ESS=1/Σnormalized_weight².A worked example
With one hundred equal log ratios and function values0through99, all normalized weights are0.01. The raw and smoothed expectation is49.5and weight-based ESSis100. An equal-weight tail has no identifiable positive-excess Pareto fit and should be labeled accordingly.
Good to know
100–5000 IID proposal draws supplied as finite log importance ratios and matching function values. Named PSIS tail-length and generalized-Pareto estimation conventions, stabilized log normalization, raw/smoothed estimates and ESS. Reject unresolved tail fit; report diagnostic limitations for large k. No automatic LOO computation, MCMC dependence correction, target/proposal density evaluation or claim that smoothing repairs missing support.
Reference: Vehtari et al., Pareto Smoothed Importance Sampling (opens in a new tab) ↗
Start with the importance-sampling target
Importance sampling reuses draws from a proposal distribution to estimate an expectation under another distribution. The ratio of target density to proposal density provides the relative weight for each draw. Both distributions may be known only up to constants that cancel on normalization, but the proposal must still cover every target region relevant to the requested expectation.
Poor overlap can create a few enormous ratios. A plain weighted average may then depend almost entirely on one or two observations. Pareto smoothing addresses the numerical and statistical effect of the observed right tail. It cannot recover an important region that was never sampled or make an unsupported target-to-proposal density ratio valid.
Compare this with the Generalized Pareto tail fit calculator from threshold exceedances. Fit and replace the upper importance-ratio tail according to the PSIS algorithm, producing stabilized weights, a weighted expectation and a Pareto-k diagnostic. Existing GPD fitting estimates an exceedance distribution and cannot perform the PSIS smoothing/order-statistic replacement or importance-weight diagnostics.
Enter log ratios and matching function values
Each row or position in the two supplied vectors refers to the same proposal draw. Log ratios are preferred because densities and ratios can span many orders of magnitude. Subtracting the largest log ratio before exponentiation preserves all normalized raw weights while avoiding unnecessary overflow. Function values remain on their original scientific scale.
The initial scope assumes independent proposal draws. If the ratios arise from autocorrelated simulations, the diagnostic and tail-length convention may require relative-efficiency information. This page does not infer that correction from one ratio vector. The matching function values are used for expectations; they are not reused as if they were additional importance draws.
Fit and replace the upper weight tail
The named PSIS algorithm selects an upper tail of the ratios and estimates a generalized-Pareto model for exceedances above its threshold. It replaces extreme ordered values by expected fitted tail quantiles, preserving their rank ordering. This is a specific regularization rule, not arbitrary clipping at a convenient percentile or replacing a tail fit that failed.
Tail length, parameter estimation and any final weight truncation must match the cited implementation convention. Different choices can change both the estimate and Pareto-k diagnostic. The calculator should expose the selected tail size and fit status. A degenerate or unresolved nonconstant tail must not be disguised by returning an ordinary weighted average under a PSIS label.
Check the equal-weight limiting example
The default example has one hundred log ratios all equal to zero. Exponentiation gives one hundred identical positive raw weights, so normalization gives0.01for every draw. The supplied function values are the integers zero through ninety-nine, whose arithmetic mean is49.5. Smoothing has no unequal extreme tail to regularize and leaves that estimate unchanged.
The weight concentration ESSis one divided by one hundred times0.01squared, giving one hundred. This limiting case requires an explicit degenerate-tail status: zero exceedances do not identify a meaningful fitted Pareto tail shape. Reporting a fabricated favorable k value would confuse absence of a fitted tail with evidence about a genuinely estimated tail distribution.
Interpret the stability diagnostic cautiously
The fitted Pareto shape summarizes how heavy the observed ratio tail appears under the method. Larger positive k generally signals more difficult importance sampling and slower reliable estimation. Recommended diagnostic thresholds depend on sample size and the particular published convention. A threshold is a practical diagnostic guide, not a proof that a single weighted estimate has a particular absolute error.
Compare raw and smoothed expectations as well as their weight concentration. A large change indicates that extreme observations were influential, but a small change does not prove good target coverage. The function being averaged also matters: a stable estimate of one quantity does not guarantee stable estimates of every nonlinear or tail-sensitive function of the same draws.
Validate normalization and invariances
Adding a constant to every log ratio must leave normalized weights, the expectation and weight-based ESSunchanged. Reordering ratio/value pairs together should also preserve the result. The normalized weights should be nonnegative and sum to one. Directly recompute the weighted expectation from the returned weights rather than from the displayed rounded summary alone.
Independent comparisons should use a vetted loo or ArviZ PSIS implementation and identical algorithm settings. Include equal ratios, moderate known tails, extremely concentrated but finite ratios and deliberately inadequate tail samples. Compare fitted parameters and smoothed order statistics before only comparing the final mean; a cancellation can make two incorrect weight vectors produce similar means.
Separate PSIS from broader model diagnostics
PSIScan be part of leave-one-out assessment when a suitable pointwise likelihood matrix is available, but a single vector of generic importance ratios is not automatically a LOOanalysis. This page does not calculate expected log predictive density, select a model or infer an observation-level predictive problem from arbitrary supplied weights.
Generalized-Pareto exceedance fitting is also a separate task: it models a tail distribution but does not itself define how to replace importance-ratio order statistics or normalize reweighted draws. Report the proposal, target, function of interest, draw dependence, selected tail convention and diagnostic status when using the result beyond this numerical worked example.
A few questions, answered
Does smoothing fix missing target support?
No. A region absent from proposal draws cannot be reconstructed by changing the largest observed importance ratios.
Why accept log ratios rather than ratios?
Log inputs allow stable normalization across a wide numerical range and make additive normalization-constant invariance easy to check.
Is equal-weight Pareto-kzero?
An equal-weight tail has no positive excess distribution to fit. Its special status should be reported rather than inventing an identified tail-shape estimate.
Does this automatically calculate LOO?
No. Generic ratio reweighting is not a complete pointwise leave-one-out predictive analysis.