This repository contains the code and documentation that can be used to achieve the following to tasks:
- Generating a monthly report, containing an estimate for the magnitude of completeness,
$m_c$ , as well as visualisations of the earthquake activity in the most recent month - Producing a Markov chain Monte Carlo (MCMC) storage guide based on a quantitative simulation study on different pre-allocation strategies
Table of contents:
- Repository overview
- Requirements
- Producing the monthly summary
- Producing the Markov chain Monte Carlo storage guide
- Configuring the monthly summary
- Configuring the storage guide
config.yaml
:- Configuration file for controlling various aspects of the report generation. More details in Configuring the monthly summary and Configuring the storage guide
data/
:dervied/
:- Folder for storing temporary generated data files
raw/
:- The cleaned induced earthquake data csv files should be put in this folder
install-requirements.R
:- Utility scripts for installing all the R packages required
Makefile
:- Used to compile the monthly summary and the MCMC storage guide
outputs/figures/
:- Target location of plots
reports/
:mcmc-storage-guide/
:- Directory for storing latex files associated with building the 1-page MCMC storage guide
monthly-summary/
- Directory for storing latex files associated with building the 2-page monthly summary document
src/
:helper-functions/
:- Utility R functions used for the storage guide and monthly summary scripts
mcmc-storage-guide/
:- Scripts used to perform the simulation study
monthly-summary/
- Scripts used to perform the magnitude of completeness estimation, as well as producing the plots
Before attempting to reproduce the monthly summary and the MCMC storage guide, please make sure you have all the following on your system:
- The R programming language
- The
R
packages found ininstall-requirements.R
. You can either run this script on your system or install them manually. - The following LaTeX packages:
amsmath
,amssymb
,caption
,cleveref
,datatool
,geometry
,graphicx
,natbib
,parskip
, andsubcaption
. - If you want to compile the
monthly-summary.tex
or themcmc-storage-guide.tex
using theMakefile
, you will also need the following:- GNU Make
latexmk
with PDFLatex support
You will also need to put a earthquake data file in the data/raw/
directory and configure the date
and data_suffix
parameters in
the configuration file, config.yaml
, before attempting to reproduce the documents.
Various aspects of the config.yaml
. See Configuring the monthly summary for more details.
When producing the monthly summary, both the plots and the parameters and estimates mentioned in text are updated automatically.
However, the qualitative comments made might not be applicable for all instances of the data, so
you can consider changing those in
the reports/monthly-summary/monthly-summary.tex
after producing the document, and then rerun the makefile command.
Using the Makefile (recommended)
Simply navigate to the root of the repository, and run make monthly_summary
. This will run the relevant R scripts to produce the plots, compile the LaTeX file reports/monthly-summary/monthly-summary.tex
and copy the resulting monthly summary PDF file into the project root directory.
Manually
- Navigate to the project root directory
- Run
src/monthly-summary/00_minimum-magnitude-of-completeness.R
to create the plots for the first page - Then run
src/monthly-summary/01_earthquake-visualisations.R
to create the plots for the second page - Compile the LaTeX document
reports/monthly-summary/monthly-summary.tex
Various aspects of the simulation study can be configured in config.yaml
. See Configuring the storage guide for more details.
Using the Makefile (recommended)
Simply navigate to the root of the repository, and run make mcmc_storage_guide
. This will run the relevant R scripts to produce the plots, compile the LaTeX file reports/mcmc-storage-guide/mcmc-storage-guide.tex
and copy the resulting storage guide PDF file into the project root directory.
Manually
- Navigate to the project root directory
- Run
src/monthly-summary/00_mcmc-storage-guide-simulation-study.R
to create the plots for the report - Then compile the LaTeX document
reports/monthly-summary/monthly-summary.tex
All configuration options can be changed in config.yaml
.
configuration parameter | description |
---|---|
date and data_suffix
|
The data file that will be used for all the analyses and visualisations in the monthly summary is expected to be located in data/raw/ with a filename <date><date_suffix>.csv . |
log_frequency_smoothing_parameter |
As part of the |
magnitude_bin_width |
This parameter controls the width of the magnitude bins to bin the data when both performing |
min_mc and max_mc
|
When estimating bin_width
|
explained_variance_min |
When estimating |
report-summary-data.csv |
The name of the file to store the temporary numerical summaries and other data that will be used when generating the monthly summary and MCMC storage guide reports. |
All configuration options can be changed in config.yaml
.
Configuration parameter | description |
---|---|
num_model_parameters |
The value for |
max_num_samples |
The largest value for max_num_samples are tested. |
num_repeated_simulations |
Number of times to repeat each simulation run in order to build a 95% asymptotic normal confidence interval |