THIS README IS FOR THE GRID_MESH/IRREGULAR_POLYGON_LGCP DIRECTORY, EACH SUB-DIRECTORY WILL ALSO CONTAIN IT'S OWN README FILE.

THIS DIRECTORY CONTAINS 3 SUB-DIRECTORIES THAT CONTAIN THE DATA AND CODE FOR IMPLEMENTING THE SIMULATION STUDIES, THE OUTPUTS FOR THE SIMULATION STUDIES AND THE ANALYSIS OF THE SIMULATION STUDY OUTPUTS, RESPECTIVELY.

- IRREGPOLLGCP_CODE: this contains the covariate data (GridMeshIrregPolLGCPSSCov.rda), mesh (MeshesIrregPolLGCP.rda), the LA window (WindowsIrregPolLGCP.rda), grids (QuadratsIrregPolLGCP.rda), grid centre coordinates(CoordsIrregPolLGCP.rda) and the pre-aggregated covariates (CovAggGridIrregPolLGCP.rda) as well as R scripts for the implementation of the traditional (GridMeshOptimIrregTrad_final.R) and SBC (GridMeshOptimIrreg_final.R, GridMeshOptimIrreg_TimeErrorRuns_final.R, GridMeshOptimIrreg_SpaceErrorRuns_final.R) simulation studies. The generation of the covariate data for these simulation studies use the DATA/PROCESSED_DATA/COUNT_DATA_GMO/LA/LA2015CT236359CountData_proj.rda data set.
This directory also contains the R scripts that were used to re-run the TIME ERROR and SPACE ERROR outputs. These R scripts which re-run these errors move the error message into a warning message to ensure that, while no error is highlighted as there is output from the re-run with more processors available, there is still a note that there was a need to re-run this particular combination.

- IRREGPOLLGCP_OUTPUT: this contains the outputs from the two simulation studies. It also contains code to input errors, in particular a `TIME ERROR' for the runs for which a particular simulation, grid and mesh resulted in a run-time over six hours.  
There is also code that removed errors in order to re-run certain combinations. This was done when a memory issue (before the re-setting of the temporary directories on Balena) resulted in the entire job (with two processes running on the same node) failing and sometimes resulted in errors in both outputs for that job. When re-run, some of these outputs ended up with no errors what-so-ever meaning that there was just a combination that meant the incorrect temporary directory could not handle the memory requirement. In the case where this error persisted and a particular process-simulation-grid-mesh combination in the job could be narrowed down to have caused the issue then the error was not replaced for these grid-mesh combinations. The persistant errors were declared to be SPACE ERRORS and later re-run once the issue with temporary directories had been solved.
This directory contains the completed runs pre- and post- re-runs with the latter being combined with the runs with no errors to produce the final results.

- IRREGPOLLGCP_ANALYSIS: this contains R scripts which produces tables and plots for the outputs from the two simulation studies and 3 R markdowns that implement these scripts and print a few of the resultant tables and plots. One Rmd is for the traditional simulation study, one for the parameter results of the SBC simulation study and the final for the mean field results of the SBC simulation study.

