Forest Fires, Epidemics and Models

What can forest fires tell us about epidemic modelling?

Anthony B. Masters
3 min readMay 30, 2020

Using code, we can simulate forest fires. This is often an introductory lesson in programming languages.

This simple model of a forest fire can inform us about the epidemic spread of diseases.

Setting up the lattice

In R, there is the igraphs package. This package can make lattice graphs.

The basic lattice sets up a grid where each vertex connects to its four adjacent neighbours. Mathematicians call that central vertex and those four neighbours the von Neumann neighbourhood.

test_lattice <- make_lattice(length = 5, dim = 2, nei = 1)
test_lattice %>% plot(layout = layout_on_grid)
The corner vertices only have two von Neumann neighbours. (Image: R)

For forest fires, diagonal connections to each vertex are important too.

There is no setting in the make_lattice function for these extra connections. We need to create the extra edges, and add them.

extra_edges_df <- tibble(x = as.numeric(1:20,
w = case_when(x %% forest_length == 1 ~ NA_real_,
TRUE ~ x + forest_length - 1),
z = case_when(x %% forest_length == 0 ~ NA_real_,
TRUE ~ x + forest_length + 1)) %>%
pivot_longer(cols = 2:3,
names_to = "column",
values_to =

--

--

Anthony B. Masters

This blog looks at the use of statistics in Britain and beyond. It is written by RSS Statistical Ambassador and Chartered Statistician @anthonybmasters.