Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prep 1.8-1 release #24

Merged
merged 1 commit into from
Jan 21, 2025
Merged
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
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ Description: Tool-set to support Bayesian evidence synthesis. This
for details on applying this package while Neuenschwander et al. (2010)
<doi:10.1177/1740774509356002> and Schmidli et al. (2014)
<doi:10.1111/biom.12242> explain details on the methodology.
Version: 1.8-0
Date: 2025-01-08
Version: 1.8-1
Date: 2025-01-20
Authors@R: c(person("Novartis", "Pharma AG", role = "cph")
,person("Sebastian", "Weber", email="sebastian.weber@novartis.com", role=c("aut", "cre"))
,person("Beat", "Neuenschwander", email="beat.neuenschwander@novartis.com", role="ctb")
,person("Heinz", "Schmidli", email="heinz.schmidli@novartis.com", role="ctb")
,person("Baldur", "Magnusson", email="baldur.magnusson@novartis.com", role="ctb")
,person("Yue", "Li", email="yue-1.li@novartis.com", role="ctb")
,person("Satrajit", "Roychoudhury", email="satrajit.roychoudhury@novartis.com", role="ctb")
,person("Lukas A.", "Widmer", email="lukas_andreas.widmer@novartis.com", role = "ctb", comment = c(ORCID = "0000-0003-1471-3493"))
,person("Trustees of", "Columbia University", role="cph", comment="R/stanmodels.R, configure, configure.win")
)
Depends:
Expand Down Expand Up @@ -71,5 +72,5 @@ Suggests:
VignetteBuilder: knitr
SystemRequirements: GNU make, pandoc (>= 1.12.3), pngquant, C++17
Encoding: UTF-8
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Config/testthat/edition: 3
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# RBesT 1.8-1 - January 20th, 2025

## Bugfixes

* Fixed an issue with the `ess` function for beta and gamma mixtures
when used inside of `lapply` or `sapply`.

# RBesT 1.8-0 - January 8th, 2025

## Enhancements
Expand Down
8 changes: 6 additions & 2 deletions R/mixess.R
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ weighted_lir_link <- function(mix, info, fisher_inverse, link) {
ess.betaMix <- function(mix, method = c("elir", "moment", "morita"), ..., s = 100) {
method <- match.arg(method)

assert_that(!("family" %in% names(match.call())), msg = "Argument family is only supported for normal mixtures.")
call_arg_names <- names(match.call())
family_arg_is_set <- "family" %in% call_arg_names
assert_that(!family_arg_is_set, msg = "Argument family is only supported for normal mixtures.")

if (method == "elir") {
if (!test_numeric(mix[2, ], lower = 1, finite = TRUE, any.missing = FALSE) ||
Expand Down Expand Up @@ -270,7 +272,9 @@ binomialInfo <- function(r, theta, n) {
ess.gammaMix <- function(mix, method = c("elir", "moment", "morita"), ..., s = 100, eps = 1E-4) {
method <- match.arg(method)

assert_that(!("family" %in% names(match.call())), msg = "Argument family is only supported for normal mixtures.")
call_arg_names <- names(match.call())
family_arg_is_set <- "family" %in% call_arg_names
assert_that(!family_arg_is_set, msg = "Argument family is only supported for normal mixtures.")

lik <- likelihood(mix)

Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
1 change: 1 addition & 0 deletions man/RBesT-package.Rd

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

7 changes: 7 additions & 0 deletions tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ test_that("moment matching for beta mixtures is correct", {
expect_equal(ess(bmix, method = "moment"), sum(ab_matched))
})

test_that("beta mix ess works when run through sapply", {
expect_numeric(sapply(X = list(bmix), FUN=ess))
})

test_that("normal mixtures have reference scale used correctly", {
nmix_sigma_small <- nmix
nmix_sigma_large <- nmix
Expand Down Expand Up @@ -223,6 +227,9 @@ test_that("gamma mixtures have likelihood property respected", {
expect_true(e1r != e2r)
})

test_that("gamma mix ess works when run through sapply", {
expect_numeric(sapply(X = list(gmix), FUN=ess))
})

test_that("gamma 1-component density gives canonical results", {
guni1 <- gmix[[1, rescale = TRUE]]
Expand Down
2 changes: 1 addition & 1 deletion tools/make-ds.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ make_internal_ds <- function() {
calibration_meta["MD5"] <- vals["MD5"]

pkg_create_date <- Sys.time()
pkg_sha <- "3437e3d"
pkg_sha <- "5048c0b"

if (gsub("\\$", "", pkg_sha) == "Format:%h") {
pkg_sha <- system("git rev-parse --short HEAD", intern=TRUE)
Expand Down
Loading