Package: macpan2 3.5.1

macpan2: Fast and Flexible Compartmental Modelling
Tools for building and calibrating compartmental models of infectious disease.
Authors:
macpan2_3.5.1.tar.gz
macpan2_3.5.1.zip(r-4.7)macpan2_3.5.1.zip(r-4.6)macpan2_3.5.1.zip(r-4.5)
macpan2_3.5.1.tgz(r-4.6-x86_64)macpan2_3.5.1.tgz(r-4.6-arm64)macpan2_3.5.1.tgz(r-4.5-x86_64)macpan2_3.5.1.tgz(r-4.5-arm64)
macpan2_3.5.1.tar.gz(r-4.7-arm64)macpan2_3.5.1.tar.gz(r-4.7-x86_64)macpan2_3.5.1.tar.gz(r-4.6-arm64)macpan2_3.5.1.tar.gz(r-4.6-x86_64)
macpan2_3.5.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
card.svg |card.png
macpan2/json (API)
NEWS
| # Install 'macpan2' in R: |
| install.packages('macpan2', repos = c('https://canmod.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/canmod/macpan2/issues
Pkgdown/docs site:https://canmod.github.io
compartmental-modelsepidemiologyforecastingmixed-effectsmodel-fittingoptimizationsimulationsimulation-modelingcpp
Last updated from:13837d8225. Checks:13 OK. Indexed: yes.
| Target | Result | Time | Files | Syslog |
|---|---|---|---|---|
| linux-devel-arm64 | OK | 340 | ||
| linux-devel-x86_64 | OK | 366 | ||
| source / vignettes | OK | 580 | ||
| linux-release-arm64 | OK | 334 | ||
| linux-release-x86_64 | OK | 382 | ||
| macos-release-arm64 | OK | 366 | ||
| macos-release-x86_64 | OK | 722 | ||
| macos-oldrel-arm64 | OK | 376 | ||
| macos-oldrel-x86_64 | OK | 690 | ||
| windows-devel | OK | 340 | ||
| windows-release | OK | 331 | ||
| windows-oldrel | OK | 338 | ||
| wasm-release | OK | 196 |
Exports:all_consistentall_equalall_not_equalBinaryOperatorCSVReaderdot_layoutempty_matrixempty_trajectoryengine_evalfind_all_pathsJSONReaderLogLogitmp_absolute_flowmp_adjacencymp_aggregatemp_binary_operatormp_cartesianmp_change_framemp_defaultmp_default_listmp_discrete_stochmp_dot_layoutmp_dynamic_modelmp_dynamic_simulatormp_dynamic_varsmp_effects_descrmp_eulermp_euler_multinomialmp_expandmp_extractmp_factorsmp_finalmp_final_listmp_fitmp_flow_framemp_flow_varsmp_forecastermp_functions_usedmp_generates_randomnessmp_groupmp_hazardmp_identitymp_indexmp_inflowmp_initialmp_initial_listmp_joinmp_kronecker_operatormp_labelsmp_layout_gridmp_layout_pathsmp_ledgersmp_linearmp_list_modelsmp_lnormmp_logmp_log_normalmp_log1pmp_logitmp_logit_normalmp_logitnormmp_lookupmp_model_docsmp_model_startermp_nbinommp_neg_binmp_nofitmp_normmp_normalmp_official_librarymp_opt_attemptedmp_optimizemp_optimized_specmp_optimizer_outputmp_other_dynamic_varsmp_outflowmp_parmp_parameterizationmp_per_capita_flowmp_per_capita_inflowmp_per_capita_outflowmp_poismp_poissonmp_positionsmp_print_aftermp_print_beforemp_print_duringmp_print_obj_fnmp_print_specmp_rbfmp_read_rdsmp_reducemp_referencemp_renamemp_rk4mp_rk4_oldmp_set_numbersmp_setdiffmp_show_modelsmp_sim_boundsmp_sim_offsetmp_simulatormp_slicesmp_sqrtmp_squaremp_state_dependence_framemp_state_flow_varsmp_state_varsmp_structured_vectormp_subsetmp_symmetricmp_time_scalemp_tmbmp_tmb_calibratormp_tmb_coefmp_tmb_deletemp_tmb_entire_librarymp_tmb_expr_listmp_tmb_fixef_covmp_tmb_implicit_backtransmp_tmb_implicit_transmp_tmb_insertmp_tmb_insert_backtransmp_tmb_insert_glm_timevarmp_tmb_insert_log_linearmp_tmb_insert_reportsmp_tmb_insert_transmp_tmb_librarymp_tmb_model_specmp_tmb_objectivemp_tmb_profilemp_tmb_updatemp_tmbstan_coefmp_trajmp_trajectorymp_trajectory_ensemblemp_trajectory_parmp_trajectory_replicatemp_trajectory_sdmp_trajectory_simmp_trianglemp_uncertainty_estimatedmp_unifmp_uniformmp_unionmp_versionmp_version_updatemp_zero_vectornlistnot_all_equalNULLReaderrbfReaderRReadershow_modelssi_example_codesi_example_objectsimple_simssparse_matrix_notationStringDataFromDottedStringDataFromFrameto_labelsto_nameto_name_pairsto_namesto_positionsto_stringto_valuesTransformTXTReader
Dependencies:cachemfastmaplatticeMASSMatrixmemoiseoorRcppRcppEigenrlangTMB
Advanced Calibration
Rendered fromcalibration_advanced.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-05-21
Started: 2024-02-22
Advanced Specification of Time-Varying Parameters
Rendered fromtime_varying_parameters_advanced.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2024-04-08
Started: 2024-04-08
Article Status
Rendered fromvignette_status.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2023-05-31
Started: 2023-05-31
Calibrating Compartmental Models to Data
Rendered fromcalibration.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-07-09
Started: 2023-06-09
Composing Related Simulation Models
Rendered fromcomposing_simulation_models.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2023-06-14
Started: 2022-11-02
Debugging
Rendered fromdebugging.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2024-01-18
Started: 2024-01-18
Design Concepts
Rendered fromdesign_concepts.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-06-02
Started: 2024-01-19
Development Principles and Patterns
Rendered fromdevelopment_patterns.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-03-19
Started: 2023-05-31
Elementwise Binary Operators
Rendered fromelementwise_binary_operators.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-04-09
Started: 2022-11-02
Engine-Agnostic Model Specification Grammar
Rendered fromengine_agnostic_grammar.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-06-02
Started: 2024-01-18
Example Models
Rendered fromexample_models.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-02-20
Started: 2023-05-31
FAQs
Rendered fromFAQs.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-07-09
Started: 2024-11-06
Fitting to Real Data
Rendered fromreal_data.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-07-09
Started: 2024-02-26
Multiplying Matrices in macpan2 Models
Rendered frommatrix_multiplication.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-08-23
Started: 2025-07-30
ODE Solvers, Process Error, and Difference Equations
Rendered fromstate_updaters.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2024-10-02
Started: 2024-03-05
Options
Rendered fromoptions.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-08-06
Started: 2025-02-19
Quickstart
Rendered fromquickstart.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-08-06
Started: 2023-04-06
Specifying Likelihood and Prior Components
Rendered fromlikelihood_prior_specs.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-07-09
Started: 2024-10-07
Specifying Time-Varying Parameters
Rendered fromtime_varying_parameters.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2024-05-17
Started: 2023-05-31
State-Dependent Rates
Rendered fromstate_dependent_rates.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-07-31
Started: 2023-03-31
Structured SI Model with Kronecker Products in macpan2
Rendered fromkronecker.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-07-31
Started: 2025-07-30
The C++ Side
Rendered fromcpp_side.Rmdusingknitr::rmarkdownon Jun 10 2026.Last update: 2025-04-22
Started: 2022-08-25
Readme and manuals
Help Manual
| Help page | Topics |
|---|---|
| Binary Operator | BinaryOperator mp_binary_operator |
| Comparison Functions | all_consistent all_equal all_not_equal comparison not_all_equal |
| Distributions | distribution mp_lnorm mp_logitnorm mp_logit_normal mp_log_normal mp_nbinom mp_neg_bin mp_norm mp_normal mp_pois mp_poisson mp_unif mp_uniform |
| Create a Graph from a Model Specification | dot_layout mp_dot_layout |
| Empty Matrix | empty_matrix |
| Empty Trajectory | empty_trajectory |
| Engine Evaluation | engine_eval |
| Functions Available in the Simulation Engine | assign block c cbind cbind_lag cbind_time check_finite clamp col_sums convolution cos cumsum dbinom divide_safe dnbinom dnorm dpois engine_functions exp from_diag group_sums invlogit last log logit matrix mean pgamma pnorm print proportions rbind rbind_lag rbind_time rbinom recycle rep reulermultinom rnbinom rnorm round row_sums rpois sd seq sin sparse_mat_mult sqrt sum t time_group time_step time_var to_diag unpack `%*%` `%x%` `(` `*` `+` `-` `/` `:` `[` `^` |
| Find all Paths Through Compartments | find_all_paths |
| Fitting Distributional Parameters | fit_distr_params mp_fit mp_nofit |
| Ledgers | LedgerDefinition |
| Specify Absolute Flow Between Compartments (Experimental) | mp_absolute_flow |
| Adjacency Matrix | mp_adjacency |
| Aggregate an Index | mp_aggregate |
| Cartesian Product of Index Tables | mp_cartesian |
| Data Frame Describing Each Change to Each State Variable | mp_change_frame |
| Default Values | mp_default mp_default_list |
| Dynamic Model | mp_dynamic_model |
| TMB Simulator from Dynamic Model | mp_dynamic_simulator |
| Describe Statistical Effects | mp_add_effects_descr mp_effects_descr |
| Expand Model | mp_expand mp_reduce |
| Extract Index | mp_extract |
| Factor an Index | mp_factors |
| Final Values | mp_final mp_final_list |
| Data Frame Describing Compartmental Model Flows | mp_flow_frame |
| Make a Forecaster | mp_forecaster |
| Functions Used by an Object for Communicating with a Computational Engine | mp_functions_used mp_generates_randomness |
| Group an Index | mp_group |
| Model Quantity Index Table | mp_index names.Index print.Index |
| Initial Values of Variables Immediately Before the Simulation Loop | mp_initial mp_initial_list |
| Join Indexes | mp_join |
| Kronecker Operator | mp_kronecker_operator |
| Index Labels | mp_labels |
| Flow Diagram Grid Layout (experimental) | mp_layout_grid |
| Flow Diagram Grid Layout (experimental) | mp_layout_paths |
| Bundle up Ledgers | mp_ledgers |
| Linear Chain Product | mp_linear |
| Lookup | mp_lookup |
| Browse Model Docs | mp_model_docs |
| Copy Existing Model as a Starting Point | mp_model_starter |
| Optimization Attempted | mp_opt_attempted |
| Optimize Simulation Model | mp_optimize |
| Optimized Model Specification | mp_optimized_spec |
| Optimizer Output | mp_optimizer_output |
| Fit Parameters | mp_par |
| Description of Model Parameterization | mp_parameterization |
| Specify Flow Into, Out Of, and Between Compartments | mp_inflow mp_outflow mp_per_capita_flow mp_per_capita_inflow mp_per_capita_outflow |
| Position Vectors | mp_positions |
| Print Objective Function | mp_print_obj_fn |
| Print Model Specification | mp_print_after mp_print_before mp_print_during mp_print_spec |
| Fit a Time-Varying Parameter with Radial Basis Functions | mp_rbf |
| Read Serialized Model Specification | mp_read_rds |
| Reference Index | mp_reference |
| Rename Index Columns | mp_rename |
| Print a Table of Existing Models | mp_list_models mp_show_models show_models |
| Simulation Bounds | mp_sim_bounds |
| Simulation Offsets | mp_sim_offset |
| Create a Simulator | mp_simulator |
| Slice an index | mp_slices |
| Self Cartesian Product | mp_square |
| Data Frame Describing State Dependent Per-Capita Flow Rates | mp_state_dependence_frame |
| Structured Vectors | mp_set_numbers mp_structured_vector |
| Subset of Indexes | mp_setdiff mp_subset |
| Symmetric Self Cartesian Product | mp_symmetric |
| Time Scale | mp_time_scale |
| Get Underlying TMB Object | mp_tmb |
| Make a Calibrator | mp_tmb_calibrator |
| TMB Model Coefficient Table | mp_tmb_coef |
| Expression List | mp_tmb_expr_list |
| Covariance of Fixed Effect Estimates | mp_tmb_fixef_cov |
| Transform a TMB Model Specification | mp_tmb_delete mp_tmb_insert mp_tmb_update |
| Insert Back Transformations of Model Parameters | mp_tmb_implicit_backtrans mp_tmb_insert_backtrans |
| Insert GLM Time Variation | mp_tmb_insert_glm_timevar |
| Insert Log Linear Model of Time Variation (Experimental) | mp_tmb_insert_log_linear |
| Transform a TMB Model Specification to Account for Reporting Bias | mp_tmb_insert_reports |
| Insert Basic Transformations of Model Variables | mp_tmb_implicit_trans mp_tmb_insert_trans |
| Read Item from a Model Library | mp_official_library mp_tmb_entire_library mp_tmb_library |
| Create TMB Model Specification | mp_tmb_model_spec |
| Value of the Objective Function of a Model | mp_tmb_objective |
| TMB Likelihood Profiling | mp_tmb_profile |
| Model Coefficient Table with stan | mp_tmbstan_coef |
| Trajectory Specification | mp_traj |
| Simulate Dynamical Model Trajectories | mp_trajectory mp_trajectory_ensemble mp_trajectory_par mp_trajectory_replicate mp_trajectory_sd mp_trajectory_sim |
| Self Cartesian Product Excluding One Off-Diagonal Side | mp_triangle |
| Uncertainty Estimated | mp_uncertainty_estimated |
| Union of Indexes | mp_union |
| Dynamic Variable Names | mp_dynamic_vars mp_flow_vars mp_other_dynamic_vars mp_state_flow_vars mp_state_vars mp_vars |
| Version of 'macpan2' | mp_version |
| Version Update | mp_version_update |
| Zero Vector | mp_zero_vector |
| Names and Labels | names_and_labels to_labels to_name to_names to_name_pairs to_values |
| Self Naming List | nlist |
| Radial Basis Functions | rbf |
| Reader | CSVReader JSONReader NULLReader Reader RReader TXTReader |
| SI Example | si_example si_example_code si_example_object |
| Simple Iterated Simulation | simple_sims |
| Extract Sparse Matrix Notation from a Dense Matrix | sparse_matrix_notation |
| Change How State Variables are Updated | mp_discrete_stoch mp_euler mp_euler_multinomial mp_hazard mp_rk4 mp_rk4_old state_updates |
| String Data | print.StringData StringData StringDataFromDotted StringDataFromFrame |
| To Positions | to_positions |
| To String | to_string |
| Transform | Identity Log Logit Transform |
| Link Functions and Transformation | mp_identity mp_log mp_log1p mp_logit mp_sqrt transform_distr_param |
