This repository contains the code for the master's thesis: Application of Deep Learning for Simulating Time-Series of Oil Futures (link to follow), by Sebastian Ruiz, for the program mathematics, stochastics track, at the University of Amsterdam.
Note: The time-series data of oil futures is purposely missing from this project as the data is not publicly available.
- Set
PATH_ROOT
correctly in.env
(make a copy of.env.sample
).
If importing data using the Calibration Library:
- Add
CalibrationLib
to project interpreter path. In PyCharm: Settings -> Project interpreter -> Cog -> Show All -> Select your interpreter -> Click funny folder button -> Add -> SelectCalibrationLib
- Set
writableDir
correctly indata_importer/config.yaml
- Run
data_importer/importer_run.py
Training the models:
- Set the training and test data in
(root) config.yaml
. - To train all the autoencoder models run
autoencoders/autoencoder_run_all.py
. - To train all the GAN models run
gans/gan_run_all.py
.
For each model the parameters can be set in the dictionary ae_params
and gan_params
for autoencoder parameters and GAN parameters respectively..
plotting.py
: Provides function to plot curves. Used to compare autoencoder input and output and show GAN simulations.preprocess_data.py
: Load data from pickle file and does the data pre-processing. It splits the data into training and test sets, and it applies normalisation, standardisation or log-returns.
The code for the models is based on examples found in keras-autoencoders .
- Standard Autoencoder: Standard autoencoder with encoder and decoder.
- Variational Autoencoder (VAE): The model from Auto-Encoding Variational Bayes.
- Adversarial Autoencoder (AAE): The model from Adversarial Autoencoders.
Popular conditional GAN models. The code is based on examples found in Keras-GAN.
- Standard GAN: The generative adversarial network model, from Generative adversarial networks.
- Wasserstein GAN: The model from Wasserstein GAN.
- GAN CONV: GAN using convolutional layers.
The LSTM Model is based on example code from Keras seq-2-seq Signal Prediction.
The GAIN model, GAIN: Missing Data Imputation using Generative Adversarial Nets, is based on the Tensorflow example code from GAIN.
The anomaly detection model uses the autoencoder model.
The classical models include the Andersen Markov Model and some autoregressive models.