Skip to content

Commit e188560

Browse files
authored
Merge pull request #326 from ishaan-arora-1/fix/typos-and-error-message-bug
Fix bug in IS method error message + documentation typos. Also fixed .gitattributes
2 parents 7962cb4 + 2a916b1 commit e188560

17 files changed

+21
-19
lines changed

.gitattributes

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
* text=auto
22
data/* binary
3-
src/* text=lf
4-
R/* text=lf
3+
src/* text eol=lf
4+
R/* text eol=lf
5+
*.rda binary
6+

R/diagnostics.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' @name pareto-k-diagnostic
1212
#' @param x An object created by [loo()] or [psis()].
1313
#' @param threshold For `pareto_k_ids()`, `threshold` is the minimum \eqn{k}
14-
#' value to flag (default is a sample size `S` dependend threshold
14+
#' value to flag (default is a sample size `S` dependent threshold
1515
#' `1 - 1 / log10(S)`). For `mcse_loo()`, if any \eqn{k} estimates are
1616
#' greater than `threshold` the MCSE estimate is returned as `NA`
1717
#' See **Details** for the motivation behind these defaults.
@@ -430,7 +430,7 @@ min_n_eff_by_k <- function(n_eff, kcut) {
430430
#' with bigger sample size S we can achieve estimates with small
431431
#' probability of large error, it is difficult to get accurate MCSE
432432
#' estimates as the bias starts to dominate when k > 0.7 (see Section 3.2.3).
433-
#' Thus the sample size dependend k-ht threshold is capped at 0.7.
433+
#' Thus the sample size dependent k-hat threshold is capped at 0.7.
434434
#' @param S sample size
435435
#' @param ... unused
436436
#' @return threshold

R/importance_sampling.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ assert_importance_sampling_method_is_implemented <- function(x){
114114
stop("Importance sampling method '",
115115
x,
116116
"' is not implemented. Implemented methods: '",
117-
paste0(implemented_is_methods, collapse = "', '"),
117+
paste0(implemented_is_methods(), collapse = "', '"),
118118
"'")
119119
}
120120
}

R/loo-glossary.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#' @template bayesvis-reference
88
#'
99
#' @description
10-
#' The pages provides definitions to key terms. Also see the
10+
#' This page provides definitions of key terms. Also see the
1111
#' [FAQ page](https://mc-stan.org/loo/articles/online-only/faq.html) on
1212
#' the __loo__ website for answers to frequently asked questions.
1313
#'

R/loo-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
#' <https://mc-stan.org>.
8383
#'
8484
#' Watanabe, S. (2010). Asymptotic equivalence of Bayes cross validation and
85-
#' widely application information criterion in singular learning theory.
85+
#' widely applicable information criterion in singular learning theory.
8686
#' *Journal of Machine Learning Research* **11**, 3571-3594.
8787
#'
8888
#' Zhang, J., and Stephens, M. A. (2009). A new and efficient estimation method

R/loo_compare.psis_loo_ss_list.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ loo_compare.psis_loo_ss_list <- function(x, ...) {
3131
return(comp)
3232
}
3333

34-
#' Compare a reference loo object with a comaprison loo object
34+
#' Compare a reference loo object with a comparison loo object
3535
#' @noRd
3636
#' @param ref_loo A named list with a `psis_loo_ss` object.
3737
#' @param compare_loo A named list with a `psis_loo_ss` object.

R/loo_model_weights.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#'
88
#' @export
99
#' @param x A list of `"psis_loo"` objects (objects returned by [loo()]) or
10-
#' pointwise log-likelihood matrices or , one for each model. If the list
10+
#' pointwise log-likelihood matrices, one for each model. If the list
1111
#' elements are named the names will be used to label the models in the
1212
#' results. Each matrix/object should have dimensions \eqn{S} by \eqn{N},
1313
#' where \eqn{S} is the size of the posterior sample (with all chains merged)

R/loo_subsample.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ update.psis_loo_ss <- function(object, ...,
417417
#' @param rep If sampling with replacement is used, an observation can have
418418
#' multiple samples and these are then repeated in the returned object if
419419
#' `rep=TRUE` (e.g., a vector `c(1,1,2)` indicates that observation 1 has been
420-
#' subampled two times). If `rep=FALSE` only the unique indices are returned.
420+
#' subsampled two times). If `rep=FALSE` only the unique indices are returned.
421421
#'
422422
#' @return An integer vector.
423423
#'

R/split_moment_matching.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#' returns a matrix of log-posterior density values of the unconstrained
2222
#' posterior draws passed via `upars`.
2323
#' @param log_lik_i_upars A function that takes arguments `x`, `upars`, and `i`
24-
#' and returns a vector of log-likeliood draws of the `i`th observation based
24+
#' and returns a vector of log-likelihood draws of the `i`th observation based
2525
#' on the unconstrained posterior draws passed via `upars`.
2626
#' @param r_eff_i MCMC relative effective sample size of the `i`'th log
2727
#' likelihood draws.

R/waic.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#'
3535
#' @references
3636
#' Watanabe, S. (2010). Asymptotic equivalence of Bayes cross validation and
37-
#' widely application information criterion in singular learning theory.
37+
#' widely applicable information criterion in singular learning theory.
3838
#' *Journal of Machine Learning Research* **11**, 3571-3594.
3939
#'
4040
#' @template loo-and-psis-references

0 commit comments

Comments
 (0)