Changelog
Source:NEWS.md
BAS 1.7.3
CRAN release: 2024-09-17
- reverted back to code using
SETLENGTH
(issue #82) to address stack imbalance issues seen in interactive checks and not flagged inR CMD check
.
BAS 1.7.2
CRAN release: 2024-09-16
added
method="AMCMC"
forbas.lm
to use adaptive independent Metropolis Hastings for sampling models. With optionimportance.sampling = TRUE
the adaptive independent proposal and be used for importance sampling with improved estimation of model probabilities and inclusion probabilities based on the Horivitz-Thompsom / Hajek estimator.added unit tests for link functions implemented in
family.c
fixed (issue #81) Removed legacy definitions of ‘PI’ and ‘Free’ and replaced with‘M_PI’ and ‘R_Free’ to comply with ‘STRICT_R_HEADERS’ prevent package removal on 9/23/2024
fixed (issue #82) avoid SETLENGTH as non-API function when truncating vectors
BAS 1.7.1
CRAN release: 2023-12-06
Minor Improvements and Fixes
Initialized vector
se
viamemset
anddisp = 1.0
infit_glm.c
(issue #72)Initialized variables in
hyp1f1.c
fromtestthat
(issue #75)Removed models that have zero prior probability in
bas.lm
andbas.glm
(issue #74)Fixed error in
bayesglm.fit
to check argumentsx
ory
for correct type before calling C and added unit test (issue #67)
BAS 1.6.6
CRAN release: 2023-11-28
New Features
Added support for
Gamma
regression forbas.glm
, with unit tests and example (Code contributed by @betsyberrson)added error if supplied initial model for the
bas.lm
sampling methods “MCMC” and “MCMC+BAS” had prior probability zero.fixed printing problems as identified via checks
fixed indexing error for
bas.lm
andmethod = "MCMC+BAS"
asbas.lm
usingmethod = "MCMC+BAS"
crashed with a segmentation fault ifbestmodel
is not NULL or the null model. GitHub issue #69fixed error in
predict.bas
withse.fit=TRUE
if there is only one predictor. GitHub issue #68 reported by @AleCarminati added unit test totest-predict.R
Fixed error in
coef
forbas.glm
objects when using abetaprior
of class IC, including AIC and BIC Github issue #65Fixed error when using
Jeffreys
prior inbas.glm
with theinclude.always
option and added unit test intest-bas-glm.R
.
Github issue #61Fixed error for extracting coefficients from the median probability model when a formula is passed as an object rather than a literal, and added a unit test to
test-coefficients.R
Github issues #39 and #56
BAS 1.6.4
CRAN release: 2022-11-02
Changes
- skipped test on CRAN that fails to show a warning in the non full rank case when
pivot=FALSE
forbas.lm
as default uses pivoting and documentation indicates thatpivot=FALSE
should only be used in the full rank case so that users should not encounter this issue in practice. Users will continue to see a warning of NA’s are returned, but should be aware that not all platforms may produce a warning (such as M1mac). Github issue #62
BAS 1.6.3
CRAN release: 2022-10-19
Changes
Added checks and unit-tests to see if modelprior is of class ‘prior’ resolving Github Issue #57
Removed
polevl.c
,psi.c
andgamma.c
from Cephes as no longer used after switching toR
’s internal functions
BAS 1.6.2
CRAN release: 2022-04-26
- replaced deprecated
DOUBLE_EPS
withDBL_EPSILON
for R 4.2.0 release (in two places) so restore on CRAN
BAS 1.6.1
Changes
replaced deprecated
DOUBLE_EPS
withDBL_EPSILON
for R 4.2.0 releasefixed warnings from CRAN checks for under R devel (use of | and
if
withclass
)added a function
trCCH
that uses integration to compute the normalizing constant in the Truncated Compound Confluent Hypergeometric distribution that provides the correct normalizing constant for Gordy (1998) and is more stable for large values compared to the currentphi1
function. This is now used in theTCCH
prior forbas.glm
.Rewrote
phi1
function to use direct numerical integration (phi1_int
) when Wald statistic is large so that marginal likelihoods are not NA as suggested by Daniel Heeman and Alexander Ly (see below). This should improve stability of estimates of Bayes Factors and model probabilities frombas.glm
that used theHyperTwo
function, including coefficient priors forhyper.g.n()
,robust()
, andintrinsic()
. Added additional unit tests.Added
thin
as an option forbas.glm
added unit tests and examples to show the connections between the special functions
trCCH
,phi1
,1F1
and2F1
BAS 1.5.5
CRAN release: 2020-01-24
Changes
Fixed WARNING under fedora-clang-devel. Added climate.dat file to package for building vignette so that package does not violate CRAN’s policy for accessing internet resources and is more permanent if file location/url changes locally.
Fixed testthat errors under Solaris. Default settings for
force.heredity
is set back to FALSE inbas.lm
andbas.glm
so that methods work on all platforms. For Solaris, users who wish to impose theforce.heredity
constraint may use the post-processing function.
BAS 1.5.4
CRAN release: 2020-01-19
Features
- Modified prior probabilities to adjust for the number of variables always included when using include.always. Pull request #41 by Don van de Bergh. Issue #40
Bug Fixes
Fixed valgrind error in src/ZS_approx_null_np.c for invalid write noted in CRAN checks
fixed function declaration type-mismatch and argument errors identified by LTO noted in CRAN checks
Added
contrast=NULL
argument tobas.lm
andbas.glm
so that non-NULL contrasts do not trigger warning inmodel.matrix
as of R 3.6.0. Bug #44Added check for sample size equal to zero due to subsetting or missing data Bug #37
BAS 1.5.3
CRAN release: 2018-10-30
Bug Fixes
Fixed errors identified on cran checks https://cran.r-project.org/web/checks/check_results_BAS.html
initialize R2_m = 0.0 in lm_mcmcbas.c (lead to NA’s with clang on debian and fedora )
switch to default of
pivot = TRUE
inbas.lm
, addingtol
as an argument to control tolerance incholregpovot
for improved stability across platforms with singular or nearly singular designs.valgrind messages: Conditional jump or move depends on uninitialized value(s). Initialize vectors allocated via R_alloc in lm_deterministic.c and glm_deterministic.c.
BAS 1.5.2
CRAN release: 2018-10-25
Features
Included an option
pivot=TRUE
inbas.lm
to fit the models using a pivoted Cholesky decomposition to allow models that are rank-deficient. Enhancement #24 and Bug #21. Currently coefficients that are not-estimable are set to zero so thatpredict
and other methods will work as before. The vectorrank
is added to the output (see documentation forbas.lm
) and the degrees of freedom methods that assume a uniform prior for obtaining estimates (AIC and BIC) are adjusted to userank
rather thansize
.Added option
force.heredity=TRUE
to force lower order terms to be included if higher order terms are present (hierarchical constraint) formethod='MCMC'
andmethod='BAS'
withbas.lm
andbas.glm
. Updated Vignette to illustrate. enhancement #19. Checks to see if parents are included usinginclude.always
pass issue #26.Added option
drop.always.included
toimage.bas
so that variables that are always included may be excluded from the image. By default all are shown enhancement #23Added option
drop.always.included
andsubset
toplot.bas
so that variables that are always included may be excluded from the plot showing the marginal posterior inclusion probabilities (which=4
). By default all are shown enhancement #23update
fitted.bas
to use predict so that code covers both GLM and LM cases withtype='link'
ortype='response'
Updates to package for CII Best Practices Badge certification
Added Code Coverage support and more extensive tests using
test_that
.
Bugs
fixed issue #36 Errors in prior = “ZS-null” when R2 is not finite or out of range due to model being not full rank. Change in
gexpectations
function in filebayesreg.c
fixed issue #35 for
method="MCMC+BAS"
inbas.glm
inglm_mcmcbas.c
when no values are provided forMCMC.iterations
orn.models
and defaults are used. Added unit test intest-bas-glm.R
fixed issue #34 for
bas.glm
where variables ininclude.always
had marginal inclusion probabilities that were incorrect. Added unit test intest-bas-glm.R
fixed issue #33 for Jeffreys prior where marginal inclusion probabilities were not renormalized after dropping intercept model
fixed issue #32 to allow vectorization for
phi1
function in R/cch.R and added unit test to “tests/testthat/test-special-functions.R”fixed issue #31 to coerce
g
to be a REAL forg.prior
prior andIC.prior
inbas.glm
; added unit-test “tests/testthat/test-bas-glm.R”fixed issue #30 added n as hyper-parameter if NULL and coerced to be a REAL for
intrinsic
prior inbas.glm
; added unit-testfixed issue #29 added n as hyper-parameter if NULL and coerced to be a REAL for
beta.prime
prior inbas.glm
; added unit-testfixed issue #28 fixed length of MCMC estimates of marginal inclusion probabilities; added unit-test
fixed issue #27 where expected shrinkage with the JZS prior was greater than 1. Added unit test.
fixed output
include.always
to include the intercept issue #26 always so thatdrop.always.included = TRUE
drops the intercept and any other variables that are forced in.include.always
andforce.heredity=TRUE
can now be used together withmethod="BAS"
.added warning if marginal likelihoods/posterior probabilities are NA with default model fitting method with suggestion that models be rerun with
pivot = TRUE
. This uses a modified Cholesky decomposition with pivoting so that if the model is rank deficient or nearly singular the dimensionality is reduced. Bug #21.corrected count for first model with
method='MCMC'
which lead to potential model with 0 probability and errors inimage
.coerced predicted values to be a vector under BMA (was a matrix)
fixed
size
with usingmethod=deterministic
inbas.glm
(was not updated)fixed problem in
confint
withhorizontal=TRUE
when intervals are point mass at zero.
Other
suppress
warning
when sampling probabilities are 1 or 0 and the number of models is decremented
Issue #25changed
force.heredity.bas
to re-normalize the prior probabilities rather than to use a new prior probability based on heredity constraints. For future, add new priors for models based on heredity. See comment on issue #26.Changed License to GPL 3.0
BAS 1.5.1 June 6, 2018
CRAN release: 2018-06-07
BAS 1.5.0 May 2, 2018
CRAN release: 2018-05-03
Features
add na.action for handling NA’s for predict methods issue #10
added
include.always
as new argument tobas.lm
. This allows a formula to specify which terms should always be included in all models. By default the intercept is always included.added a section to the vignette to illustrate weighted regression and the
force.heredity.bas
function to group levels of a factor so that they enter or leave the model together.
BAS 1.4.9 March 24, 2018
CRAN release: 2018-03-25
BAS 1.4.8 March 10, 2018
CRAN release: 2018-03-12
Bugs
fixed issue with scoping in eval of data in
predict.bas
if dataname is defined in local env.fixed issue 10 in github (predict for estimator=‘BPM’ failed if there were NA’s in the X data. Delete NA’s before finding the closest model.
fixed bug in ‘JZS’ prior - merged pull request #12 from vandenman/master
fixed bug in bas.glm when default betaprior (CCH) is used and inputs were INTEGER instead of REAL
removed warning with use of ‘ZS-null’ for backwards compatibility
BAS 1.4.7 October 22, 2017
CRAN release: 2017-10-22
Updates
Added new method for
bas.lm
to obtain marginal likelihoods with the Zellner-Siow Priors for “prior= ‘JZS’ using QUADPATH routines for numerical integration. The optional hyper parameter alpha may now be used to adjust the scaling of the ZS prior where g ~ G(1/2, alpha*n/2) as in theBayesFactor
package of Morey, with a default of alpha=1 corresponding to the ZS prior used in Liang et al (2008). This also uses more stable evaluations of log(1 + x) to prevent underflow/overflow.Priors
ZS-full
for bas.lm is planned to be deprecated.replaced math functions to use portable C code from Rmath and consolidated header files
BAS 1.4.6 May 24, 2017
CRAN release: 2017-05-26
Updates
- Added force.heredity.interaction function to allow higher order interactions to be included only if their “parents” or lower order interactions or main effects were included. Currently tested with two way interactions. This is implemented post-sampling; future updates will add this at the sampling stage which will reduce memory usage and sampling times by reducing the number of models under consideration.
BAS 1.4.4 March 14, 2017
CRAN release: 2017-03-14
Updates
Extract coefficient summaries, credible intervals and plots for the
HPM
andMPM
in addition to the defaultBMA
by adding a newestimator
argument to thecoef
function. The newn.models
argument tocoef
provides summaries based on the topn.models
highest probability models to reduce computation time. ‘n.models = 1’ is equivalent to the highest probability model.use of newdata that is a vector is now deprecated for predict.bas; newdata must be a dataframe or missing, in which case fitted values based on the dataframe used in fitting is used
factor levels are handled as in
lm
orglm
for prediction when there may be only level of a factor in the newdata
BAS 1.4.3 February 18, 2017
CRAN release: 2017-02-21
Updates
- Register symbols for foreign function calls
- bin2int is now deprecated
- fixed default MCMC.iteration in
bas.lm
to agree with documentation - updated vignette to include more examples, outlier detection, and finding the best predictive probability model
- set a flag for MCMC sampling
renormalize
that selects whether the Monte Carlo frequencies are used to estimate posterior model and marginal inclusion probabilities (defaultrenormalize = FALSE
) or that marginal likelihoods time prior probabilities that are renormalized to sum to 1 are used. (the latter is the only option for the other methods); new slots for probne0.MCMC, probne0.RN, postprobs.RN and postprobs.MCMC.
BAS 1.4.1 September 17, 2016
CRAN release: 2016-09-20
BAS 1.4.0 August 25, 2016
CRAN release: 2016-08-27
New features
- added
na.action
forbas.lm
andbas.glm
to omit missing data. - new function to plot credible intervals created by
confint.pred.bas
orconfint.coef.bas
. See the help files for an example or the vignette. - added
se.fit
option inpredict.basglm
. - Added
testBF
as abetaprior
option forbas.glm
to implement Bayes Factors based on the likelihood ratio statistic’s distribution for GLMs. - DOI for this version is http://dx.doi.org/10.5281/zenodo.60948
BAS 1.3.0 July 15, 2016
CRAN release: 2016-07-16
New Features
A vignette has been added at long last! This illustrates several of the new features in BAS
such as
- new functions for computing credible intervals for fitted and predicted values
confint.pred.bas()
- new function for adding credible intervals for coefficients
confint.coef.bas()
- added posterior standard deviations for fitted values and predicted values in
predict.bas()
BAS 1.2.2 June 29, 2016
CRAN release: 2016-07-01
New Features
- added option to find “Best Predictive Model” or “BPM” for
fitted.bas
orpredict.bas
- added local Empirical Bayes prior and fixed g-prior for
bas.glm
- added
diagnostic()
function for checking convergence ofbas
objects created withmethod = "MCMC"
” - added truncated power prior as in Yang, Wainwright & Jordan (2016)
BAS 1.2.1 April 16, 2016
CRAN release: 2016-04-16
- bug fix for method=“MCMC” with truncated prior distributions where MH ratio was incorrect allowing models with 0 probability to be sampled.
- fixed error in Zellner-Siow prior (ZS-null) when n=p+1 or saturated model where log marginal likelihood should be 0
BAS 1.2.0 April 11, 2016
CRAN release: 2016-04-12
- removed unsafe code where Rbestmarg (input) was being overwritten in .Call which would end up in corruption of the constant pool of the byte-code (Thanks to Tomas Kalibera for catching this!)
- fixed issue with dimensions for use with Simple Linear Regression
BAS 1.1.0 March 31, 2016
CRAN release: 2016-03-31
BAS 1.07
- added phi1 function from Gordy (1998) confluent hypergeometric
function of two variables also known as one of the Horn
hypergeometric functions or Humbert's phi1
- added Jeffrey's prior on g
- added the general tCCH prior and special cases of the hyper-g/n.
- TODO check shrinkage functions for all
BAS 1.06
- new improved Laplace approximation for hypergeometric1F1
- added class basglm for predict
- predict function now handles glm output
- added dataframe option for newdata in predict.bas and predict.basglm
- renamed coefficients in output to be 'mle' in bas.lm to be consistent across
lm and glm versions so that predict methods can handle both
cases. (This may lead to errors in other external code that
expects object$ols or object$coefficients)
- fixed bug with initprobs that did not include an intercept for bas.lm
BAS 1.05
- added thinning option for MCMC method for bas.lm
- returned posterior expected shrinkage for bas.glm
- added option for initprobs = "marg-eplogp" for using marginal
SLR models to create starting probabilities or order variables
especially for p > n case
- added standalone function for hypergeometric1F1 using Cephes
library and a Laplace approximation
-Added class "BAS" so that predict and fitted functions (S3
methods) are not masked by functions in the BVS package: to do
modify the rest of the S3 methods.
BAS 0.85
CRAN release: 2010-04-29
restricting n.models
correct fitted values (broken in version 0.80)
BAS 0.80
CRAN release: 2010-04-06
- Added `hypergeometric2F1` function that is callable by R
- centered X's in bas.lm so that the intercept has the correct
shrinkage - changed predict.bma
to center newdata using the mean(X) - Added new Adaptive MCMC option (method = “AMCMC”) (this is not stable at this point)
BAS 0.2
column of ones for the intercept optionally included. - fixed help file for predict - added modelprior argument to bas.lm so that users may now use the beta-binomial prior distribution on model size in addition to the default uniform distribution - added functions uniform(), beta-binomial() and Bernoulli() to create model prior objects - added a vector of user specified initial probabilities as an option for argument initprobs in bas.lm and removed the separate argument user.prob