• Removed times_flat_ar1(), which wasn’t well-documented and no longer all that useful to me.

  • Added bss() and friends.

  • Added the argument b= to dmvnorm_diff() for the canonical representation.
  • Enforce spam >= 2.9-2 because of a critical bug fix related to the element-wise multiplication of a full spam object. This led to incorrect densities. Note: if you can’t find a compatible version on CRAN, try the source GitLab, which has tarballs of the packages.

  • Added the diag= argument to conj_matnorm_mu() and conj_matlm_beta() output when params.only=TRUE.

  • diag=TRUE now works for gs_matlm_beta(). It’s slightly slower when the dimensions are small, but MUCH faster when the dimensions get large.

  • Added [dpr]dlnorm() for the discrete log-normal distribution.
  • Fixed a misspecified glue.

  • Changed all the relevant C++ code to include a const declaration, so I don’t regret it later.

  • Removed MASS as a dependency.

  • Added the special case mu=NULL to dmatnorm(), dmvnorm(), and dmvlnorm().

  • Fixed an issue in the multinomial approximations when the number of rows is 1.

  • Added method to sample_multinom_reg() for “mv ind quadratic taylor”.

  • The width= argument is now squared when applied to the variance for various methods, so that it is consistency on the sd scale.

  • Added rdirich() to generate random Dirichlet vectors.
  • Added the times_flat_ar1() function, whose details will undoubtedly come in another release.

  • Documented the diag= argument from v4.3.0.

  • Added the diag= argument to sample_multinom_reg(), for when the precision matrix is diagonal, yielding a speedup (because it can skip calculating the conditional mean).
  • Overhauled sample_multinom_reg(). Where possible, backwards compatibility was maintained, but results will differ because of random seeds and whatnot.
  • Some speed improvements for “mv quadratic taylor” and “mv gamma”.
  • sample_pois_reg():

    • Fixed a bug where “gamma” didn’t actually run the gamma proposal.

    • Fixed the “gamma” metropolis step in cases when mult != 1.

    • Added a “mv gamma” option.

  • Added accept_regardless= argument to sample_pois_reg() and sample_binom_reg()

  • Removed chol_mvrnorm() and all its references. spam:: functions are faster.
  • Saved some time by using C++ pass-by-reference.

  • Added “gamma” proposal to sample_pois_reg().

  • ss_pois_reg() and mh_pois_reg() now have a unified interface: sample_pois_reg(), with slightly different naming conventions for extra arguments.

  • ss_binom_reg() and mh_binom_reg() now have a unified interface: sample_binom_reg(), with slightly different naming conventions for extra arguments.

  • ss_multinom_reg() was renamed to sample_multinom_reg() for consistency, with slightly different naming conventions for extra arguments, and the additional argument method= for future development.

  • ss_multinom_reg() now allows a 3-dimensional z= argument, for a small speed penalty.
  • Added dmvnorm_diff() for taking the difference of two (log-) densities, useful in, e.g. Metropolis-Hastings sampling, but faster than taking individual densities twice.
  • options(spam.structurebased=FALSE).
  • Replaced gs_diagmatlm_beta() with gs_matlm_beta(), which now passes arguments to conj_matlm_beta() through the dots. This includes the new zero= argument, which can be used to recover the performance of gs_diagmatlm_beta().
  • I accidentally padded the results from the changes in v1.2.0 to include the structural zeros, when they shouldn’t have.
  • Added the zero= argument to conj_matnorm_mu() and conj_matlm_beta() to indicate structural zeros. As such, we removed conj_diagmatlm_beta(), which was slightly faster with small inputs, and about the same speed with larger ones. (Author’s note: implementing a special condition for when zero is a diagonal matrix does remedy the small inputs speed difference, but I decided it wasn’t worth maintaining more code for something that’s already very fast).

  • Added the derivation of the above conjugate case to the vignette.

  • Sped up conj_diagmatlm_beta() (and hence gs_diagmatlm_beta()) by taking the linear algebra a few steps further.
  • Added is.gu_chol(), and now allow for passing of newQ.chol= to be taken into account when sampling with spam::rmvnorm.canonical() (by appending the gu_chol class, which doesn’t take the Cholesky another time). Notably, this doesn’t work for spam objects, because they are S4.

  • chol.gu_chol() gained a verbose= argument (mostly for debugging).

  • gu_chol() gained a take.chol= argument, to mark existing Cholesky matrices as such without taking chol() again.

  • Fixed a bug when params.only=TRUE and the input newQ.chol= is just a regular matrix.

  • Overhauled the conjugate normal functions, to use spam::rmvnorm.canonical() instead of taking two inverses. This method is slower than what we had before when inputs are really small (when the conjugacy is super fast anyway, so I wasn’t worried) but almost 2x faster when inputs are big. Furthermore, we can get more performance when inputs are spam objects already.

  • spam was added as a dependency.

  • Replaced crossprod(x, y) with t(x) %*% y in almost all instances, to be compatible with, e.g., the spam package for sparse matrices.

  • Fixed a typo in the vignette

  • Applied the same vectorization trick to dmatnorm(), for speed gains of over 1000x for large inputs. The default for U= is also now NULL, indicating the identity matrix.
  • Removed the use_trace= argument introduced in v0.9.3. When x was short, the trace was faster. When x= was long, the non-trace method was faster. Now, using a vectorization trick with the trace, dmvnorm() is always at least as fast (and usually faster) than either of the previous methods.
  • Also return V.inv for conjugate Wishart parameters, tau for conjugate normal, and Q for some other normal conjugate cases where newQ.inv= has not already been supplied.

  • Changed the defaults (but not the default behavior) for some normal conjugates.

  • Changed the default for the use_trace= argument introduced in v0.9.3, because in my experience it’s faster not to use the matrix trace.
  • Add the same mu0 = NULL default to gs_diagmatlm_beta().
  • Speed up (slightly) the conjugacy functions using a default of mu0 = NULL to indicate zero. This also allows you to give infinite precisions when mu0 = NULL = 0 (which would otherwise give Inf * 0 = NaN).
  • Added mh_pois_reg().

  • Added proposal="mv quadratic taylor" to mh_binom_reg() to do multivariate Taylor’s approximations and MH steps.

  • Added an option to dmvnorm() to opt out of the matrix trace.
  • Sped up dmvnorm() by using the matrix trace instead of a for-loop.
  • Changed the n == k == 0 sampling to C++ for ss_binom_reg() and mh_binom_reg()

  • ss_pois_reg() now accepts NA in k=, to indicate that no Poisson draw was observed.

  • Renamed conj_matlm_sigma() to conj_matlm_V(). It, along with conj_matnorm_V(), now both use conj_mvnorm_Q() in the case that U = NULL (independence among rows).
  • Added truncnorm as a package dependency.

  • Added gs_diagmatlm_beta() to Gibbs-sample truncated normal diagonal matrix-normal regression means.

  • cond_mvnorm() gained optional truncation parameters

  • Updated the vignettes to improve the custom LaTeX code that wasn’t previously handled by HTML output.

  • Improved printing of "gibbs_utils_params" objects.

  • ss_multinom_reg() now also uses normal draws in the case where z == 0 or n == 0. This is not done multivariately, but rather univariately.

  • ss_multinom_reg() now accepts numeric values for the ref= argument, to allow inner “columns” to be the reference.

  • Sped up the multivariate binomial, multinomial, and Poisson likelihood evaluations (only completing the square once instead of each time), so that

    • ss_pois_reg() is as much as 6.5x faster

    • ss_multinom_reg() is as much as 1.6x faster

    • ss_binom_reg() is as much as 4.5x faster

    • mh_binom_reg() is as much as 2x faster.

    As such, there are no longer C++ functions to evaluate the multivariate log-likelihoods (nor the slice sample functions to do the same); instead, the conditional means are computed within cond_mv_mean(), and the results passed to the univariate likelihoods.

  • Overhauled mh_binom_reg(). It now takes a proposal= argument, to determine how proposals are made. The “normal” method is the default for backwards-compatibility, but the “quadratic taylor” gives better results and is about the same speed. The C++ internals have also been almost completely rewritten.

  • Updated mh_binom_reg() and ss_binom_reg() to take normal draws in the multivariate case when only one n= is zero instead of only doing it when all the n=’s are zero.

  • mh_binom_reg() now enforces k <= n

  • Fixed one critical bug in mh_binom_reg() in which the log-likelihood evaluations were using k= instead of n=.

  • ss_binom_reg() now performs conjugate normal updates when n == 0 (or rowSums(n) == 0 in the multivariate case).

  • ss_binom_reg() now enforces k <= n

  • Fixed a bug in chol_mvrnorm().

  • Small performance improvements for conj_mvnorm().
  • Added conj_binom_p() for the beta conjugacy for a binomial probability.

  • Fixed a bug in ss_multinom_reg() when dimensions were length 1.

  • A bug fix for slice sampling multinomial.
  • Added some arguments for speed and efficiency, and therefore removed some parameters if params.only = TRUE.
  • Updated vignettes.

  • Added conj_diagmatlm_beta().

  • Added tests for conjugacy.

  • Added ref= argument to ss_multinom_reg().
  • Sped up multinomial log-likelihood by avoiding exponentiation altogether for structural zeros.

  • Changed the acceptable dimensions of mean= and precision= in ss_multinom_reg()

  • Sped up sampling (by maybe 15%?) by avoiding repeated subsetting of k and n.

  • Added ss_multinom_reg().

  • Sped up binomial log-likelihood (by a non-trivial amount) by avoiding an exponentiation.
  • Added a pkgdown site (and README.md).

  • Added the params.only= argument to conjugacy functions.

  • Added impute_conj_mvnorm().

  • Include an option to use (the new function) chol_mvrnorm() to draw multivariate normal samples instead of MASS::mvrnorm() (which uses eigen decomposition instead of Cholesky).
  • Defer to stats::rWishart() instead of rwish(), since the former is faster.

  • Added mh_binom_reg() (and proceeded to fix one critical bug in 61de4f70).

  • Sped up multivariate log-likelihood.

  • Fixed one test.

  • Updated ss_pois_reg() and ss_binom_reg() to allow for matrix (multivariate) inputs.

  • Added tests.

  • Updated ss_binom_reg() to take in and output logit-p instead of p.
  • Improved matrix normal conjugacies by using a Kronecker product trick.
  • Fixed a bug in defaults for conj_mvnorm_mu(), where the length was accidentally the number of observations instead of variables.

  • Improved documentation.

  • Improved checking for matrix arguments.

Initial version of package