2.5. Forecast scenarios

The example file predation.toml (shown below) defines all of details that are needed to generate forecasts. See the Key Concepts for further information.

Note

A single TOML file may contain multiple forecast scenarios. These can be used to generate separate forecasts for different time periods, locations, observation models, etc.

  1. The key components are defined in the [components] table:
    • The simulation model (model);
    • The time scale (time, either scalar time or date-time); and
    • The output recorder (summary).
  2. Prior distributions for each model parameter are defined in the [model.priors] table.
  3. Lower and upper bounds for each model parameter are defined in the [model.bounds] table.
  4. Summary statistics to be recorded in the output file are defined in the [summary.monitors] and [summary.tables] tables.
  5. Various particle filter settings are defined in the [parameters] table, including:
    • The number of particles (particles);
    • The seed for the pseudo-random number generator (prng_seed); and
    • The simulation time period (time.start and time.end).

It also defines a single forecast scenario in the [scenario.example] table, which contains:

  • A unique name to identify this scenario ("Example Scenario");
  • An observation model for \(x(t)\) observations ([scenario.example.observations.x] table); and
  • The observation model for \(y(t)\) observations ([scenario.example.observations.y] table).
The contents of predation.toml.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
[components]
model = "pypfilt.examples.predation.LotkaVolterra"
time = "pypfilt.Scalar"
summary = "pypfilt.summary.HDF5"

[model.priors]
x = { function = "uniform", args.low = 0.5, args.high = 1.5 }
y = { function = "uniform", args.low = 0.2, args.high = 0.4 }
alpha = { function = "uniform", args.low = 0.6, args.high = 0.8 }
beta = { function = "uniform", args.low = 1.2, args.high = 1.4 }
gamma = { function = "uniform", args.low = 0.9, args.high = 1.1 }
delta = { function = "uniform", args.low = 0.9, args.high = 1.1 }

[model.bounds]
x = { min = 0, max = 2 }
y = { min = 0, max = 2 }
alpha = { min = 0, max = 2}
beta = { min = 0, max = 2}
gamma = { min = 0, max = 2}
delta = { min = 0, max = 2}

[summary.monitors]
expected_obs.model = "pypfilt.summary.ExpectedObsMonitor"

[summary.tables]
model_cints.model = "pypfilt.summary.ModelCIs"
forecasts.model = "pypfilt.summary.PredictiveCIs"
forecasts.init.exp_obs_monitor = "expected_obs"
obs.model = "pypfilt.summary.Obs"

[parameters]
particles = 1000
prng_seed = 42
data_dir = "."
out_dir = "."
max_days = 14
resample.threshold = 0.25
resample.regularisation = true
steps_per_unit = 1
fresh_cache = true
remove_cache = true
time.start = 0.0
time.until = 15.0
summary.from_first_day = true
summary.meta.packages = [ "matplotlib" ]
summary.tables.model_cints.credible_intervals = [ 0, 50, 95 ]

[scenario.example]
name = "Example Scenario"

[scenario.example.observations.x]
model = "pypfilt.examples.predation.ObsModel"
init.obs_period = 0
file = "predation-counts-x.ssv"
parameters.sdev = 0.2
format.sdev = "0.1f"
name.sdev = "sdev"

[scenario.example.observations.y]
model = "pypfilt.examples.predation.ObsModel"
init.obs_period = 0
file = "predation-counts-y.ssv"
parameters.sdev = 0.2
format.sdev = "0.1f"
name.sdev = "sdev"