Changelog
Source:NEWS.md
bayesDP 1.3.8
Bug fixes
- Fixed
bdplm()andbdplogit()producing invalid historical borrowing when covariates were not mean-centered. Because the models use an intercept-free parameterization (separate treatment and control means), uncentered covariates made the arm-mean estimators strongly correlated and inflated their standard errors as extrapolation errors at covariate = 0, corrupting the (diagonal) discount prior. Both functions now automatically mean-center covariates on their pooled (current plus historical) mean and back-transform the reported intercept, so estimates are invariant to covariate location shifts (#1) - Fixed a bug where the
summarymethods forbdpnormalandbdpbinomialread the one-/two-arm indicator from the wrong list element (argsinstead ofargs1), causing two-arm fits to be summarised as one-arm - Fixed a bug in the two-arm
bdpsurvivalsummary that errored when current control data were absent - Fixed an invalid matrix index (
Y[, 0]) used when computing the defaultsurv_timeinbdpsurvival - Fixed the
compareargument being silently dropped (passed intopaste()) rather than stored in thebdpnormalandbdpbinomialfit objects - Fixed the
mcdiscount-weight Z-statistic inbdplmto divide by the standard error rather than the variance - Fixed
plotmethods hanging on the interactive “Hit” prompt in non-interactive sessions (e.g. tests, CI); par(ask = ...)now respectsinteractive() - Fixed
bdplogit()failing during its main model fit because the analysis data passed toMCMClogit()omitted the response variable. The discounted prior precision matrix is now also passed toMCMClogit()correctly (#12). - Fixed
alpha_discount()soalpha_maxis respected whendiscount_function = "identity"(#6). - Fixed
bdpnormal()one-arm normal fits with only one source of data for an arm (current-only or historical-only internally) returning an over-dispersedposterior_mu. These branches now return the conjugate posterior of the mean rather than adding an extra observation-level draw (posterior-predictive-like variance) (#15).
Tests
- Re-enabled the
testthattest harness (tests/testthat.R) - Rewrote the test suite with
expect_*()assertions: augmented one-arm binomial and normal posterior means are pinned against their closed-form conjugate values, and the fixed bugs (one-/two-arm dispatch, storedcompareflag, default survival time, two-arm survival summary) are now guarded by tests. Plot calls in tests pass an explicittypeso they no longer prompt for input. - Expanded test coverage from ~60% to ~76%, adding tests for
alpha_discount()andprobability_discount()(both now fully covered), theppexp()vector and matrix paths, theprintmethods (now fully covered), additionalplotbranches, input-validation paths, thebdplogit()main fit path, factor-covariate handling inbdplm()andbdplogit(), and themcdiscounting method forbdpnormalandbdpbinomial - Added regression tests pinning the
bdpnormalflat-prior draw of the mean (posterior_flat_mu) and the fixed current-onlyposterior_muagainst their closed-form conjugate (Student-t) variance - Expanded
method="mc"documentation in the binomial, normal, and survival interfaces/vignettes to note that per-iteration recomputation of the stochastic comparison yields a randomalpha_discountsequence that can show noticeable Monte Carlo variability (#4) - Guarded the plotting tests with a null graphics device so they no longer write a stray
Rplots.pdf
Documentation
- Clarified the
prior_covariate_sddocumentation inbdplm()andbdplogit()to note that covariate effects carry an intentional near-zero discount weight, making their priors effectively flat. The supplied value has negligible influence on the posterior, and the effective prior standard deviation is roughly 1e6 larger than the nominal value at the default (#2)
Housekeeping
- Removed AppVeyor continuous integration
- Updated GitHub Actions workflows to the latest
r-lib/actionsexamples (actions/checkout@v6,codecov/codecov-action@v6,actions/upload-artifact@v7) - Made Codecov upload issues non-fatal in the coverage workflow so tests and coverage generation remain the CI gate while Codecov service/signature failures do not fail the build
- Added a
pkgdownwebsite and accompanying GitHub Actions workflow - Replaced deprecated
ggplot2::aes_string()withaes()and the.datapronoun in allplotmethods - Replaced deprecated
sizeaesthetic withlinewidthingeom_line()calls - De-duplicated the internal
model.matrixBayes()helper (previously defined identically in bothbdplmandbdplogit) into a single internal file - Removed leftover commented-out debugging code
- Collapsed a redundant conditional in
posterior_survival()where both branches initialized identical hazard matrices (#8) - Tidied the
mcsigma2 sampling inbdplm()and kept the sampling weights aligned with the candidate grid when some marginal log-likelihoods are non-finite (#9) -
ppexp()now validates itsxargument and errors with an informative message when it is neither a numeric vector nor a matrix (#10) - Survival curves in the
plotandsummarymethods are now computed with a vectorised C++ routine (ppexpMV) that transposes the hazard matrix once across all time points, instead of loopingppexp()per time point (#11) - Avoided recomputing the per-interval sufficient statistics in
posterior_survival(); the augmentation step now reuses the values already computed during the discount phase (#7) - Removed a redundant
useDynLib()directive in the package namespace - Added contributor guidance documenting the
NEWS.mdsubsection convention for future releases - Expanded
README.mdwith links, supported analyses, examples, and citation guidance (#13) - Added the CRAN package URL to
DESCRIPTION(#14) - Clarified in
posterior_normal()that the flat-prior draw of the mean is the conjugate posterior (scalesqrt(sigma^2 / N)), not the posterior predictive - Gave each vignette a descriptive title (previously all titled “BayesDP”) and removed unused
params/EVALscaffolding from the vignette headers
bayesDP 1.3.7
CRAN release: 2025-01-12
- Updated GitHub actions workflows
- Updated README badges
- Fixed .Rd file itemize list for
bdpbinomial,bdpnormal, andbdpsurvival - Fixed logical check in
bdpsurvival - Fixed spelling mistakes in documentation
- Minor formatting updates
- Add reverse dependency checks
bayesDP 1.3.4
CRAN release: 2021-01-06
- Updates to README and DESCRIPTION
- Updates to .gitignore file
- Add codecov for coverage checking
- Updates to R code formatting
- Added GitHub Actions CI
bayesDP 1.3.3
CRAN release: 2020-02-03
- New package maintainer (Graeme L. Hickey) since package was orphaned
- Updates to README, DESCRIPTION, NAMESPACE
- Added
stopbreak todiscount_logitformethod = mc
bayesDP 1.3.1
CRAN release: 2018-04-11
bayesDP 1.3.0
CRAN release: 2017-12-07
Major new features
- Addition of the
bdplmfunction for two-arm trials - Users can now choose between 3 discount functions via the
discount_functioninput:- Weibull CDF
- Scaled Weibull CDF - scales the Weibull CDF so that the max possible value is 1
- Identity - sets the discount weight to the posterior probability
- Removal of
bdpregression
bayesDP 1.2.0
CRAN release: 2017-07-10
bayesDP 1.1.0
CRAN release: 2017-05-03
Major new features
- Supports two-arm survival analysis via hazard rate comparisons
- Completely revamped summary and print methods to produce better formatted results
- Plot method allows users to specify a
type - Added vignettes for each of
bdpbinomial,bdpnormal, andbdpsurvival - Implemented the
fix_alphainput which allows users to set the historical data weight atalpha_max