/MasterThesis-1

In my Computer Science Master's Thesis, I experimented with advanced deep learning models and introduced a new model, cNSVM, to refine the estimation of connectivity in financial time series data, facilitating enhanced market understanding for improved data-driven decision making in finance.

Primary LanguageJupyter Notebook

Thesis

Prerequisites

In config.yaml, change the r_bin_path to the location where R is installed on your computer.
This project was implemented with Python 3.9, but it should work for Python 3.6 and higher.
For the library dependencies, install dependencies from requirements.txt.

Config files

The entire project can be ran through the 2 yaml config files saved in the config directory.
There are 2 config files so that the parameters do not get cluttered inside one file. Parameters from config_main.yaml file are more likely to be changed a lot through experiments, and parameters from config.yaml file mostly stay the same regardless of the experiment. To create different experiments, change the values of the yaml file.
You can run multiple experiments if the values of the parameters are inside square brackets.
Ex:

c11: [0.9, 0.8]

However, if there are multiple parameters with more than 1 value, the programme will run all possible experiments.
Meaning, for the following parameter setting:

c11: [0.9, 0.8]
seed: [1,2,3,4,5]

the programme will run 2*5=10 experiments. \

Parameter Explanation

To use different models and data generators, change the attributes: loader and model from config_main.yaml file.
Parameters: c11,c12,c21,c22 are elements of the 2-D coefficient matrix for the data generation of 2 variables. They are located inside config_main.yaml file.
Other parameters such as the size of the training set (trainset_size), train-validation-test split (tvt_split), or values of the noise coefficient matrices (_noise_eta_off_diag, noise_eta_on_diag, noise_sigma_off_diag, noise_sigma_on_diag) are located inside config.yaml file. \

Make Parameter Follow a Value of Another Parameter

If you want to make a parameter follow the value of another parameter, write FOLLOW_paramname as a value of the parameter that has to follow another parameter.
Example:
c11: [0.1, 0.2, 0.3]
c22: FOLLOW_c11

Example 2:
sigma_eta_diag: [0.01, 0.02]
sigma_eta_off_diag: [0, FOLLOW_sigma_eta_diag]
\

Config values for each experiment

Experiment 0

Inside config.yaml:
trainset_size: [500,1000,2000,3000,4000,5000]
tvt_split: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: 2

Inside config_main.yaml:
experiment: 0
c11: 0.9
c12: 0.9
c21: 0
c22: 0.9
seed: [1, 101, 33, 12, 0]
loader: var
model: [nri, ngc, ngc0, tvar]

Experiment 1a

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: 2

Inside config_main.yaml:
experiment: 1a
c11: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
c12: 0
c21: 0
c22: FOLLOW_c11
seed: [1, 101, 33, 12, 0]
loader: var
model: [nri, ngc, ngc0, tvar]

Experiment 1b

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: 2

Inside config_main.yaml:
experiment: 1b
c11: [0.8]
c12: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
c21: 0
c22: FOLLOW_c11
seed: [1, 101, 33, 12, 0]
loader: var
model: [nri, ngc, ngc0, tvar]

Experiment 1c

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: 2

Inside config_main.yaml:
experiment: 1c
c11: [0.8]
c12: 0
c21: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
c22: FOLLOW_c11
seed: [1, 101, 33, 12, 0]
loader: var
model: [nri, ngc, ngc0, tvar]

Experiment 1d

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: 2

Inside config_main.yaml:
experiment: 1d
c11: [0.4]
c12: [0, 0.1, 0.2, 0.3, 0.4, 0.5]
c21: FOLLOW_c12
c22: FOLLOW_c11
seed: [1, 101, 33, 12, 0]
loader: var
model: [nri, ngc, ngc0, tvar]

Experiment 2

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: [0.01, 0.02]
sigma_eta_off_diag: [0, FOLLOW_sigma_eta_diag]
n_data: 2

Inside config_main.yaml:
experiment: 2
c11: [0.8]
c12: [0, 0.8]
c21: [0]
c22: FOLLOW_c11
seed: [1, 101, 33, 12, 0]
loader: var
model: [nri, ngc, ngc0, tvar]

Experiment 3

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: [2,3,4,5,6,7,8,9,10]

Inside config_main.yaml:
experiment: 3
c11: [0]
c12: [0]
c21: [0]
c22: [0]
seed: [1, 101, 33, 12, 0]
loader: ngc_var
model: [nri, ngc, ngc0, tvar]

Experiment 4

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: 10
sparsity: [0.1, 0.2 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]

Inside config_main.yaml:
experiment: 4
c11: [0]
c12: [0]
c21: [0]
c22: [0]
seed: [1, 101, 33, 12, 0]
loader: ngc_var
model: [nri, ngc, ngc0, tvar]

Experiment 5a

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: 2
sigma_eps_diag: 1
sigma_eps_off_diag: 0.6

Inside config_main.yaml:
experiment: 5a
c11: [0.9]
c12: [0.4]
c21: [0.9]
c22: [0]
seed: [1, 101, 33, 12, 0]
loader: svm
model: [nri, ngc, ngc0, tvar]

Experiment 5b

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: 2
sigma_eps_diag: 1
sigma_eps_off_diag: 0.6

Inside config_main.yaml:
experiment: 5b
c11: [0.9]
c12: [0]
c21: [0.9]
c22: [0.4]
seed: [1, 101, 33, 12, 0]
loader: svm
model: [nri, ngc, ngc0, tvar]

Experiment 5c

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: 2
sigma_eps_diag: 1
sigma_eps_off_diag: 0.6

Inside config_main.yaml:
experiment: 5c
c11: [0.9]
c12: [0]
c21: [0.9]
c22: [0]
seed: [1, 101, 33, 12, 0]
loader: svm
model: [nri, ngc, ngc0, tvar]

Experiment 5d

Inside config.yaml:
trainset_size: 3000
tvt_split: 0.8
sigma_eta_diag: 0.01
sigma_eta_off_diag: 0
n_data: 2
sigma_eps_diag: 1
sigma_eps_off_diag: 0.6

Inside config_main.yaml:
experiment: 5d
c11: [0.8]
c12: [0.1]
c21: [0.8]
c22: [0.1]
seed: [1, 101, 33, 12, 0]
loader: svm
model: [nri, ngc, ngc0, tvar]