THIS README IS FOR THE INLA_w_MCMC/IwMMULTICITYTIMINGTEST DIRECTORY.

THIS DIRECTORY CONTAINS ROUGHLY ALTERED MULTIVARIATE INLA WITHING MCMC CODE THAT ALLOWED ME TO TEST THE BEHAVIOUR (TIMING) OF THE CODE WHEN IMPLEMENTED TO TWO OR THREE CITIES.

THE DATA FOR THE US CITIES ARE ARCHIVED (PLEASE SEE THE NOTE BELOW ABOUT THE PORTLAND DATA SET USED FOR THESE SIMULATIONS).

- lgcp_inla_w_mcmc_multivar_functions_wtiming_final.R: this code is similar to the Multivariate INLA within MCMC code in ../IwMFUNCTIONS, although there may be minor differences, these should have no effect on the timing outputs. Also included are commented out lines for the mclapply() where mc.cores were initially set to two, but were changed to allow it to vary with the number of study regions.

- MultiCityTimingTest_Balena_final.R: this script contains the code which loaded up the data and either implemented the Multivariate INLA within MCMC to two cities or three, and produced two outputs, one from the MH run and one containing the total time taken for a fixed set of iterations (10 iterations).

- Input:
	-- *2015CT*, *Mesh*: these are the data files (taken from DATA/PROCESSED_DATA/CRIME/COUNT_DATA_FINAL. 
!!NOTE: that at the time of running, there was an error in the count data for the Portland crime, where the income in the count data frame had been incorrectly generated using the P_CTInc_15_imp_proj.rds rather than P_CTInc_15_imp0_proj.rds income data and so there was a single census tract with different values, leading to 15 out of the 587 entries to be incorrect with the final Portland data generated, however this should not affect the timing of the runs produced from these functions as the dimensions for the meshes and data itself are constant, although the output results from the algorithm may differ. The cells and differences (testing income - final income) are as follows (for reproducability):
cell.inc.diff
 [1] 158 191 159 192 226 160 193 227 161 194 228 261 229 262 294
v.inc.diff
 [1]   124.03687  6783.58190 50494.02782 72588.32595  4758.67876 65351.55774 83607.44444 43479.90818  3935.54081 20098.24838 54028.36753 25241.38537    67.22634 42458.06229  8109.81739
However, as the relevant data is archived, the code can be implemented using these.!!

- Outputs:
	-- MultiCityTimingTest_Balena_final.R (which calls lgcp_inla_w_mcmc_multivar_functions_wtiming_final.R):
		--- *10iterations.rda: these are the timings for the algorithm for 10 iterations for the number of cities highlighted in the name.
		--- MultiCityTimings*Cities.rda: these are the MH outputs from the different runs as well as the individual timings for the calculation of the log-posterior for each iteration. 