Models
As already introduced in the Getting Started section, models are implemented by writing a class derived from Model and overriding the member function simulate(). Optionally, it is also possible to override the member functions size() and simulate(t:Integer) so that the model unfolds incrementally over a number of epochs.
| Mathematical | Description | Programmatic |
|---|---|---|
| The model. | m:Model |
|
| Number of epochs. | m.size() |
|
| Random variables in the initial epoch. | Usually member variables of m, or local variables of m.simulate() |
|
| Random variables in the th epoch. | Usually member variables of m or local variables of m.simulate(t) |
|
| Simulate the initial model. | m.simulate() |
|
| Simulate the th epoch model. | m.simulate(t) |
When implementing the simulate() and simulate(t) member functions, we make use of all the building blocks previously described to enumerate the random variables of the model and their relationships. This includes Distribution, Random and Expression objects, as well as the simulate (<~), observe (~>) and assume (~) operators.