Skip to content

fixes for CRAN - #145

Merged
James-Thorson merged 38 commits into
mainfrom
dev
Nov 22, 2026
Merged

James-Thorson merged 38 commits into
mainfrom
dev

Conversation

@James-Thorson

Copy link
Copy Markdown
Collaborator

No description provided.

James-Thorson-NOAA and others added 30 commits July 1, 2026 08:26
* Speed up model fitting; see details

- With help from Claude's Opus 5.5, did some extensive benchmarking
  trying to figure out why tinyVAST was slower than sdmTMB for
  relatively large SPDE models. Here's what we came up with.
- Overall, ~25-30% faster
- Somewhat reduced memory too

Changes:
- Vectorize apply() over A-matrix on R side (easy win)
- Put tau in GMRF densities
- Make DATA_UPDATE(weights_i) optional; it's slower
- Change nll lines from -1 * d() to -d();
  trivial but strangely seems to interact with DATA_UPDATE speed-up
- Models also seem to often take more nlminb iterations to converge;
  Could be due to parameterization of marginal SD as
  leading parameter rather than 'tau', but that's a more major structural
  change that may not be worth it.

* Fix 2 unit tests

* Delete extra comment

* Fix #141

* Use sampled params for future with project(parm_var = TRUE)

Future Rho/Gamma and Q_ss were built from the fitted parameters
rather than the sampled draw, so parameter uncertainty didn't
propagate into projected process errors

* Add nsim to project() and build TMB objects once across samples

*Much* faster

* Condition future epsilon on separate time and space precisions in project()

* Use report-only TMB objects in project()

Faster again

* Pass full unmapped parameter lists to report objects in project()
@James-Thorson
James-Thorson merged commit 1226c3d into main Nov 22, 2026
13 checks passed
@James-Thorson
James-Thorson deleted the dev branch November 22, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants