THIS README IS FOR THE INLA_w_MCMC/IwMOUTPUTSUMMARY DIRECTORY.

THIS DIRECTORY CONTAINS FOUR R SCRIPTS, THE FIRST CONTAINS FUNCTIONS THAT TAKE IN THE RESULTS FROM THE UNIVARIATE AND MULTIVARIATE INLA WITHIN MCMC ALGORITHSMS FOR THE CREATION OF TABLES AND PLOTS. THE FUNCTIONS ALSO TAKE IN THE INLA RESULTS IN ORDER TO COMPARE AGAINST THE RESULTS FROM THE IwM ALGORITHMS (FOR EXAMPLE PLOTTING THE POSTERIOR MARGINAL APPROXIMATIONS FROM THE INLA-ONLY RUNS OVER THE HISTOGRAMS FROM THE IwM ALGORITHMS). WHERE THE INLA RESULTS ARE ONLY INCLUDED AS A COMPARISON TO THE INLA WITHIN MCMC RESULTS. THE SECOND R SCRIPT CONTAINS THE CODE THAT MAKES USE OF THESE FUNCTIONS IN THE FIRST R SCRIPT TO PRODUCE THE PLOTS AND TABLES OF RESULTS FOR THE REGULAR POLYGON SIMULATION STUDY AS WELL AS THE UNIVARIATE AND MULTIVARIATE INLA WITHIN MCMC RESULTS FOR LOS ANGELES AND NEW YORK. THE THIRD AND FOURTH ARE THE R SCRIPTS THAT PRODUCE THE RESULTS FOR THE INLA-ONLY ALGORITHMS FOR LOS ANGELES AND NEW YORK.

- IwMSummary_Functions_final.R: this contains the functions that produce tables and plots for the outputs from the Univariate and Multivariate INLA within MCMC results. It creates tables for the results of the MCMC and BMA steps separately, which can be combined post-creation, as well as plots for the MH step such as trace plots and histograms of the samples where (for the latter) the INLA-only posterior approximations can be overlaid as well as the priors for the parameters. For the BMA step we can plot the approximate posteriors and also overlay the INLA-only approximations and priors. We can also overlay the true values of parameters (if they are known). Additionally, the plots of the credible intervals can be produced. (Note that on 14/02/2022 an alteration was made for the BMA plotting function, where "aes_" was used rather than "aes" for the plotting of a vertical line for the true parameter value, otherwise the for loop overwrites all of the vertical lines with the final true parameter value (in our case, for the range parameter, rho). The BMA plots for the Regular Polygon Simulation Study were then re-run, but not the US Cities results as they did not have true values to include and so should not have been affected by this change.)

- IwMSummary_final.R: this contains the set-up and call to the functions from IwMSummary_Functions_final.R that will produce the data frames, tables and plots for the results of all of the INLA, Univariate and Multivariate IwM algorithm. Note that the INLA results are only in comparison to the IwM results, for example, the tables contain the INLA results and the posterior samples/marginal plots for the IwM results will have the INLA-approximated marginals overlaid, but there are no INLA-only plots produced as the main goal of this function is to plot and tabulate the results for the IwM algorithm (Univariate or Multivariate) and if INLA results are present we can include them as a comparison.

- LA2015MVTINLASummary_final.R: this R script contains the code to produce the output summaries for the INLA-only run for the 2015 Motor Vehicle Theft aggregated data in Los Angeles.

- NYC2015MVTINLASummary_final.R: this R script contains the code to produce the output summaries for the INLA-only run for the 2015 Motor Vehicle Theft aggregated data in New York.

ADDITIONALLY, THIS DIRECTORY CONTAINS THE SUB-DIRECTORIES FOR STORING THE OUTPUTS FROM THESE FUNCTIONS FOR THE DIFFERENT ALGORITHM OUTPUTS.

- INLA_OUTPUTS: this sub-directory contains two further sub-directories, one for the results of the INLA outputs for the Regular Polygon Simulation Study with the second, the same for the US Cities. The Regular Polygon Simulation Study directory is empty as we mainly wanted the INLA results for Los Angeles, and so while the New York results are also plotted, we only used the Los Angeles results at the end of Chapter 4. The following outputs are produced from LA2015MVTINLASummary_final.R and NYC2015MVTINLASummary_final.R and stored:
	-- LA2015INLAMVT*.pdf: these are the plots of Los Angeles INLA-only results for the motor vehicle theft data.
	-- LAMVTSummaryTable.tex: table of summary of results for Los Angeles INLA-only implementation for the motor vehicle theft data.
	-- NYC2015INLAMVT*.pdf: these are the plots of New York INLA-only results for the motor vehicle theft data.
	-- NYCMVTSummaryTable.tex: table of summary of results for New York INLA-only implementation for the motor vehicle theft data.

