-
Notifications
You must be signed in to change notification settings - Fork 53
Modifying parameters and data
Jim Thorson edited this page Jan 24, 2021
·
1 revision
For advanced users, it is sometimes convenient to modify the default data and parameters that are created using the high level wrapper fit_model
or even the internal logical functions make_data
, make_map
or make_parameters
. This can be useful e.g. to:
- Specify restrictions on covariate effects to be constant among species;
- Specify restrictions on loadings matrices to implement delta-change methods, such that individual variables are driven by the same spatio-temporal factors;
- Modify the extrapolation-area constructions to fine-tune area expansion methods;
- Modify the coordinates used when calculating center-of-gravity; and for many other reasons.
These changes can generally be accomplished by first building the model without running it, then making modifications as needed, and the passing those modified inputs to overwrite the default constructions.
# Initial fit
fit_orig = fit_model( ...,
build_model = FALSE )
# Extract default constructions
data_custom = fit_orig$data_list
map_custom = fit_orig$tmb_list$Map
parameters_custom = fit_orig$tmb_list$Parameters
# Modify inputs as needed
# [Insert stuff here]
# Pass and run model
fit_orig = fit_model( ...,
data = data_custom,
Parameters = parameters_custom,
Map = map_custom )
We here illustrate a few specific examples.
[To be added by Alexa Fredston]
Example applications:
- Index standardization
- Empirical Orthogonal Functions
- Ordination using joint species distribution model
- End-of-century projections
- Expand length and age-composition samples
- Combine condition and biomass data
- Expand stomach content samples
- Combine presence/absence, counts, and biomass data
- Seasonal and annual variation
- Combine acoustic and bottom trawl data
- Surplus production models
- Multispecies model of biological interactions
- Stream network models
Usage demos:
- Adding covariates
- Visualize covariate response
- Percent deviance explained
- Create a new extrapolation grid
- Custom maps using ggplot
- Modify axes for distribution metrics
- K-fold crossvalidation
- Simulating new data
- Modify defaults for advanced users
Project structure and utilities: