Skip to contents

Truncating the big weights caps the variance but adds bias; leaving them alone keeps it unbiased and useless. Smoothing replaces the extreme weights by order statistics of a generalised Pareto fitted to that same tail, stabilising the variance while keeping the shape the data showed.

Usage

Loopr(log_lik)

Arguments

log_lik

Pointwise log likelihood.

Value

List with estimate, k, weights, S, n.

Details

Formula: with M = min(0.2 S, 3 sqrt(S)), substitute F^-1((z - 0.5)/M) for the M largest weights, then cap at S^(3/4) mean(w).

References

Vehtari, Simpson, Gelman, Yao & Gabry (2024) JMLR 25:1-58.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Loopr(V)
#> $estimate
#> [1] NaN
#> 
#> $k
#> [1] NaN
#> 
#> $weights
#>              [,1]
#> [1,] 0.6323326828
#> [2,] 0.2326221940
#> [3,] 0.0855769227
#> [4,] 0.0314819905
#> [5,] 0.0115815771
#> [6,] 0.0042606241
#> [7,] 0.0015673960
#> [8,] 0.0005766128
#> 
#> $S
#> [1] 8
#> 
#> $n
#> [1] 1
#> 
#> $method
#> [1] "Pareto-smoothed importance weights"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"