In the Harris-Wilson model,
Let
The parameters
with given initial conditions
In this model, we infer any of the four parameters HarrisWilsonNW
model. See here the marginal densities on the parameters as the noise on the training data increases:
We can clearly see the width of the marginals increasing. Notice also the multimodality of the distributions on
The following are the default model parameters:
# Settings for the dataset, which is loaded externally or can be synthetically generated using the ABM
Data:
synthetic_data:
# Number of time series steps
num_steps: 3000
# Number of origin sizes
N_origin: 100
# Number of destination zone sizes
N_destination: 10
# Model parameters: size, convenience, cost, responsiveness, noise parameters
alpha: 1.2
beta: 4
kappa: 2
epsilon: 10
sigma: 0
# Time differential
dt: 0.01
# Settings for the initial origin size distribution
origin_sizes:
distribution: normal
parameters:
mean: 0.1
std: 0.01
# Settings for the initial destination size distribution
init_dest_sizes:
distribution: normal
parameters:
mean: 0.1
std: 0.01
# Settings for the initialisation of the weight matrix
init_weights:
distribution: normal
parameters:
mean: 1.2
std: 1.2
# Number of steps of the time series to use for training
training_data_size: 1
num_steps
generates a time series of that length, of which the last training_data_size
steps
are used to train the model. If the model is in static equilibrium, the last frame of the time series
is sufficient.
You can learn any of the parameters Training
entry:
Training:
to_learn: [alpha, beta, kappa, sigma]
For those parameters you do not wish to learn you must supply a true value:
Training:
to_learn: [alpha, beta]
true_parameters:
kappa: 5
sigma: 0.0
Instead of generating synthetic data, you can also load data from an .h5
File or .csv
files.
For instance, you can load the origin zone, destination zone sizes, and the network all from separate .csv
files:
Data:
load_from_dir:
network: path/to/file
origin_zones: path/to/file
destination_zones: path/to/file
You can also load all three from a single .h5
file:
Data:
load_from_dir: path/to/h5file
This .h5
file must contain datasets called origin_sizes
, training_data
, and network
.
If you first generate synthetic data using this model, you can thereafter point the config to the
.h5
file. There is also plenty of synthetic data provided in the data/
folder.
The following configuration sets are included in the model:
-
Inequality
: sweeps over different values of$\alpha$ and$\beta$ and plots a heatmap of the inequality parameter$\nu$ (fig. 5 in the publication) -
London_dataset
: loads the London datasets, sweeps over two network metrics, and plots the marginal densities on the parameters (fig. 10 in the publication) -
Synthetic_example
: trains the model on synthetic data from multiple initialisations, and plots the resulting loss landscape (fig. 6), marginal plots, joint distributions, and initial value distribution -
Marginals_over_noise
: Plots the marginals for different levels of the noise in the data
You can run these sets simply by calling
utopya run HarrisWilson --cs name_of_cs