Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
weberse2 committed Nov 20, 2024
1 parent d53e6f5 commit 0902b47
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Description: Tool-set to support Bayesian evidence synthesis. This
<doi:10.1177/1740774509356002> and Schmidli et al. (2014)
<doi:10.1111/biom.12242> explain details on the methodology.
Version: 1.7-4
Date: 2024-11-19
Date: 2024-11-20
Authors@R: c(person("Novartis", "Pharma AG", role = "cph")
,person("Sebastian", "Weber", email="[email protected]", role=c("aut", "cre"))
,person("Beat", "Neuenschwander", email="[email protected]", role="ctb")
Expand All @@ -25,7 +25,7 @@ Imports:
methods,
Rcpp (>= 0.12.0),
RcppParallel (>= 5.0.1),
rstan (>= 2.26.0),
rstan (>= 2.32.0),
rstantools (>= 2.4.0),
assertthat,
mvtnorm,
Expand All @@ -44,8 +44,8 @@ LinkingTo:
Rcpp (>= 0.12.0),
RcppEigen (>= 0.3.3.3.0),
RcppParallel (>= 5.0.1),
rstan (>= 2.26.0),
StanHeaders (>= 2.26.0)
rstan (>= 2.32.0),
StanHeaders (>= 2.32.0)
License: GPL (>=3)
LazyData: true
Biarch: true
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ r-source-check : r-source
cd build; tar xvzf $(RPKG)-source.tar.gz
cd build; NOT_CRAN=true $(RCMD) CMD check $(RPKG)

PHONY += r-source-release-check
r-source-release-check : r-source-release
cd build; tar xvzf $(RPKG)_$(PKG_VERSION).tar.gz
cd build; NOT_CRAN=true $(RCMD) CMD check $(RPKG)

build/installed/$(RPKG)/DESCRIPTION : build/r-source-fast
rm -rf build/installed
install -d build/installed
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* Avoid over and underflow of beta-binomial distribution.
* Replace calls to deprecated `ggplot2::qplot` with respective calls
to `ggplot2::ggplot`.
* Use new `array` notation for `mixstanvar` generated Stan code to
make generated Stan programs compatible with Stan >= 2.33

# RBesT 1.7-3 - January 2nd, 2024

Expand Down
8 changes: 4 additions & 4 deletions R/mixstanvar.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ mixstanvar <- function(..., verbose=FALSE) {

if(includes_density("mvnormMix")) {
sv <- sv + brms::stanvar(name="mixmvnorm_lpdf", scode="
real mixmvnorm_lpdf(vector y, vector w, vector[] m, matrix[] L) {
real mixmvnorm_lpdf(vector y, vector w, array[] vector m, array[] matrix L) {
int Nc = rows(w);
vector[Nc] lp_mix;
for(i in 1:Nc) {
Expand Down Expand Up @@ -218,10 +218,10 @@ mix2brms.mvnormMix <- function(mix, name, verbose=FALSE) {
mvprior <- brms::stanvar(Nc, glue::glue("{prefix}Nc")) +
brms::stanvar(p, glue::glue("{prefix}p")) +
brms::stanvar(array(mix[1,,drop=TRUE], dim=Nc), glue::glue("{prefix}w"), scode=glue::glue("vector[{prefix}Nc] {prefix}w;")) +
brms::stanvar(t(mix[2:(p+1),,drop=FALSE]), glue::glue("{prefix}m"), scode=glue::glue("vector[{prefix}p] {prefix}m[{prefix}Nc];")) +
brms::stanvar(Sigma, glue::glue("{prefix}sigma"), scode=glue::glue("matrix[{prefix}p, {prefix}p] {prefix}sigma[{prefix}Nc];")) +
brms::stanvar(t(mix[2:(p+1),,drop=FALSE]), glue::glue("{prefix}m"), scode=glue::glue("array[{prefix}Nc] vector[{prefix}p] {prefix}m;")) +
brms::stanvar(Sigma, glue::glue("{prefix}sigma"), scode=glue::glue("array[{prefix}Nc] matrix[{prefix}p, {prefix}p] {prefix}sigma;")) +
brms::stanvar(scode=glue::glue("
matrix[{{prefix}}p, {{prefix}}p] {{prefix}}sigma_L[{{prefix}}Nc];
array[{{prefix}}Nc] matrix[{{prefix}}p, {{prefix}}p] {{prefix}}sigma_L;
for (i in 1:{{prefix}}Nc) {
{{prefix}}sigma_L[i] = cholesky_decompose({{prefix}}sigma[i]);
}", .open="{{", .close="}}"), block="tdata")
Expand Down
10 changes: 10 additions & 0 deletions tests/testthat/helper-utils.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

source_example <- function(example, env=parent.frame(), disable_plots=TRUE) {
ex_source <- readLines(system.file("examples", example, package="RBesT", mustWork=TRUE))
if(disable_plots) {
ex_source <- grep("plot\\(", ex_source, value=TRUE, invert=TRUE)
}
suppressMessages(ex <- source(textConnection(ex_source),
local=env, echo=FALSE, verbose=FALSE))
invisible(ex)
}
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 <- "87eef77"
pkg_sha <- "1f6edf8"

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

0 comments on commit 0902b47

Please sign in to comment.