Skip to contents

multinomialTS 1.1.0

Major changes

  • The bootstrap generic has been renamed from boot() to bootstrap(), with the method bootstrap.mnTS(). boot clashed with boot::boot() from the recommended package, which ships with every R installation: whichever package was attached second masked the other. boot() still works as a deprecated wrapper that warns and forwards to bootstrap(), and will be removed in a future release.

  • The story_100_bootstraps and bootstrap_sensitivity datasets have been removed. Both were generated by the pre-1.1.0 simulate.mnTS() and so no longer reflect what the package produces; bootstrap_sensitivity also accounted for 99% of the installed data. Bootstrap output is model-version dependent, so it is no longer bundled. The vignettes show the code instead — the main vignette plots a small bootstrap run live, and the Sunfish Pond vignette carries the wrangling and plotting code un-executed for reference.

  • simulate.mnTS() now draws each replicate using the observed multinomial totals rather than a hard-coded size of 100. Because boot.mnTS() is built on simulate(), every bootstrap replicate previously carried far more observation noise than the real data, which inflated bootstrapped standard errors and attenuated coefficients. Bootstrap results produced with earlier versions should be re-run. A size argument is available to override the default.

  • simulate.mnTS() gains the nsim and seed arguments of the stats::simulate() generic. Both were previously accepted and silently ignored. With nsim > 1 the return value is a list of nsim simulations.

  • Rows of the simulated Y at time steps not in Tsample are now NA rather than being filled with invented counts, matching the observation design of the input data.

  • The REML argument of mnGLMM() has been removed. It was documented but never reached the optimiser, so REML = TRUE silently returned a maximum likelihood fit; the underlying implementation also errored when called directly. Passing REML now raises an “unused argument” error.

  • sunfish_pollen_wide’s truncated P.strobu column has been renamed to P.strobus.

  • Intel macOS binaries are no longer published. Releases now ship a Windows binary and an Apple Silicon (macOS-arm64) binary. Every standard macOS machine GitHub Actions offers is Apple Silicon — the last free Intel image has been retired — and R packages with compiled code cannot be cross-compiled. Intel mac users should install from source; see the README. Note that the macOS-x86_64 assets in releases up to v1.0.3 were themselves built on Apple Silicon and would not load on an Intel mac, so this removes an asset that did not work rather than one that did. Release binaries are now checked with lipo so a mislabelled architecture fails the build.

Bug fixes

  • mnTS() now rejects a Tsample that is not strictly increasing. An out-of-order Tsample was previously accepted and returned a model fitted over the wrong time span, with no warning. Tsample is also checked for whole-number positive indices and for having one entry per row of Y.

  • compute.information.matrix = FALSE now works in both mnTS() and mnGLMM(). Both errored with “object not found” because the branch failed to define values used when assembling the result.

  • X = NULL now works in mnTS(). It is documented as supported, but failed with “Not a matrix.” because RcppArmadillo cannot coerce NULL to a matrix. summary(), coef(), simulate() and boot() all handle no-covariate models.

  • The default B.fixed and B.start of mnGLMM() were computed from X after X had been rebuilt inside the function, so they had the wrong dimensions and the X = NULL branch was unreachable. They are now built correctly.

  • mnTS() and mnGLMM() reject a non-positive or non-finite dispersion.fixed/dispersion.start. Because dispersion is log-transformed internally, dispersion.fixed = 0 produced -Inf and surfaced as an opaque “Mat::elem(): size mismatch” from Armadillo.

  • mnTS() checks that X has at least max(Tsample) rows instead of failing with “Mat::col(): index out of bounds”.

  • coef.mnTS() no longer errors when the model was fitted without an information matrix.

  • boot.mnTS()’s n_fail_converged counted the sum of bobyqa’s error codes, so one replicate failing with ierr = 5 was reported as five failures. It now counts replicates.

  • boot.mnTS() handles models fitted without covariates, and identifies successful replicates with inherits() instead of a list-to-string comparison that broke for multi-class objects.

  • Bootstrapping with a single surviving replicate (e.g. reps = 1) errored in matrixStats::colMeans2(), because subsetting the one-row parameter matrix collapsed it to a vector.

  • npar and AIC were wrong whenever dispersion was held fixed, which is the default. Undoing the internal log transform of dispersion assigned into a parameter vector that does not contain it when it is fixed, which appended a spurious dispersion = NA element rather than transforming anything. npar was therefore one too high and AIC two too high, in both mnTS() and mnGLMM(). Comparisons among models that all fix dispersion were unaffected (the offset was constant), but reported AIC values were wrong and comparing a fixed-dispersion model against one that estimates dispersion was biased. object$par no longer carries the spurious NA entry, and length(object$se) == length(object$par) now holds.

  • print() now dispatches for mnTS and mnGLMM objects. The methods existed but were absent from NAMESPACE, so an installed package fell through to print.default.

  • The C++ likelihoods identified free parameters with find_nonfinite (NaN and infinities) while R used is.na() (NaN only), so a non-finite fixed parameter silently misaligned the parameter vector.

Documentation

  • All exported functions now have runnable examples.

  • Corrected the documented format of story_100_bootstraps (a matrix, not a list), sunfish_ll (4 columns, not 2), and story_char_matrix (the values are not pre-scaled).

  • story_pollen_wide and sunfish_pollen_wide no longer ship as grouped tibbles.

Internal

  • mnGLMM() computes its Hessian with the compiled likelihood, as mnTS() already did, and exposes hessian.method.args.

  • The pure-R likelihoods have moved out of R/ into the test suite, where they serve as the reference implementations the C++ is checked against.

  • Added an R-CMD-check workflow. The macOS Intel binary is now built on an Intel runner and its architecture is verified; both macOS binaries previously came from the same Apple Silicon runner.