Code implementing the multidimensional functional data representation methods from "Efficient Multidimensional Functional Data Analysis Using Marginal Product Basis Systems" (https://arxiv.org/pdf/2107.14728.pdf)
conda create --name eMFDApy38 python=3.8 conda activate eMFDApy38 conda install -c conda-forge scikit-fda conda install -c anaconda jupyter
conda install -c tensorly tensorly==0.5.1 conda install seaborn
conda activate eMFDApy38
Install R version 4.2.2
Open R and install the following libraries
- reticulate
- hero
git clone https://github.com/Will-Consagra/eMFDA.git
A) To recreate the subset of the simulation study reported in Figure 1 of Section 5.1 of the main text, please run the following commands:
- simulation_51_fig1.py --DATA_DIR /path/2/store/data/ --Nreps 100
The results will be written to /path/2/store/data/results/margarita_fcptpa_mise_comparison.png
NOTE: Due to the number of comparisons being made, full simulation can take a long time (~ 1.5 days on 2.4 GHz Intel Xeon CPU E5-2695 and 24GB of RAM)
B) To recreate the results reported in Table 1 of Section 5.1 of the main text, please perfom the following steps:
-
For K_t = 20 and both sigma2_e = 10.0, 0.5 do 2-3:
-
python simulation_51_hyper_param.py --MODE simulate --DATA_DIR /path/2/store/data/ --Nreps 100 --Kt K_t --sigma2_e sigma2_e
-
python simulation_51_hyper_param.py --MODE analyze --DATA_DIR /path/2/store/data/ --Nreps 100 --Kt K_t --sigma2_e sigma2_e
-
For K_t = 20, do: Rscript simulation_51_hyper_param.R /path/2/store/data/ 100 K_t
-
python compile_simulation_analysis_51_hyperparam.py --DATA_DIR /path/2/store/data/
C) To recreate the simulation study in Section 5.2, simply run the Ipython notebook simulation_52.ipynb
D) To recreate the automated rank selection Figure S1 and S2, simply run the Ipython notebooks rank_selection_evaluation_51.ipynb (for set-up from Section 5.1) and additional_evaluation_52.ipynb (for set-up from 5.2)
E) To recreate the simulation study in S5.1 of the supplement, please perform the following steps.
- python simulation_S51.py --MODE simulate --DATA_DIR /path/2/store/data/ --Nreps 100
- for i in $(seq 1 1 Nreps); do python simulation_S51.py --MODE analyze --DATA_DIR /path/2/store/data/ --rep $i; done;
- for i in $(seq 1 1 Nreps); do Rscript simulation_S51.R /path/2/store/data/ $i; done;
- python compile_simulation_analysis_S51.py --DATA_DIR /path/2/store/data/
Figures + csv files summarizing the analysis will be written to /path/2/store/data/results
WARNING: This final simulation study produces an enormous amount of data (approximately 1TB).