2025-11-09

Objective

The overall objective of this presentation is to create slides programmatically and use common statistical tools to do so.

In order to demonstrate these skills, I have chosen to use statistical analysis to show how environmental factors can play a part in the frequency of wildfires.

The following environmental factors will be simulated for use in this presentation:

  • Temperature
  • Rainfall
  • Humidity
  • Wind Speed

Simulated Dataset Creation

set.seed(2025)
years = 15

data = data.frame(
  Year = 2005:(2005 + years - 1),
  Temperature = round(rnorm(years, mean = 65, sd = 5),1),
  Rainfall = round(rnorm(years, mean = 45, sd = 5),1),
  Humidity = round(rnorm(years, mean = 60, sd = 5),1),
  WindSpeed = round(rnorm(years, mean = 10, sd = 2),1)
)

data$Fires = round(1 + 0.7*data$Temperature - 0.2*data$Rainfall -
0.3*data$Humidity + 0.4*data$WindSpeed + rnorm(years,0,2))

data

Explaining the Simulated Dataset

For the simulated data, I set the average temperature, rainfall, humidity and wind speed then assigned a typical variation for each variable to control the randomness of the average in order to make the dataset a bit more realistic.

The linear formula was then created to simulate a regression equation that combined all of the environmental factors.

Temperature and wind speed were set to show an increase in fires and humidity and rainfall were to show a relation of decrease in fires.

Impact of Wind Speed on Wildfires (ggplot)

Impact of Rainfall on Wildfires (ggplot)

Impact of Temperature on Wildfires (ggplot)

Regression Equation

The regression equation shows how different environmental factors contribute to wildfire frequency. The model combines the weather variables to help predict the number of wildfires to expect from different weather conditions.

\[ \text{Fires} = \beta_0 + \beta_1 \text{Temperature} + beta_2 \text{Rainfall} + \beta_3 \text{Humidity} + \beta_4 \text{WindSpeed} + \epsilon \]

  • \(beta_0\) is the intercept (baseline for fires)
  • \(\beta_1, \beta_2, \beta_3, \beta_4\) is the effect of each environmental variable
  • \(\epsilon\) is the random error term

Predicted Fires Formula

The following formula is used to estimate the expected number of wildfires based on each environmental variable:

\[ \hat{Fires} = \hat{\beta}_0 + \hat{\beta}_1 \cdot Temperature + \hat{\beta}_2 \cdot Rainfall + \hat{\beta}_3 \cdot Humidity + \hat{\beta}_4 \cdot WindSpeed \]

Each coefficient (\(\hat{\beta}\)) measures how the environmental factors either increase or decrease wildfire frequency.

3D Interactive Plotly

Interactive Heatmap

Conclusion

By using ggplots, 3D surface plots and heatmap plots, I was able to show the relationship and effect that the different environmental factors have on the risk of fires.

The following observations can be made from the simulated data:

  • Increased Temperature, increases wildfire frequency.
  • Decreased Rainfall, shows a decrease in wildfire frequency.
  • Decreased Humidity, decreases wildfire frequency.
  • Increased WindSpeed, shows an increase in wildfire frequency.