No articles match
Multiplying Matrices in macpan2 Models10 months ago
Overview | Standard Matrix Multiplication (%*%) | Kronecker Product (%x%) | Elementwise Multiplication with Recycling (*) | Example of Age-Structured Transmission with Elementwise Matrix Multiplication | Multiplying a Sparse Matrix with a Dense Matrix | Extracting Sparse Representation | Small Example of Sparse Matrix Multiplication | Example of Sparse Matrix Multiplication to Model Time-Varying Transmission Rate | Summary of Matrix Operations | When to Use Each
Options10 months ago
Potentially Useful | Logging and Verbosity | Output Data Formatting (for Scalar-Only Models) | Numerical Tolerances | Advanced | Simulation and Reproducibility | Time-Restricted Functions | Engine Control | Deprecated | No Longer or Not Yet Used
Quickstart10 months ago
Hello World | Creating a Simulator | Generating Simulations | Processing Results
State-Dependent Rates10 months ago
Decomposition of State-Dependent Rates | Example -- SIR | Product Models | Example -- SIR times age | Example -- SIR with multiple I-boxes times age | Example -- SIR with multiple I-boxes and partial immunity times age | Example | Bookkeeping (in progress)
Structured SI Model with Kronecker Products in macpan210 months ago
Introduction | Utilities and Packages | Initial State Vectors | Model Parameters | Derived State Vectors | Per-Capita Transmission Matrix | Per-Capita Force of Infection | Absolute Flows | Allocation Matrices | Euler Step Update | Model Specification | Simulation and Plots | Limitations
Dataset Provenance11 months ago
Preliminaries | Example: The Last Case of Smallpox
Calibrating Compartmental Models to Data11 months ago
Hello, World | Step 0: set up simulator and generate 'data' | Step 1: add calibration information | Step 2: do the fit | Step 3: check the fit | Statistical Model
FAQs11 months ago
Introduction | Setup and Example Models and Data | Naming Conventions | What does macpan2 mean? | Why do most of the functions start with mp_? | Why do some of the functions start with mp_tmb_? | Calibration Details and Outputs | How does macpan2 fit models to data? | How does macpan2 derive confidence intervals? | What likelihood and prior distribution assumptions does macpan2 make? | Can I get a new model specification with fitted parameters as defaults, from a calibrated calibrator object? | Plotting Simulated Trajectories | How can I plot simulated trajectories? | How can I plot a calibrated model with the observed data used in the calibration? | Calibration Troubleshooting | Should I worry about NA/NaN function evaluation warnings? | What should I do if I do not converge? | How do I increase the number of iterations that the optimizer takes? | Parameter Estimation and Uncertainty | What can I do when my confidence intervals include zero for a parameter that should be positive? | Can I weight the importance of trajectories when fitting to more than one of them? | Dynamical Instabilities | What is the best way for me to keep my state variables from going negative? | Initial Conditions | My data start mid-epidemic: how do I know what the initial number of infectious individuals is? | Coding Style | What does |> mean? | Why do you put weird symbols at the start of lines? | Time Variation of Parameters | How can I use a known time series of values? | What if my time-series has missing values? | What can I do if I do not know the functional form of time-variation? | Under Reporting, Delayed Reporting, and Total Reporting | How should I account for under-reporting in macpan2? | How should I account for delayed reporting as well as under-reporting in macpan2? | Can macpan2 use hidden Markov models to account for reporting bias? | Stochastic Simulation | How can I set the seed for the random number generator? | Why do I keep getting the same result even though my model has randomness? | What are the mathematical details of the Euler multinomial process error model? | Does macpan2 implement the Gillespie algorithm? | More Process Error (incomplete)
Fitting to Real Data11 months ago
Setup | One Scarlet Fever Outbreak in Ontario | SIR Model | Modify Model for Reality | Preparing the Data | Set up the Optimizer | Run the Optimization | Examine the fit | Fixing the Optimization Problem | Learning the Functional form of Time Variation in Transmission (New!) | References
Specifying Likelihood and Prior Components11 months ago
Calibration Defaults | Customizing the Objective Function | Use Cases | Priors on model parameters | Likelihoods on model parameters | Fixed distributional parameters | Fitting Distributional Parameters | Distributional Parameter Transformations | Priors on distributional parameters
Design Concepts1 years ago
Information Processing | Modularity | Engine-Agnostic Model Specification Language | Engine-Specific Model Specification Languages | General Dynamic Simulation with TMB | Model Library | Calibration | Specifying Data to Fit | Specifying Distributional Assumptions | Specifying Parameters to Fit | Alternative Trajectory Solvers | Euler Step | Mean Euler-Multinomial (a.k.a. Hazard Correction) | Runge-Kutta 4 | Time-Varying Parameters | Vectors in the TMB Engine | Model Structure and Bookkeeping | Structure in Expressions | Constructive Descriptions of Model Structure | Structured Vectors | Structure Encourages Reparameterization | Alternative Engines | Combining Expression Lists
Engine-Agnostic Model Specification Grammar1 years ago
Amuse bouche: a structured SIR model | Appetizer: specifying the basic SIR model | Main course: expanding the basic SIR with additional structure | Dessert: understanding model simulation in macpan2
Advanced Calibration1 years ago
'Hello, World': an easy (??) calibration exercise | Step 0: set up simulator and generate 'data' | Step 1: add calibration information | Step 2: do the fit | A slightly harder, more realistic example | Computing and plotting confidence and prediction intervals | Hamiltonian MC | Alternative confidence intervals | Irregular data; multiple data streams | 'Hello, World' the hard way | Step 0: recreate the simulator | Step 1: add observed data and slots for history etc. | Step 2: collect simulated values | Step 3: set up and compute objective function | Step 4: declare and/or transform parameters to be optimized, set starting values | Step 5: do the fit | Measles Data -- In-Progress | Challenging Logistic Variation in Transmission Rate | References
The C++ Side1 years ago
Prerequisites | Matrices | Parameters | Trajectory Simulation | Expressions | Parse Tables | Assignment | Assignment Parse Tables | Literals | Function Definitions | Objective Function
Elementwise Binary Operators1 years ago
The Problem | Definition of an Elementwise Binary Operator in the C++ Engine | Forcing a Binary Operator in R to have these Properties | Step 1 | Step 2 | Step 3 | Implementation and Examples
Development Principles and Patterns1 years ago
Introduction | Basics of the macpan2 Object Oriented Framework | Constructing and Using Objects | Defining Classes | Details | Objects | Class Definitions | Inheritance | Principles | Small Classes | Avoid Modifying Well-Tested Classes | Linear Inheritance | Shallow Inheritance Hierarchy | Balance Regeneration with Consistency | Patterns | Alternative Classes | Argument Fields | Static Fields | Standard Methods | Composition | Refresh Methods | Private Methods | Object Editing | Method Caching
Example Models1 years ago
Finding Example Models | Using Examples | Modifying Examples
Quickstart2 years ago
Preliminaries | Scarlet Fever Data in Ontario
ODE Solvers, Process Error, and Difference Equations2 years ago
Branching Flows and Process Error | Internal Design | ChangeComponent() classes | The change_frame() method | The flow_frame() method | ChangeModel() classes | UpdateMethod() classes | Relationship to Ordinary Differential Equation Solvers | Euler | Runge Kutta 4 | Euler-Multinomial | Hazard | Linearizing at Each Time-Step | Hazard in models including more than unbalanced per-capita flows
Specifying Time-Varying Parameters2 years ago
Baseline SIR Model | Piecewise Time Variation | Calibrating Time Variation Parameters | Radial Basis Functions for Flexible Time Variation (In-Progress) | Calibration | References
Advanced Specification of Time-Varying Parameters2 years ago
Baseline SIR Model | Piecewise Time Variation | Calibrating Time Variation Parameters | Radial Basis Functions for Flexible Time Variation (In-Progress) | Calibration | References
plot_rohani2 years ago
Plotting Infectious Disease Time-Series | Example Data | Generalizing Rohani, Earn, and Grenfell
Debugging2 years ago
Choosing a Debugging Technique
Composing Related Simulation Models3 years ago
Introduction | Notation and Theory | Online Forecasting | Eigenvector State Initialization | Priors on R0 | Regenerating Versus Reparameterizing Models
Article Status3 years ago
Stable | Mature Draft | Working Draft | Stub
flexi_filter4 years ago
What is flexi_filter for? | What does flexi_filter return? | What you can search