THIS README IS FOR THE INLA_w_MCMC/IwMSIMSTUDY DIRECTORY.

THIS DIRECTORY CONTAINS THE R SCRIPTS WHICH ALLOW US TO SIMULATE DIFFERENT LGCPS OVER TWO WINDOWS TO IMITATE DIFFERENT SCENARIOS OF INTEREST AND IMPLEMENT THE MULTIVARIATE INLA WITHIN MCMC ALGORITHM (THROUGH THE ../IwMFUNCTIONS DIRECTORY) TO THE DIFFERENT SCENARIOS FOR THE TWO STUDY REGIONS IN ORDER TO ASSESS THE BEHAVIOUR OF THE RESULTS UNDER DIFFERENT SITUATIONS. THERE IS ALSO WITH THE OPTION TO IMPLEMENT THE UNIVARIATE INLA WITHIN MCMC ALGORITHM TO THE SEPARATE DATA SETS, HOWEVER THIS WAS NOT MADE USE OF FOR THIS THESIS. THERE IS ALSO AN R SCRIPT IN ORDER TO IMPLEMENT THE INLA ONLY ALGORITHM TO EACH DATA SET FOR THE SAKE OF COMPARISON.
THIS DIRECTORY ALSO INCLUDES THE SIMULATED DATA AND MESHES.

- SimulationStudySetUp_final.R: this is the code used to simulate the data (covariate and point patterns) and produce the required meshes for two study regions. The data is simulated using particular seeds and should, therefore, be able to reproduce the same data.

- SimulationStudySetUpPlots_final.R: this is the code used to produce plots for the data.

- SimulationStudy_Balena_INLARuns_final.R: this implements the INLA algorithm for the five different data sets for the simulation study to compare against the Multivariate INLA within MCMC algroithm implementation.

- SimulationStudy_Balena_final.R: this contains the code that runs the Multivariate INLA within MCMC algorithms to the combination of the count data in Window 1 with different count data sets in Window 2. It utilises if statements that have to be pre-selected to implement the algorithm for the correct combination of data sets. It also contains if-statements that allow for the implementation of the Univariate INLA within MCMC algorithm to the separate data sets although this was not implemented.

- LAPortlandGMDataModelComp.txt: this is some code and output which loaded old LA and Portland data and compared the total counts to consider a reasonable thinning percentage for the sparse data simulation. We also produced some quick models for the count data to assess the coefficients for the data. Note that the data used for these were the DATA/PROCESSED_CRIME/CRIME/COUNT_DATA_GMO LA data with the Portland data produced in the same way, with the average income different than those in the DATA/PROCESSED_CRIME/CRIME/COUNT_DATA_FINAL data sets. However, the important result from this was the proportion of counts which is a the same regardless of how the socio-economic variables are interpolated.

- Outputs:
	-- SimulationStudySetUp_final.R:
		--- WindowiCovariates.rda: the simulated covariates over each window for the simulation of the point patterns and aggregated count data, where i=1,2.
		--- Windowi*Data.rda: simulated data, aggregated into count data for Window i=1,2 and if i=1, then *=Full (Data Set 1), and if i=2, then *=Full (Data Set 2 for Scenario 1), Sparse (Data Set 3 for Scenario 2), DifferentBeta2 (Data Set 4 for Scenario 3) and DifferentSignBeta2 (Data Set 5 for Scenario 4).
		--- MeshWindowi.rda: meshes over the two windows, i=1,2.

	-- SimulationStudySetUpPlots_final.R:
		--- *.pdf: these are the plots of the data, output from the above plotting script.

	-- SimulationStudy_Balena_INLARuns_final.R:
		--- Windowi*INLA.rda: this denotes the INLA-only runs for both windows, i=1,2 where if i=1, then *=Full (Data Set 1), and if i=2, then *=Full (Data Set 2 for Scenario 1), Sparse (Data Set 3 for Scenario 2), Cov (Data Set 4 for Scenario 3) and DSCov (Data Set 5 for Scenario 4).

	-- SimulationStudy_Balena_final.R:
		--- IwMMultivarMHFullby*.rda: this denotes the output from the Metropolis-hastings step only, where the number of runs 10,000 for all of the outputs. The * specifies the scenario considered, where *=Full (Scenario 1), Sparse (Scenario 2), Cov (Scenario 3), DifferentSignCov (Scenario 4).
		--- IwMMultivarBMAFullby*.rda: this denotes the output from the BMA implementation, the output includes the MCMC chains with the removed burn-in iterations (500 for all) as well as the INLA marginals for the remaining iterations and the final approximated posterior marginals for the fixed, hyperpar (internal rep., transformed internal rep. and INLA output external rep.). Additionally for Scenarios 3 and 4 where we also estimated the covariate contrasts, we also output the combination of the MH samples with the marginals for its respective fixed effect (only for the Multvariate outputs of course and for the non-base study region). The * specifies the scenario considered, where *=Full (Scenario 1), Sparse (Scenario 2), CovComb (Scenario 3), DifferentSignCovComb (Scenario 4), where the addition of Comb for Scenarios 3 and 4 is due to the additional approximation of the combinations of total covariate effects for the `non-base' study regions - which is detailed in Chapter 5 of my thesis.
