multinomialTS 1.1.0
Major changes
The bootstrap generic has been renamed from
boot()tobootstrap(), with the methodbootstrap.mnTS().bootclashed withboot::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 tobootstrap(), and will be removed in a future release.The
story_100_bootstrapsandbootstrap_sensitivitydatasets have been removed. Both were generated by the pre-1.1.0simulate.mnTS()and so no longer reflect what the package produces;bootstrap_sensitivityalso 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. Becauseboot.mnTS()is built onsimulate(), 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. Asizeargument is available to override the default.simulate.mnTS()gains thensimandseedarguments of thestats::simulate()generic. Both were previously accepted and silently ignored. Withnsim > 1the return value is a list ofnsimsimulations.Rows of the simulated
Yat time steps not inTsampleare nowNArather than being filled with invented counts, matching the observation design of the input data.The
REMLargument ofmnGLMM()has been removed. It was documented but never reached the optimiser, soREML = TRUEsilently returned a maximum likelihood fit; the underlying implementation also errored when called directly. PassingREMLnow raises an “unused argument” error.sunfish_pollen_wide’s truncatedP.strobucolumn has been renamed toP.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 themacOS-x86_64assets 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 withliposo a mislabelled architecture fails the build.
Bug fixes
mnTS()now rejects aTsamplethat is not strictly increasing. An out-of-orderTsamplewas previously accepted and returned a model fitted over the wrong time span, with no warning.Tsampleis also checked for whole-number positive indices and for having one entry per row ofY.compute.information.matrix = FALSEnow works in bothmnTS()andmnGLMM(). Both errored with “object not found” because the branch failed to define values used when assembling the result.X = NULLnow works inmnTS(). It is documented as supported, but failed with “Not a matrix.” because RcppArmadillo cannot coerceNULLto a matrix.summary(),coef(),simulate()andboot()all handle no-covariate models.The default
B.fixedandB.startofmnGLMM()were computed fromXafterXhad been rebuilt inside the function, so they had the wrong dimensions and theX = NULLbranch was unreachable. They are now built correctly.mnTS()andmnGLMM()reject a non-positive or non-finitedispersion.fixed/dispersion.start. Because dispersion is log-transformed internally,dispersion.fixed = 0produced-Infand surfaced as an opaque “Mat::elem(): size mismatch” from Armadillo.mnTS()checks thatXhas at leastmax(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()’sn_fail_convergedcounted the sum ofbobyqa’s error codes, so one replicate failing withierr = 5was reported as five failures. It now counts replicates.boot.mnTS()handles models fitted without covariates, and identifies successful replicates withinherits()instead of a list-to-string comparison that broke for multi-class objects.Bootstrapping with a single surviving replicate (e.g.
reps = 1) errored inmatrixStats::colMeans2(), because subsetting the one-row parameter matrix collapsed it to a vector.nparandAICwere wrong wheneverdispersionwas held fixed, which is the default. Undoing the internal log transform ofdispersionassigned into a parameter vector that does not contain it when it is fixed, which appended a spuriousdispersion = NAelement rather than transforming anything.nparwas therefore one too high andAICtwo too high, in bothmnTS()andmnGLMM(). 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$parno longer carries the spuriousNAentry, andlength(object$se) == length(object$par)now holds.print()now dispatches formnTSandmnGLMMobjects. The methods existed but were absent fromNAMESPACE, so an installed package fell through toprint.default.The C++ likelihoods identified free parameters with
find_nonfinite(NaN and infinities) while R usedis.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), andstory_char_matrix(the values are not pre-scaled).story_pollen_wideandsunfish_pollen_wideno longer ship as grouped tibbles.
Internal
mnGLMM()computes its Hessian with the compiled likelihood, asmnTS()already did, and exposeshessian.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-checkworkflow. 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.
