https://github.com/mbjoseph/wildfire-extremes
Spatiotemporal modeling of wildfire extremes
https://github.com/mbjoseph/wildfire-extremes
bayesian ecology fire research-compendium stan
Last synced: 9 months ago
JSON representation
Spatiotemporal modeling of wildfire extremes
- Host: GitHub
- URL: https://github.com/mbjoseph/wildfire-extremes
- Owner: mbjoseph
- License: other
- Created: 2016-07-29T15:49:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-02-03T02:54:03.000Z (almost 6 years ago)
- Last Synced: 2025-01-08T21:58:47.978Z (10 months ago)
- Topics: bayesian, ecology, fire, research-compendium, stan
- Language: HTML
- Homepage:
- Size: 3.46 MB
- Stars: 9
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spatiotemporal modeling of wildfire extremes
[](https://hub.docker.com/r/mbjoseph/wildfire-extremes/)
[](https://hub.docker.com/r/mbjoseph/wildfire-extremes/)
[](https://zenodo.org/badge/latestdoi/64492265)
This repository contains code to build spatiotemporal models of wildfire extremes in the contiguous United States.
## Hardware requirements
We recommend at least 4 physical CPUs and 30 GB of RAM.
## Reproducing the analysis
### Spinning up the computational environment
We have provided a Docker container that bundles up the software dependencies
for this project, and provides an RStudio server instance that can be used in a
web browser.
To launch the container, run the following:
```bash
docker run -e PASSWORD=yourpassword -d -p 8787:8787 mbjoseph/wildfire-extremes
```
Then, navigate to port 8787 on a web browser (e.g., `localhost:8787`, or
`:8787` if running on AWS) and log in
with username `rstudio`, and the password you provided in your call to `docker run`.
### Optional: creating an RStudio project
If you plan to interact much with the code, you may want to create an RStudio
project.
To do so, after connecting to your RStudio server, choose
File > New Project..., then select "Existing Directory" > Browse..., and
choose wildfire-extremes, and finally click Create Project.
This will create and then open a project associated with this repository.
### Running the analysis
To run everything, you can type the following command from a terminal
(e.g., the terminal pane in RStudio server):
```
make
```
This takes ~3-4 days on a machine with 4 cores, assuming that you're making
everything from scratch.
Fitting the models takes the longest due to data volume and parameter
dimensionality.
## Overview of workflow
### 1. Data processing
We define targets for the input data to the models in the Makefile as follows:
- `data/processed/ecoregion_summaries.csv`: Summaries of climate data for every
EPA level 3 ecoregion for each month from 1984-2015.
- `data/processed/housing_density.csv`: Summary of housing density for each
ecoregion, each month.
- `data/processed/stan_d.rds`: A serialized rds object that bundles all input
data for the model fitting step.
We also generate some ancillary data to be used downstream in the analysis of
model results, including `data/processed/mtbs.rds` and
`data/processed/ecoregions.rds`.
### 2. Model training and evaluation
Once the serialized model input data (`data/processed/stan_d.rds`) exist, then
all of the models can be fit.
These include burn area models and wildfire count models, all of which have
the suffix `_fit.rds`, e.g., `nb_fit.rds`, `ba_gamma_fit.rds`.
Each model fit object corresponds to a separate target in the Makefile.
With these model fits, a set of figures and tables (`figs` and `tables` in
the Makefile) are generated.
These are passed into the manuscript in the next step.
### 3. Manuscript generation
The manuscript `main.pdf` is generated from the `main.Rmd` file, and all of the
tables and figures.
The source code for the manuscript is an R Markdown document, which dynamically
inserts the figures, tables, and summary statistics into the paper in an
automated way.