In order to run the MJM files, all three files (functions, data_analysis, data_fitting) should be downloaded. functions.R contains all the necessary functions to run the EM-algorithm for the MJM. data_fitting.R contains the code for the EM algorithm. data_analysis.R contains the main function MJM_fit(), which returns the estimates and estimated standard errors (likelihood-based and bootstrap), and this functions relies on the data_fitting.R and functions.R files.