You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|Building a simple model with seasonal cycles in transmission. What are some other forms of complexity in the functional forms of rates? Try to implement them. Keep in mind that you can use tilde-based expressions to define intermediate variables. |
|Build a simple model with seasonal cycles in transmission. What are some other forms of complexity in the functional forms of rates? Try to implement them. Keep in mind that you can use tilde-based expressions to define intermediate variables. |
| For one of your calibrated models, use the [mp_tmb_coef](https://canmod.github.io/macpan2/reference/mp_tmb_coef.html) function to get parameter estimates with confidence intervals. |
250
263
| Note that you will need to use `conf.int = TRUE` option that is a little hidden in the documentation, but it is there. Did any of your parameters have an interval that overlaps zero? If so try to fix this by fitting the log transformed version of the offending parameter. If you call the log of your parameter `log_{name-of-parameter}`, the confidence intervals will be automatically back-transformed to the original scale and will not overlap zero. Did you get any NaNs (not a number)? This is a sign of a bad fit. |
251
264
252
-
## Forecasts
265
+
## Forecasts and Scenarios
253
266
254
267
Let’s keep it simple again and get more practice simulating and fitting.
268
+
You can use this calibrated model to practice making forecasts and
269
+
exploring scenarios.
255
270
256
271
```r
257
272
exercise(
258
-
"Simulate 50 time steps of incidence (i.e., the infection flow) from the SIR model in the library with defaults. Create a calibrator but change the default values of `beta` and `gamma` so that the optimizer will need to do work to find the true values."
273
+
"Simulate 50 time steps of incidence (i.e., the infection flow) from the SIR model in the library with defaults. Create a calibrator but change the default values of `beta` and `gamma` so that the optimizer will need to do work to find the true values. Then calibrate your model to the simulation data using [mp_optimize](https://canmod.github.io/macpan2/reference/mp_optimize.html). After optimizing use [mp_forecaster](https://canmod.github.io/macpan2/reference/mp_forecaster) to extend 50 more time steps, so that the entire simulation would be 100 time steps. Use [mp_trajectory_sd](https://canmod.github.io/macpan2/reference/mp_trajectory.html) to produce forecasts with confidence intervals."
| Simulate 50 time steps of incidence (i.e., the infection flow) from the SIR model in the library with defaults. Create a calibrator but change the default values of `beta` and `gamma` so that the optimizer will need to do work to find the true values. |
| Simulate 50 time steps of incidence (i.e., the infection flow) from the SIR model in the library with defaults. Create a calibrator but change the default values of `beta` and `gamma` so that the optimizer will need to do work to find the true values. Then calibrate your model to the simulation data using [mp_optimize](https://canmod.github.io/macpan2/reference/mp_optimize.html). After optimizing use [mp_forecaster](https://canmod.github.io/macpan2/reference/mp_forecaster) to extend 50 more time steps, so that the entire simulation would be 100 time steps. Use [mp_trajectory_sd](https://canmod.github.io/macpan2/reference/mp_trajectory.html) to produce forecasts with confidence intervals. |
280
+
281
+
```r
282
+
exercise(
283
+
"Create a scenario for beta, where transmission increases by a factor of 1.2 at time 60 (10 time steps after the data end). The answers for this exercise are [here](https://github.com/canmod/macpan-workshop/blob/main/code/simple-scenario.R)."
| Create a scenario for beta, where transmission increases by a factor of 1.2 at time 60 (10 time steps after the data end). The answers for this exercise are [here](https://github.com/canmod/macpan-workshop/blob/main/code/simple-scenario.R). |
0 commit comments