- IwM_OUTPUTS: this sub-directory also includes two further sub-directories where the tables and plots for Regular Polygon Simulation Study results and the US Cities results can be stored. The following outputs are created in IwMSummary_final.R and stored:
	-- USCITIES sub-directory:
		--- UnivarIwMLA*.pdf: plots for the results from the Univariate INLA within MCMC algorithm for the Los Angeles motor vehicle theft data.
		--- UnivarIwMLATableDF.rda: this contains a list of length two containing the data frame of the MH results and BMA results for the results from the Univariate INLA within MCMC algorithm for the Los Angeles motor vehicle theft data (as well as the INLA-only results) from which we generate the results tables to place in the .tex file.
		--- UnivarIwMLATableTex.rda: this contains the above data frames combines into a single data frame, and turned into an object of class \texttt{xtable}. Suffix of `\_3sfTake2' involves three significant figures for the values in the table.
		--- UnivarIwMLATableTex.tex: this is the .tex file for the above \texttt{xtable} of results that can be simply copied into any target .tex file. Suffix of `\_3sfTake2' involves three significant figures for the values in the table.
		--- MultivarIwMLANY*.pdf: plots for the results from the Multivariate INLA within MCMC algorithm for the Los Angeles and New York motor vehicle theft data.
		--- MultivarIwMLANYTableDF.rda: this contains a list of length two containing the data frame of the MH results and BMA results for the results from the Multivariate INLA within MCMC algorithm for the Los Angeles and New York motor vehicle theft data (as well as the INLA-only results) from which we generate the results tables to place in the .tex file. 
		--- MultivarIwMLANYTableTex*.rda: this contains the above data frames combines into a single data frame, and turned into an object of class \texttt{xtable}. Suffix of `\_3sfTake2' involves three significant figures for the values in the table.
		--- MultivarIwMLANYTableTex*.tex: this is the .tex file for the above \texttt{xtable} of results that can be simply copied into any target .tex file. Suffix of `\_3sfTake2' involves three significant figures for the values in the table.
		--- AllIwMLANYTableDF.rda: this contains a list of length two containing the data frame of the MH results and BMA results for the results from the Multivariate INLA within MCMC algorithm for the Los Angeles and New York motor vehicle theft data and also the results for the Univariate INLA within MCMC algorithm for the Los Angeles data (as well as the INLA-only results) from which we generate the results tables to place in the .tex file.
		--- AllIwMLANYTableTex*.rda: this contains the above data frames combines into a single data frame, and turned into an object of class \texttt{xtable}. Suffix of `\_3sfTake2' involves three significant figures for the values in the table.
		--- AllIwMLANYTableTex*.tex: this is the .tex file for the above \texttt{xtable} of results that can be simply copied into any target .tex file. Suffix of `\_3sfTake2' involves three significant figures for the values in the table.

	-- REGPOLSIMSTUDY sub-directory:
		--- RegularPolygonSimStudy*.pdf: plots for the different scenarios' results. Within the names of the plots we specify the following scenarios:
			1. `Full' or `FullFull': Scenario 1;
			2. `Sparse' or `FullSparse': Scenario 2;
			3. `Cov' or `FullCov': Scenario 3;
			4. `DSCov' or `FullDSCov': Scenario 4.
		--- RegularPolygonSimStudy*TableDF.rda: this contains a list of length two containing the data frame of the MH results and BMA results for a particular scenario (as well as the INLA-only results) from which we generate the results tables to place in the .tex file. The naming conventions are as above.
		--- RegularPolygonSimStudy*TableTex.rda: this contains the above data frames combines into a single data frame, and turned into an object of class \texttt{xtable}. The naming conventions are as above. Suffix of `\_3sfTake2' involves three significant figures for the values in the table.
		--- RegularPolygonSimStudy*TableTex.tex: this is the .tex file for the above \texttt{xtable} of results that can be simply copied into any target .tex file. The naming conventions are as above. Suffix of `\_3sfTake2' involves three significant figures for the values in the table.

(The above R codes are the versions that were borught over from Balena HPC after the INLA within MCMC implementations were complete and so they are the final versions that were truly implemented.)