Supplementary Code

Our python3 implementation requires numpy, apgpy (https://github.com/bodono/apgpy), and matplotlib.

Run the example code (lambda=0) by calling "apply_functions_command_line.py" as follows:

python3 apply_functions_command_line.py --iterations=10000 --oTol=1e-10 --X_file='X.npy' --D_file='D.npy' --lamseq_file='lam_seq0.npy' --levels_file='levels.npy' --results_folder='temp'

This estimates an MGM as described in the supplementary methods section. Here,

For visualization run:

python3 make_example_plots.py

to visualize the results for lambda=0.

Estimate MGMs for a lambda sequence

An example sequence is provided in 'lam_seq.npy' (should be in a decreasing order).

python3 apply_functions_command_line.py --iterations=10000 --oTol=1e-10 --X_file='X.npy' --D_file='D.npy' --lamseq_file='lam_seq.npy' --levels_file='levels.npy' --results_folder='temp'