[This article was first published on R-Bloggers – Learning Machines, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Weather and climate are words often used interchangeably in casual conversations. But when a chilly summer breeze sweeps through in July, or when unexpected rains dampen our winter holidays, the age-old debate resurfaces: “Is climate change even real?”

If you want to dive deep into the fascinating realm of chaotic systems to unravel this enigma and distinguish between weather and climate, read on!

You can also watch the video for this post (in German):

The idea to illustrate climate change with a biased Lorenz system comes from the excellent book “The Primacy of Doubt: From Quantum Physics to Climate Change” by my colleague Tim Palmer of the University of Oxford. Professor Palmer is one of the most renowned climate scientists. This blog post, including the R code, was written with the assistance of ChatGPT-4.

At the heart of our understanding of weather and climate lies chaos theory. Both weather and climate are inherently chaotic systems. This means that while they follow deterministic physical laws and equations, their behavior can be wildly unpredictable in the short term due to often extreme non-linear behaviour (the so-called butterfly effect).

Let us illustrate this with another, much simpler chaotic toy-model, the well-known Lorenz system:

(1)

Consider the oscillations of the X variable in these equations as representing our day-to-day weather. Some days are stormy, others sunny, and predicting whether next weekend would be ideal for a beach day can be quite the gamble.

However, when we zoom out and view these oscillations over extended periods, a pattern emerges. This averaged out behavior, where the X variable spends equal time being positive and negative, depicts our climate. It’s the long-term behavior of the atmosphere, predictable in its broader strokes, even if the day-to-day details remain elusive.

But here’s where the plot thickens. What if our equations, our system, receives an external push?

(1)

This slight modification C represents external influences, akin to increased greenhouse gases in our real world. And just like that, our system’s behavior changes. Our Lorenz Attractor’s balance is disturbed.

# Load necessary library
library(deSolve)

# Parameters for the Lorenz System
parameters <- c(sigma = 10, rho = 28, beta = 8/3)

# Initial conditions
initial_conditions <- c(X = 2, Y = 20, Z = 0)

# Time span
t_span <- seq(0, 100, by = 0.01)

# Lorenz System Function (Unbiased)
Lorenz <- function(t, state, parameters) {
with(as.list(c(state, parameters)),{
dX <- sigma * (Y - X)
dY <- X * (rho - Z) - Y
dZ <- X * Y - beta * Z
list(c(dX, dY, dZ))
})
}

# Modified Lorenz System Function (Biased)
ModifiedLorenz <- function(t, state, parameters) {
with(as.list(c(state, parameters)),{
dX <- sigma * (Y - X) + C
dY <- X * (rho - Z) - Y + C
dZ <- X * Y - beta * Z
list(c(dX, dY, dZ))
})
}

# Simulate the unbiased Lorenz system
unbiased_solution <- ode(y = initial_conditions, times = t_span, func = Lorenz, parms = parameters)

# Determine the best C value for biased version
best_C <- 3.920065
parameters_biased <- c(parameters, C = best_C)

# Simulate the biased Lorenz system
biased_solution <- ode(y = initial_conditions, times = t_span, func = ModifiedLorenz, parms = parameters_biased)

# Plotting
# Unbiased Lorenz System
plot(unbiased_solution[ , "time"], unbiased_solution[ , "X"], type = "l", col = "blue", ylab = "X", xlab = "Time", main = "Unbiased Lorenz System")


# Biased Lorenz System
plot(biased_solution[ , "time"], biased_solution[ , "X"], type = "l", col = "blue", ylab = "X", xlab = "Time", main = paste("Biased Lorenz System with C =", best_C))


Our day-to-day weather remains as unpredictable as ever. However, the overall climate shifts. It might lean towards being warmer on average or perhaps wetter. This skew in the average is climate change in action.

So, the next time someone remarks, “It’s such a cold summer; where’s that global warming?”, remember the Lorenz Attractor. A cold day, week, or even month doesn’t negate the long-term trends of climate change. Just as a single dance move doesn’t define the entire performance, individual weather events don’t dictate the broader climate narrative.

Weather is what we experience daily, with its unpredictable twists and turns. Climate, on the other hand, is the average of these twists over decades. And as for climate change? It’s the subtle yet profound shift in this long-term dance, shaped by external forces.

Note: It’s essential to understand that while individual weather events might seem contrary to the global warming narrative, they are merely pieces of a vast and complex climatic puzzle. And although we cannot attribute individual weather events to climate change, as we gather more pieces, the bigger picture of climate change becomes undeniably clear.

To leave a comment for the author, please follow the link and comment on their blog: R-Bloggers – Learning Machines.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

# Never miss an update! Subscribe to R-bloggers to receive e-mails with the latest R posts.(You will not see this message again.)

Click here to close (This popup will not appear again)