Inconsistent Pareto k-values for SIS?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Tái hiện ví dụ với psis(), sis(), weights() và pareto_k_values() bằng example_loglik_array() và r_eff được cung cấp. So sánh các giá trị Inf từ SIS fallback với các kết quả SIS tường minh, sau đó xác định hành vi dự kiến của các giá trị k Pareto và bao phủ kết quả đã thống nhất bằng một regression test.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I noticed that there might be an inconsistency in the Pareto k-values between different approaches for standard importance sampling (SIS):
library(loo)
log_ratios <- -1 * example_loglik_array()
log_ratios <- log_ratios[1:3, , ]
r_eff <- relative_eff(exp(-log_ratios))
# Call psis():
psis_result <- psis(log_ratios, r_eff = r_eff)
# In fact, SIS was used (due to the small number of draws):
lw_sis <- apply(log_ratios, 3, as.vector)
lw_sis <- sweep(lw_sis, 2, apply(lw_sis, 2, matrixStats::logSumExp))
stopifnot(all.equal(weights(psis_result), lw_sis,
tolerance = .Machine$double.eps))
# Now request SIS explicitly:
sis_result <- sis(log_ratios, r_eff = r_eff)
# The (log) weights are as expected:
stopifnot(all.equal(weights(sis_result), lw_sis,
tolerance = .Machine$double.eps))
# However:
table(pareto_k_values(psis_result))
## Inf
## 32
table(pareto_k_values(sis_result))
## 0
## 32
The point is that calling psis() with a small number of draws will cause the Pareto smoothing not to take place. Instead, SIS is used, as demonstrated above. In that case, the Pareto k-values are Inf. When using sis() explicitly, the Pareto k-values are 0.
Background: In projpred, it is possible (although not encouraged and in particular, this is not the default behavior) to use PSIS-LOO CV with the search being excluded from the CV (validate_search = FALSE) and a small number of thinned draws. In principle, projpred could use sis() explicitly in such a case (and then either continue with the Pareto k-values which are all 0 or even skip the Pareto k checks), but that requires to catch the "small S" case manually (which is not a problem, but if loo changes anything in its "small S" decision rule in the future, this would require adapting projpred's decision rule analogously). Using psis() would be more straightforward, but then we have Pareto k-values which are Inf, which would trigger warnings in the Pareto k checks.
- Ngôn ngữ chính
- R
- Star
- 157
- Fork
- 38
- Merge trung bình
- 4 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của stan-dev/loo
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Extend loo_plot_difference Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Clean up issues Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
briandconnelly/airnow#9 ·
-
Copy cohorts to keep old cohorts Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OHDSI/CohortConstructor#774 ·
-
pre-review R TeX Track: 5 (DSAIS)
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 60/100
openjournals/joss-reviews#11330 · 7 bình luận ·
-
Release autosync 0.1.1 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100