Package index
Create Model Specifications
Functions for creating new model specification objects, which describe dynamical models with special support for compartmental modelling. The vignette("quickstart")
article describes how these functions are used in context.
-
mp_tmb_model_spec()
- Create TMB Model Specification
-
mp_per_capita_flow()
mp_per_capita_inflow()
mp_per_capita_outflow()
mp_absolute_flow()
- Specify Flow Between Compartments
-
engine_functions
`+`
`-`
`*`
`/`
`^`
exp
log
`(`
c
matrix
`%*%`
sum
rep
row_sums
col_sums
group_sums
`[`
block
t
rbind_time
rbind_lag
cbind_time
cbind_lag
`:`
seq
convolution
cbind
rbind
time_step
assign
unpack
recycle
clamp
dpois
dnbinom
dnorm
rpois
rnbinom
rnorm
`%x%`
to_diag
from_diag
time_group
cos
print
time_var
rbinom
reulermultinom
round
pgamma
mean
sd
proportions
- Functions Available in the Simulation Engine
Find Model Specifications
Functions for finding, copying, and loading existing model specification objects from model libraries. The vignette("example_models")
article describes how these functions are used in context.
-
mp_tmb_library()
- Read Item from a Model Library
-
mp_show_models()
show_models()
- Print a Table of Existing Models
-
mp_model_starter()
- Copy Existing Model as a Starting Point
Transform Model Specifications
Functions that take a model specification as input and return a modified version of that specification.
-
mp_tmb_insert()
mp_tmb_update()
mp_tmb_delete()
- Transform a TMB Model Spec
-
mp_tmb_insert_reports()
- Insert Reports
-
mp_euler()
mp_rk4()
mp_rk4_old()
mp_euler_multinomial()
mp_hazard()
- Change How State Variables are Updated
-
mp_expand()
mp_reduce()
- Expand Model
Unpack Model Specifications
Functions that extract or print information contained within model specifications.
-
mp_print_spec()
mp_print_before()
mp_print_during()
mp_print_after()
- Print Model Specification
-
mp_initial()
mp_initial_list()
- Initial Values
-
mp_default()
mp_default_list()
- Default Values
-
mp_flow_frame()
- Flow Frame (experimental)
-
mp_change_frame()
- Change Frame
-
mp_state_vars()
- State Variables
-
mp_state_dependence_frame()
- State Dependence Frame
-
mp_simulator()
- Create a Simulator
-
mp_trajectory()
mp_trajectory_sd()
mp_trajectory_ensemble()
mp_trajectory_sim()
mp_trajectory_replicate()
- Trajectory
-
mp_initial()
mp_initial_list()
- Initial Values
-
mp_final()
mp_final_list()
- Final Values
Unpack Model Simulators
Functions that extract or print information contained within model simulators.
-
mp_default()
mp_default_list()
- Default Values
-
mp_tmb()
- Get Underlying TMB Object
-
mp_tmb_calibrator()
- Make TMB Calibrator
-
mp_par()
- Fit Parameters
-
mp_traj()
- Trajectory Specification
-
mp_rbf()
- Fit a Time-Varying Parameter with Radial Basis Functions
-
mp_identity
mp_log
mp_logit
mp_sqrt
- Distributional Parameter Transformation
-
mp_sim_bounds()
- Simulation Bounds (Experimental)
-
mp_time_scale()
- Time Scale
Specify Distributional Assumptions
Functions for specifying distributional assumptions for priors and likelihoods.
-
mp_fit()
mp_nofit()
- Fitting Distributional Parameters
Optimize Calibrator Model
Functions that take a model specification as input and return a modified version of that specification.
-
mp_optimize()
- Optimize
-
mp_optimizer_output()
- Optimizer Output
Generate Calibrated Simulations and Parameters
Functions that generate simulations and tables of fitted parameters from a calibator object.
-
mp_trajectory()
mp_trajectory_sd()
mp_trajectory_ensemble()
mp_trajectory_sim()
mp_trajectory_replicate()
- Trajectory
-
mp_tmb_coef()
- TMB Model Coefficient Table
-
mp_effects_descr()
mp_add_effects_descr()
- Describe Statistical Effects
-
mp_tmb_fixef_cov()
- Covariance of Fixed Effect Estimates
-
mp_tmbstan_coef()
- Model Coefficient Table with stan
Unpack Model Calibrators and Calibrations
Functions that extract or print information contained within model calibrators.
-
mp_tmb()
- Get Underlying TMB Object
Lightweight Simulation
Simple functions for simulation without simulator objects, so that the ?engine_functions
can be explored in isolation from compartmental models.
-
engine_eval()
- Engine Evaluation
-
simple_sims()
- Simple Iterated Simulation
Creating Matrices, Vectors, and Lists
Utilities for constructing matrices, vectors, and lists for use with macpan2
.
-
nlist()
- Self Naming List
-
empty_matrix
- Empty Matrix
-
mp_zero_vector()
- Zero Vector
-
rbf()
- Radial Basis Functions
-
BinaryOperator()
mp_binary_operator()
- Binary Operator
Developer Utilities
Utilities for macpan2
developers. TODO: Justify why these are exposed to users or do not expose.
-
finalizer_char()
finalizer_index()
- Finalizers
-
initial_valid_vars()
- Initial Valid Variables
-
make_expr_parser()
- Generate an Arithmetic Expression Parser
-
mp_tmb_expr_list()
- Expression List
-
Transform()
Identity()
Log()
Logit()
- Transform
Box Diagram Layouts (Not Ready)
Functions for semi-automatically laying out compartments in model specifications as boxes on a plot.
-
mp_layout_grid()
- Flow Diagram Grid Layout (experimental)
-
mp_layout_paths()
- Flow Diagram Grid Layout (experimental)
-
find_all_paths()
- Find all Paths Through Compartments
Structured Populations (Not Ready)
Functions for specifying population structure (e.g., age, space, immunity status).
-
mp_dynamic_model()
- Dynamic Model
-
mp_dynamic_simulator()
- TMB Simulator from Dynamic Model
-
LedgerDefinition
- Ledgers
-
mp_cartesian()
- Cartesian Product of Index Tables
-
mp_extract()
- Extract Index
-
mp_index()
print(<Index>)
names(<Index>)
labelling_column_names(<Index>)
labels(<Index>)
- Model Quantity Index Table
-
mp_join()
- Join Indexes
-
mp_linear()
- Linear Chain Product
-
mp_positions()
- Position Vectors
-
mp_reference()
- Reference Index
-
mp_rename()
- Rename Index Columns
-
mp_square()
- Self Cartesian Product
-
mp_symmetric()
- Symmetric Self Cartesian Product
-
mp_triangle()
- Self Cartesian Product Excluding One Off-Diagonal Side
-
mp_factors()
- Factor an Index
-
mp_group()
- Group an Index
-
mp_labels()
- Index Labels
-
mp_ledgers()
- Bundle up Ledgers
-
mp_lookup()
- Lookup
-
mp_slices()
- Slice an index
-
mp_structured_vector()
mp_set_numbers()
- Structured Vectors
-
mp_subset()
mp_setdiff()
- Subset of Indexes
-
mp_union()
- Union of Indexes
-
to_labels()
to_names()
to_name()
to_name_pairs()
to_values()
- Names and Labels
-
to_positions()
- To Positions
-
to_string()
- To String
-
mp_aggregate()
- Aggregate an Index
-
all_equal()
all_consistent()
not_all_equal()
all_not_equal()
- Comparison Functions