Skip to content

Commit ea273bb

Browse files
committed
update psis ref + some minor typo fixes
1 parent 9f28fc4 commit ea273bb

12 files changed

Lines changed: 26 additions & 40 deletions

R/loo_moment_matching.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ loo_moment_match.default <- function(x, loo, post_draws, log_lik_i,
195195
#' @param i observation number.
196196
#' @param x A fitted model object.
197197
#' @param log_lik_i A function that takes `x` and `i` and returns a matrix (one
198-
#' column per chain) or a vector (all chains stacked) of log-likeliood draws
198+
#' column per chain) or a vector (all chains stacked) of log-likelihood draws
199199
#' of the `i`th observation based on the model `x`. If the draws are obtained
200200
#' using MCMC, the matrix with MCMC chains separated is preferred.
201201
#' @param unconstrain_pars A function that takes arguments `x`, and `pars` and
@@ -440,7 +440,7 @@ loo_moment_match_i <- function(i,
440440
#' `upars` and returns a matrix of log-posterior density values of the
441441
#' unconstrained posterior draws passed via `upars`.
442442
#' @param log_lik_i_upars A function that takes arguments `x`, `upars`,
443-
#' and `i` and returns a vector of log-likeliood draws of the `i`th
443+
#' and `i` and returns a vector of log-likelihood draws of the `i`th
444444
#' observation based on the unconstrained posterior draws passed via
445445
#' `upars`.
446446
#' @param r_eff_i MCMC effective sample size divided by the total sample size

R/loo_subsample.R

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ update.psis_loo_ss <- function(object, ...,
316316
stopifnot(is.data.frame(data) || is.matrix(data) & !is.null(draws))
317317
}
318318

319-
# Compute subsample indecies
319+
# Compute subsample indices
320320
if (length(observations) > 1) {
321321
idxs <- compute_idxs(observations)
322322
} else {
@@ -448,7 +448,7 @@ nobs.psis_loo_ss <- function(object, ...) {
448448
#' @details
449449
#' The choice `psis` is returned if a `psis_loo` object
450450
#' is converted to a `psis_loo_ss` object with `as.psis_loo_ss()`.
451-
#' But `psis` cannot be chosen in the api of `loo_subsample()`.
451+
#' But `psis` cannot be chosen in the API of `loo_subsample()`.
452452
#'
453453
#' @noRd
454454
#' @param api The choices available in the loo API or all possible choices.
@@ -756,7 +756,7 @@ compute_idxs <- function(observations) {
756756
}
757757

758758

759-
#' Compare the indecies to prepare handling
759+
#' Compare the indices to prepare handling
760760
#'
761761
#' @details
762762
#' The function compares the object and sampled indices into `new`
@@ -1193,14 +1193,15 @@ srs_diff_est <- function(y_approx, y, y_idx) {
11931193
# eq (9) first row second `+` should be `-`
11941194
# Supplementary material eq (6) has this correct
11951195
# Here the variance is for sum, while in the paper the variance is for mean
1196-
# which explains the proporional difference of 1/n
1196+
# which explains the proportional difference of 1/N
11971197
est_list$hat_v_y <- (t_pi2_tilde + t_hat_epsilon) - # a (has been checked)
11981198
(1/N) * (t_e^2 - est_list$v_y_hat + 2 * t_pi_tilde * est_list$y_hat - t_pi_tilde^2) # b
11991199
est_list
12001200
}
12011201

12021202

1203-
#' Estimate elpd using the standard SRS estimator and SRS WOR
1203+
#' Estimate elpd using the standard simple-re-sample without
1204+
#' resampling (SRS-WOR) estimator
12041205
#' @noRd
12051206
#' @param x A `psis_loo_ss` object.
12061207
#' @return A `psis_loo_ss` object.
@@ -1220,7 +1221,7 @@ loo_subsample_estimation_srs <- function(x) {
12201221
update_psis_loo_ss_estimates(x)
12211222
}
12221223

1223-
#' Simple SRS-WOR estimation
1224+
#' Simple-re-sample without resampling (SRS-WOR) estimation
12241225
#' @noRd
12251226
#' @param y The values observed.
12261227
#' @param y_approx A vector of length N.
@@ -1324,6 +1325,3 @@ assert_subsampling_pointwise <- function(x) {
13241325
checkmate::assert_names(colnames(x), identical.to = c("elpd_loo", "mcse_elpd_loo", "p_loo", "looic", "influence_pareto_k", "idx", "m_i", "elpd_loo_approx"))
13251326
x
13261327
}
1327-
1328-
1329-

man-roxygen/loo-and-compare-references.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#'
88
#' Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
99
#' Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
10-
#' accepted for publication.
11-
#' [preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
10+
#' 25(72):1-58.
11+
#' [PDF](https://jmlr.org/papers/v25/19-556.html)
1212
#'
1313
#' Sivula, T, Magnusson, M., Matamoros A. A., and Vehtari, A. (2022).
1414
#' Uncertainty in Bayesian leave-one-out cross-validation based model

man-roxygen/loo-and-psis-references.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#' [preprint arXiv:1507.04544](https://arxiv.org/abs/1507.04544)).
77
#'
88
#' Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
9-
#' Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
10-
#' accepted for publication.
11-
#' [preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
9+
#' Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
10+
#' 25(72):1-58.
11+
#' [PDF](https://jmlr.org/papers/v25/19-556.html)
1212
#'

vignettes/loo2-example.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ encourage readers to refer to the following papers for more details:
3232

3333
* Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
3434
Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
35-
accepted for publication.
36-
[arXiv preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
35+
25(72):1-58. [PDF](https://jmlr.org/papers/v25/19-556.html)
3736

3837

3938
# Setup
@@ -302,5 +301,4 @@ Computing_. 27(5), 1413--1432. \doi:10.1007/s11222-016-9696-4.
302301

303302
Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
304303
Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
305-
accepted for publication.
306-
[arXiv preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
304+
25(72):1-58. [PDF](https://jmlr.org/papers/v25/19-556.html)

vignettes/loo2-large-data.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ Proceedings of the 23rd International Conference on Artificial Intelligence and
3737

3838
* Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
3939
Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
40-
accepted for publication.
41-
[arXiv preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
40+
25(72):1-58. [PDF](https://jmlr.org/papers/v25/19-556.html)
4241

4342
which provide important background for understanding the methods implemented in
4443
the package.
@@ -613,5 +612,4 @@ Computing_. 27(5), 1413--1432. \doi:10.1007/s11222-016-9696-4.
613612

614613
Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
615614
Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
616-
accepted for publication.
617-
[arXiv preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
615+
25(72):1-58. [PDF](https://jmlr.org/papers/v25/19-556.html)

vignettes/loo2-lfo.Rmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,7 @@ Vehtari A., Gelman A., & Gabry J. (2017). Practical Bayesian model evaluation us
642642

643643
Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
644644
Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
645-
accepted for publication.
646-
[arXiv preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
645+
25(72):1-58. [PDF](https://jmlr.org/papers/v25/19-556.html)
647646

648647
<br />
649648

vignettes/loo2-mixis.Rmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ Vehtari A., Gelman A., and Gabry J. (2017). Practical Bayesian model evaluation
197197

198198
Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
199199
Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
200-
accepted for publication.
201-
[arXiv preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
200+
25(72):1-58. [PDF](https://jmlr.org/papers/v25/19-556.html)
202201

203202

204203

vignettes/loo2-moment-matching.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ papers
4545

4646
* Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
4747
Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
48-
accepted for publication.
49-
[arXiv preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
48+
25(72):1-58. [PDF](https://jmlr.org/papers/v25/19-556.html)
5049

5150
# Example: Eradication of Roaches
5251

@@ -322,5 +321,4 @@ Vehtari, A., Gelman, A., and Gabry, J. (2017). Practical Bayesian model evaluati
322321

323322
Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
324323
Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
325-
accepted for publication.
326-
[arXiv preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
324+
25(72):1-58. [PDF](https://jmlr.org/papers/v25/19-556.html)

vignettes/loo2-non-factorized.Rmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,5 +718,4 @@ Vehtari A., Gelman A., & Gabry J. (2017). Practical Bayesian model evaluation us
718718

719719
Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
720720
Pareto smoothed importance sampling. *Journal of Machine Learning Research*,
721-
accepted for publication.
722-
[arXiv preprint arXiv:1507.02646](https://arxiv.org/abs/1507.02646)
721+
25(72):1-58. [PDF](https://jmlr.org/papers/v25/19-556.html)

0 commit comments

Comments
 (0)