Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* dramatically improved efficiency in certain post-processing functions for multiseason models
* CI runs properly
* backend hygiene improvements
* updated compatibility with upcoming changes to `loo_compare()` output
structure in the `loo` package (> 2.9.0), which now returns a data frame
instead of a matrix and includes additional diagnostic columns.

# flocker 1.0-1
* fixed a bug that was throwing an uninformative error when making predictions in multiseason models where history_condition is TRUE
Expand Down
2 changes: 1 addition & 1 deletion R/loo.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ loo_flocker_onefit <- function(x, thin = NULL) {
#' @param thin specify the amount of thinning required. 1 or NULL results in no
#' thinning, 2 retains every other value, 3 every third, etc.
#' @param model_names An optional vector of names for the models.
#' @return a `compare.loo` matrix
#' @return a `compare.loo` object
#' @export
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion man/loo_compare_flocker.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions tests/testthat/test-loo_flocker.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,16 @@ test_that("loo_compare_flocker works correctly", {
# check model naming
suppressWarnings(test_compare <- loo_compare_flocker(list(example_flocker_model_single2, example_flocker_model_single2),
model_names = c("m1", "m2"), thin = 2))
expect_identical(row.names(test_compare), c("m1", "m2"))
if ("model" %in% colnames(test_compare)) {
expect_identical(test_compare$model, c("m1", "m2"))
} else {
expect_identical(row.names(test_compare), c("m1", "m2"))
}

# check test output identical
expect_true(all(apply(test_compare, 2, diff) == 0))
if ("model" %in% colnames(test_compare)) {
expect_true(all(apply(test_compare[,c(2,3)], 2, diff) == 0))
} else {
expect_true(all(apply(test_compare, 2, diff) == 0))
}
})