Docsity

climatologia appunti, Appunti di Climatologia

Toggle sidebar
bg1
MT1007. Climate Change.
This first case study will examine the science behind climate change and the evidence for it. Since
this, like the rest of the course, will involve mathematical and statistical models, it’s a good idea to start
by considering what a model is, what a mathematical model is and why we need statistical models.
1 Mathematical models
Science is about figuring out how nature works, so that we can predict what it will do in the future.
Models play an important part in that process. Physical models of things have been used in science
and engineering for a long time. For example, to understand and predict how bridges will respond to
high winds, it is common practice to build model bridges and to measure how they behave in a wind
tunnel. This helps understanding of airflow around the structure, and helps to predict which designs will
perform well in practice and which will not. An important point about such models, is that they are not
exact miniature replicas of the bridges of interest (we can’t, for example, build a 1/200th scale model
using 1/200th scale atoms), rather they are models designed to capture the features of a bridge that are
important for air flow.
Similarly, if we want to produce a model suitable for investigating and explaining the workings of a
steam engine, it would be foolish to take a full size working engine and scale it down: the walls of the
boiler would be too thin for one thing, but also the full engine has many detailed bits of engineering
designed to maximise its efficiency and optimize its practical usefulness. A good model steam engine
really doesn’t need these and should be considerably simplified.
Orreries are another example of physical models: these are clockwork models of the solar system,
designed for showing and predicting the positions of the planets in the solar system. There is a particularly
splendid orrery on display in the Physics building, just up the stairs from the PC classroom. Again,
although often quite elaborate, orreries do not attempt to represent the system they describe exactly, but
rather to represent some aspects of the system accurately enough to serve their purpose.
So, the key feature of models is that they are simplified representations of the thing that they represent,
designed to describe some aspects of it quite accurately, but omitting many less relevant or important
details in the interests of clarity and simplicity. The idea of mathematical modelling is to keep this basic
approach, but to do away with the physical representation part, describing the modelled system by some
equations rather than by a physical object.
1.1 A mathematical model of planetary motion
As an example let’s consider constructing a mathematical model to take the place of an orrery. That is,
let’s build a mathematical model of the motion of a smallish planet around a star.1. To start with we’ll
make some simplifying assumptions, to strip the model of un-neccessary or minor detail.
•Let’s only consider the motion of the planet in 2 dimensions (actually just a matter of choosing the
right co-ordinate system), and assume that the star is fixed at position x= 0 , y= 0, while the
planet moves around with its position given by co-ordinates xand y.
•We’ll assume that the star’s position is unaffected by the planet (a good enough approximation if
the planet is much smaller than the star).
•Finally we’ll assume that the gravity acts according to Newton’s model of gravity and that the
planets movement is governed by Newtons “laws” of motion (these are very accurate provided the
planet isn’t moving too fast, and are a much simpler model than Einstein’s).
So the basic set up is:
1This is one of those examples that you should certainly not learn for the exam - it is here purely to help you understand
the important concept of a model.
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Anteprima parziale del testo

Scarica climatologia appunti e più Appunti in PDF di Climatologia solo su Docsity!

MT1007. Climate Change.

This first case study will examine the science behind climate change and the evidence for it. Since this, like the rest of the course, will involve mathematical and statistical models, it’s a good idea to start by considering what a model is, what a mathematical model is and why we need statistical models.

1 Mathematical models

Science is about figuring out how nature works, so that we can predict what it will do in the future. Models play an important part in that process. Physical models of things have been used in science and engineering for a long time. For example, to understand and predict how bridges will respond to high winds, it is common practice to build model bridges and to measure how they behave in a wind tunnel. This helps understanding of airflow around the structure, and helps to predict which designs will perform well in practice and which will not. An important point about such models, is that they are not exact miniature replicas of the bridges of interest (we can’t, for example, build a 1/200th scale model using 1/200th scale atoms), rather they are models designed to capture the features of a bridge that are important for air flow. Similarly, if we want to produce a model suitable for investigating and explaining the workings of a steam engine, it would be foolish to take a full size working engine and scale it down: the walls of the boiler would be too thin for one thing, but also the full engine has many detailed bits of engineering designed to maximise its efficiency and optimize its practical usefulness. A good model steam engine really doesn’t need these and should be considerably simplified. Orreries are another example of physical models: these are clockwork models of the solar system, designed for showing and predicting the positions of the planets in the solar system. There is a particularly splendid orrery on display in the Physics building, just up the stairs from the PC classroom. Again, although often quite elaborate, orreries do not attempt to represent the system they describe exactly, but rather to represent some aspects of the system accurately enough to serve their purpose. So, the key feature of models is that they are simplified representations of the thing that they represent, designed to describe some aspects of it quite accurately, but omitting many less relevant or important details in the interests of clarity and simplicity. The idea of mathematical modelling is to keep this basic approach, but to do away with the physical representation part, describing the modelled system by some equations rather than by a physical object.

1.1 A mathematical model of planetary motion

As an example let’s consider constructing a mathematical model to take the place of an orrery. That is, let’s build a mathematical model of the motion of a smallish planet around a star.^1. To start with we’ll make some simplifying assumptions, to strip the model of un-neccessary or minor detail.

  • Let’s only consider the motion of the planet in 2 dimensions (actually just a matter of choosing the right co-ordinate system), and assume that the star is fixed at position x = 0 , y = 0, while the planet moves around with its position given by co-ordinates x and y.
  • We’ll assume that the star’s position is unaffected by the planet (a good enough approximation if the planet is much smaller than the star).
  • Finally we’ll assume that the gravity acts according to Newton’s model of gravity and that the planets movement is governed by Newtons “laws” of motion (these are very accurate provided the planet isn’t moving too fast, and are a much simpler model than Einstein’s).

So the basic set up is:

(^1) This is one of those examples that you should certainly not learn for the exam - it is here purely to help you understand the important concept of a model.

star is located at 0,0 and fixed

distance from planet to star is r

arrow shows direction of force and hence acceleration on planet

planet is located at x,y and moves

x axis

y axis

where the distance r from the star to the planet is given by r =

x^2 + y^2. Now, Newton’s model of motion says that the acceleration^2 a experienced by the planet will be related to the force f exerted on it by f = ma

where m is the mass of the planet. His model of gravity says that the force f exerted on the planet will be related to the distance r between the star and the planet according to:

f =

k r^2

where k is a constant involving the mass of the star and the planet. So the model says that the acceleration of the planet is given by:

a =

k m

r^2

The constants m and k only involve masses and distances, so if we choose the units in which we measure length and mass carefully enough we can re-write this as:

a =

r^2

without losing any important details. The acceleration is always in the direction towards the star. To get a model that we can solve to find the motion of the planet, we need to split the acceleration into the part ax in the direction of the x axis and the part ay in the direction of the y axis. Basic theory of vectors makes this quite easy: ax = − x r

a ay = − y r

a

(The minus signs ensure that the star is attracting the planet and not repelling it!). Now let’s define:

dx dt

= x′^ and

dy dt

= y′^ (1)

... the speed of the planet in the x and y directions. Acceleration is just rate of change of speed with respect to time, so the equations for ax and ay become:

dx′ dt

x r^3 and

dy′ dt

y r^3

Equations 1 and 2 constitute our mathematical model for the motion of a planet around a massive star. Given an initial position for the planet x, y, and an initial velocity x′, y′, the equations can be solved in order to find out where the planet will go. There are excellent numerical methods available for solving systems of ordinary differential equations like this model. One such method is implemented in R package mt1007. Using it to solve the above system of equations with initial position (1,0) and initial velocity (0,0.8) gave the following picture for the path of the planet (obtained by plotting y against x):

(^2) rate of change of speed

electron gun

A

B

C

electron

detectors

path of electron

Determinists would expect all the electrons to end up in detector B, but if the slit is narrow enough this is not what happens. Some electrons end up in B, but some also end up in A or C, and according to quantum mechanics there is nothing that can be done or measured to help predict which detector a particular electron will end up in. On the other hand if you fire a large number of electrons at the slit and count up the numbers ending up in A, B or C then there is a pattern - more electrons end up in B than in C or A, and roughly equal numbers end up in B and C. Hence you can not say precisely where a particular electron will end up, but you can give the probability that it ends up in any one of the three detectors. In fact quantum mechanics enables you to work out the probabilities. This sort of uncertainty pervades the physics of the very small: it is fundamentally impossible to make precise predictions about the behaviour of sub-atomic particles, all we can do is predict probabilities. This is perhaps best summed up by the famous Heisenberg uncertainty principle, which states that it is impossible to simultaneously measure the position and momentum (mass × speed) of a particle (e.g. an electron) accurately. Indeed (considering a particle moving in one dimension only) if the innaccuracy in knowledge of momentum is ∆p and the innaccuracy in knowledge of position is ∆x then:

∆p∆x ≥

h 4 π (h is Planck′s constant)

So quantum mechanical models are not deterministic. For example, each realisation of the quantum mechanical model for the electron passing through a slit will give a different result, only the probabilities of those results are constant. Quantum mechanics is the best description of the very small that we have, and randomness is fundamental to it. Less fundamental, but of equal practical importance in overturning the sumpremacy of determinism were discoveries in biology. Biologists have long wanted to be able to produce mathematical models that predict and explain the behaviour of biological things, from cells to populations of plants or animals. One of the major problems in doing this is that individuals differ so much, even if they share parents and developed under near identical conditions. As the mechanisms underlying development, evolution and inheritance were uncovered, it became clear why all this variability exists. Essentially, at conception each of us gets a randomly selected half of our mother’s genetic material and a randomly selected half of our father’s. The mechanism by which the random selection is done allows a staggering number of possible ways of splitting the genetic material in half, and there is no way of predicting which of these ways will actually occur. Hence there is a randomizing mechanism right at the heart of biological systems, and the variability it produces ensures that biology is not deterministic in any useful practical sense. Now, biological systems and sub atomic particles are respectively very complicated and very small. Deterministic models can’t provide all the answers for these, but what about for simpler, middle sized things? For a while scientists tended to think that deterministic models would still always provide the best models in these cases. They thought, for example, that deterministic models would be completely adequate for describing the Earth’s atmosphere, which is basically just a layer of gas subject to external heating. As we shall see, the phenomenon of chaos means that this is not so. But we will cover chaos in more detail having introduced the background to the scientific case study on climate. So, in many cases, for quite fundamental reasons, deterministic mathematical models do not provide adequate models. Statistical models are a solution to this problem. Statistical models are mathematical models, each replicate realisation of which will be different from other realisations from the same model, even under identical conditions. Statistical models are the major means of making sense of real data and are the main focus of this course.

2 Climate change and carbon dioxide

Climate change is one of the most important environmental, scientific and political issues facing people today. The scientific consensus is that human activities in the form of deforestation and the burning of fossil fuels has lead to an increase in the amount of carbon dioxide in the atmosphere. This carbon dioxide traps heat at the bottom of the earth’s atmosphere, which changes the earth’s climate^3. However, there are some scientists and a large number of non-scientists (including US president George W. Bush), who are sceptical that increased carbon dioxide levels are changing the climate. In this case study we will use deterministic and statistical models to examine the issue of climate change. Let’s start with carbon dioxide. Life is carbon based. That is, the complicated organic compounds from which living things are composed all contain large amounts of carbon. Hence when organic matter burns or decays it releases carbon, much of it as carbon dioxide. In the absence of human activities the amount of CO 2 in the atmosphere tends to stay roughly constant: the CO 2 given off by decaying/burning plants or animals that have died is eventually just re-absorbed by new living plants. What upsets this is when humans remove and burn large areas of forest, without replacing it, or burn fossil fuels. Fossil fuels, like oil, gas and coal are all made up from the bodies of organisms that lived and died many millions of years ago. The bodies of these animals formed layers of sediment at the bottom of ancient seas and over time were buried. Eventually this carbon rich organic material was buried deep under layers of sedimentary rock, and over the millenia ended up forming, oil, gas and coal deposits. When humans extract this fossil fuel and burn it, a large proportion of the carbon content of the fuel ends up as CO 2 in the atmosphere. There is no way around this problem since it is the carbon that is the energy source in the fuel. The way in which carbon flows through the earth’s ecosystem is fairly complicated: huge amounts of carbon circulate through the system all the time. In fact human production of CO 2 only accounts for 3-4% of the CO 2 entering the atmosphere at any given time. The problem arises, because this is 2-3% more than can be removed by natural processes, so the human contribution to atmospheric CO 2 just keeps on growing. For a while people hoped that all this extra carbon dioxide would just get mopped up naturally. It’s worth looking at some data to see what is actually happening. Long term records of carbon dioxide are a little hard to come by. It was not measured until fairly recently. Even recent records can be a little difficult to interpret, as CO 2 levels can vary locally as a result of local biological processes. Antarctica is quite a good place to measure CO 2 , because it’s fairly lifeless and hence likely to give a fairly reliable picture of CO 2 changes without local biases. Furthermore, as antarctic ice is deposited, air gets trapped within it. Ice deep within the ice cap is old and contains old air, and if this air is extracted then its CO 2 content can be measured. The R package mt1007 includes a dataset siple.co2 containing measured CO 2 concentrations dating back to 1744, while more recent trends are covered by dataset south.co2, which contains direct CO 2 measurements at the South Pole. These are easily plotted together using R:

library(mt1007) data(siple.co2) attach(siple.co2) data(south.co2) attach(south.co2) plot(year,co2,xlim=c(1744,2000),ylim=c(250,400),main="Antarctic co2 record") points(Year,Annual)

(^3) The story is not quite as simple as the one given here, human activities have also increased the amount of methane in the atmosphere, which is also a greenhouse gas, and ozone depletion also contributes to the problem, by allowing more of the energy from the sun through the upper atmosphere. Then there is the contribution of water vapour the problem of reflective ice, snow and clouds, etc., etc.

would be very chilly, on average probably around 30C cooler than now, although CO 2 is only one of the contributers to this. So, CO 2 has increased in the atmosphere as a result of human activities, and there are good scientific reasons to believe that this will increase temperatures in the lower atmosphere and on the earth’s surface. Has this happened? The dataset CT150, contains average global temperatures since 1856, which is as far back as reliable direct measurements of temperature extend:

data(GT150) attach(GT150) plot(year,temp,type="l",main="Global mean temperature deviations from 1961-1990 mean")

1860 1880 1900 1920 1940 1960 1980 2000

−0.

−0.

Global mean temperature deviations from 1961−1990 mean

year

temp

This plot does appear to show an increase in global mean temperature over the period of most rapid increase in CO 2 concentrations, but it’s much less clear cut that the plot for CO 2 increase. In particular what is striking is how variable the mean temperature appears to be. It is this that causes sceptics to doubt that climate change is really happening. They argue that since climate is highly variable anyway, the apparent recent upswing in the data is just one of those chance events that is likely to happen from time to time. We’ll examine this claim shortly using statistical models, but first let’s have a look at how deterministic mathematical models cope with modelling weather and climate, and what they can tell us. This will also help explain why weather forecasting is so difficult and short term, and why chaos is yet another phenomenon that undermines determinism.

3 A simple mathematical weather model: the Lorenz model.

As part of ongoing attempts to understand the atmosphere, in order to be able to predict its behaviour, Lorenz suggested an extremely simple mathematical model of a hugely simplified atmosphere. At its most basic, the atmosphere is a volume of gas which is warmer at the bottom than at the top. This gross simplification is the basis of the Lorenz model. Specifically, imagine a closed rectangular box filled with air, and suppose that you apply a heat source uniformly to the bottom of the box. The physics of fluid flow tells you what will happen to the air in the box: if the bottom of the box is hot enough the air will start to circulate as illustrated here...

air in box forms rotating cylinder

bottom of box is heated The warm air at the bottom starts to rise and cool air from the top has to sink to replace it - this leads to a cylindrical pattern of airflow with warm air rising up one side of the box and cold air sinking down the other side. It turns out that this situation can be described quite accurately by a simple model consisting of 3 ordinary differential equations^4 :

dx dt

= δ(y − x) (3) dy dt = rx − y − xz (4) dz dt

= xy − bz (5)

The model variables have the following meanings: x is the rate of rotation of the cylinder of air - essentially this gives the wind speed in the model atmosphere; y is the difference in temperature between the vertical sides of the cylinder, in effect between the rising warm air and the falling cold air; z measures how different the top-to-bottom temperature profile is from a straight line. The parameters of the model are as follows: δ is the ratio of the viscosity of the air to its thermal conductivity (!?); r is the difference in temperature between bottom and top of the box; b is the ratio of the width of the box to its height. The most interesting parameter for this case study is r, since we expect increased CO 2 concentrations to increase the temperature difference between the bottom and top of the atmosphere. δ = 10, r = 28 and b = 8/3 are sensible parameter values. Now let’s solve the model numerically (it isn’t possible to find a solution analytically). The R package mt1007 includes a function to efficiently and accurately solve this model.

library(mt1007) s<-c(-9,-3,32); co<-c(10,28,8/3) l<-lorenz(0,50,dt=0.1,s,co,tol=1e-7) plot(l$t,l$x,type="l")

(^4) This will be the last differential equation model used!

4 Is the recent warming more than “random variation”?

Sceptics argue that the case for climate change actually happening is weak. They argue that there are so many complicating factors in the way that climate is controlled that we really cannot tell whether increasing C0 2 concentration will have a serious impact on the climate, or whether all sorts of natural control mechanisms (decreased water vapour in the atmosphere, increased cloud cover or whatever) will mean that the changes will be barely noticeable. After all, they argue, the Earth’s climate has stayed within quite tight limits (give or take the odd ice age) for hundreds of millions of years, so there must be some natural control mechanisms in place. In addition, as we have seen by examining the behaviour of the Lorenz model, there are considerable difficulties inherent in using deterministic models to help understand climate - we can never expect nature to support our models in the uniquivocal way that the motion of the planets supported Newton, Laplace and later Einstein. This isn’t to say that nothing useful can be learned from deterministic climate models, just that we will need to use alternative approaches as well. One of the main planks of the argument against climate change being real is that the data just don’t provide enough support for it. The basic reasoning goes as follows:

The climate varies widely and randomly from year to year. This means that, even if the climate is not changing in the long run, every now and then we are bound to get a chance sequence of increasingly warm years like the sequence in the real record.

— this is an argument that we can investigate quite rigorously using statistical models. If the argument has substance, then we ought to be able to produce a statistical model that produces temperature trajectories that:

  1. look like the real one,
  2. have a reasonable probability of every now and then going on an excursion like the one seen at the end of the real data, but
  3. do not display any long term trend.

If we can not do this, then it is reasonable to conclude that the recent increases are more than mere chance (or at least that the sceptics really need to be able to come up with a reasonable statistical model that can behave in the way that they are claiming the real system behaves). Here, again, are the real data:

1860 1880 1900 1920 1940 1960 1980 2000

−0.

−0.

Global mean temperature deviations from 1961−1990 mean

year

temp

To build a sceptics statistical model of these data we need a mathematical way of building randomness into the model. The basic idea is that if the climate had started from a slightly different initial state in 1856, we would have got a different series - some of its properties would be like the original series, but the actual temperature in any given year would bear little or no relation to the temperature that we actually observed given the actual state in 1856. How can we model this sort of non-repeatability mathematically? The answer is to introduce the concept of a random variable.

4.1 Random variables

Before introducing random variables recall the definitions of two characteristics of a set of data x 1 , x 2 ,... , xn.

  1. The mean (or average) of the set of data is^5

¯x =

n

∑^ n

i=

xi.

  1. The variance of the set of data is 1 n − 1

∑^ n

i=

(xi − x¯)^2

and is a measure of how spread out the data are around their mean (don’t worry about the n − 1 at this stage - it will be explained in the theory section). Random variables will be given a fairly rigorous mathematical definition in the theory section of the course, for the moment they will be defined by their behaviour. Essentially a random variable is a variable which has a different value every time you make an observation of it. The defining property of a random variable is its distribution: this defines the probability that the variable takes any of its possible values. Here are some examples.

  • Let X be a random variable which can take the values 0, 1 or 2, and suppose that the following table summarises its distribution.

x 0 1 2 Pr[X = x] 0.3 0.5 0.

What this means is that if we take an observation of X we can not say in advance exactly what value it will have. All we can say is that it has a probability of 0.3 of taking the value 0, a probability of 0.5 of taking the value of 1 and probability 0.2, of taking the value 2. In other words, if we took a very large number of observations of X we would expect about three tenths of them to be 0’s, about half of them to be 1’s and about a fifth of them to be 2’s.

  • Let Y be a random variable which can take any value in the interval (0, 1) with equal probability. This means that before we take an observation of Y all we can say is that any value between zero and one is equally likely to occur, although the observation will not be outside that interval. Y is said to have a uniform distribution on (0, 1): the mathematical notation for writing this compactly is Y ∼ U (0, 1). R has many built in functions for generating observations of random variables for you. The following generates 12 observation of Y :

runif(12,0,1) [1] 0.37199711 0.73802148 0.57553934 0.22207002 0.70358750 0. [7] 0.86158794 0.52360403 0.08799612 0.90849577 0.12890279 0.

As you would expect, calling function runif() again yields a different set of numbers:

runif(12,0,1) [1] 0.76815408 0.69212806 0.54376955 0.73546762 0.46736725 0. [7] 0.92261148 0.04319168 0.92960260 0.25693702 0.87677743 0.

  • A rather useful model for all sorts of situations is provided by random variables that have a so called normal distribution. The normal distribution has two controlling parameters μ and σ^2. Writing Z ∼ N(μ, σ^2 ) means “Z has a normal distribution with parameters μ and σ^2 ”. R has a function rnorm() for simulating normal r.v.s. For example let’s simulate 12 normal random deviates with μ = 1 and σ^2 = 16: (^5) Remember that ∑n i=1 zi^ =^ z^1 +^ z^2 +^ z^3 +^...^ +^ zn, i.e. it is the sum of^ z^1 , z^2 , z^3 and so on up to^ zn.

4.2 Building a (sceptics) simple statistical model of the temperature anomaly

series

Having introduced the notion of random variables, it is now possible to try constructing a suitable model of the temperature series, that will embody the sceptics ideas about what is happening to the climate. A sensible strategy to follow is to start simple, and only add just enough complexity to do an adequate job of modelling the series. The simplest statistical model for the series is probably to assume that the temperature is a constant plus a random error term. Formally, our model is that global mean temperature in year i is:

Ti = α + Ei

where Ei is a random variable and α is the average temperature. To complete the specification of the model we need to give Ei a distribution. Let’s choose a Normal with mean 0 and variance σ^2. i.e.

Ei ∼ N (0, σ^2 )^7

Given values of α and σ^2 , the model provides a recipe for generating data. The idea is that if the model is a good one, then it provides a recipe by which the original data could have been generated. For example if α = 0.5 and σ = 0.9 then we could simulate a set of data in R as follows:

alpha<-0. e<-rnorm(144,0,0.9) temp<-alpha+e year<-1856: plot(year,t,type="l",main="Simulation from simple GT model" )

1860 1880 1900 1920 1940 1960 1980 2000

−

−

0

1

2

3

Simulation from simple GT model

year

temp

If you compare this with the real data it doesn’t look great, but of course one problem is that α and σ^2 were just plucked out of the air, and it would make more sense to choose values that are representative of the data. Let’s estimate α and σ^2 by setting them equal to the mean and variance of the data, respectively. This is easily done:

data(GT150) alpha<-mean(GT150$temp) sigma<-var(GT150$temp)^0. temp <- alpha + rnorm(144,0,sigma) plot(year,temp,type="l",main="Simple, but estimated, GT model" )

(^7) We could have written down this model more simply as Ti ∼ N(α, σ (^2) ), but this would not have been so easy to extend.

1860 1880 1900 1920 1940 1960 1980 2000

−0.6 −0.4 −0.

Simple, but estimated, GT model

year

temp

This is better, but still doesn’t really look anything like the original series: the variations from one year to the next are too pronounced, the model never produces runs of warm or cool years in the way that the real data seem to. Clearly we wouldn’t convince anybody that this model was a suitable description of the climate, at any level. But before moving on to try other models it’s worth re-emphasising one key point about statistical models. Re-simulating the model under identical circumstances, gives a different trajectory:

temp <- alpha + rnorm(144,0,sigma) plot(year,temp,type="l",main="Simple, but estimated, GT model: 2nd replicate")

1860 1880 1900 1920 1940 1960 1980 2000

−1.

−0.

−0.

Simple, but estimated, GT model: 2nd replicate

year

temp

The probabilities of the model being in various states haven’t changed, but the details of what actually happened are quite different.

4.3 An alternative simple model

The first attempt at modelling the global temperature series produced model trajectories that looked nothing like the data, and hence can’t be used as the basis for drawing any conclusions about the climate. Part of the problem was that we never got the runs of warm or cool years that the real data seem to show. As an alternative, let’s try a model in which the temperature this year is given by the temperature last year plus a random term. i.e. the model for the temperature in year i + 1 is:

Ti+1 = Ti + Ei where Ei ∼ N(0, σ^2 )

This sort of model is known as a “Random walk” (it actually works very well as a model of the way in which a molecule of gas moves in still air). In a way, this is an even simpler model than the previous one, in that it only has one parameter to estimate: σ^2. To see how to estimate σ^2 , which is just the variance of Ei, note that: Ei = Ti+1 − Ti.

between Ti+1 and Ti, corrupted by some random “error”. Hence, if we plot the temperature anomalies for each year against the temperature anomalies the previous year, we should see a straight line relationship, from which α and β can be estimated. To do this, create an array of temperatures from 1857-1999 and an array of temperatures from 1856-1998, and plot one against the other:

attach(GT150) t0<-temp[2:144] t1<-temp[1:143] plot(t1,t0,xlab="temperature last year",ylab="temperature this year")

-0.4 -0.2 0.0 0.2 0.4 0.

-0.

-0.

temperature last year

temperature this year

-0.4 -0.2 0.0 0.2 0.4 0.

-0.

-0.

temperature last year

temperature this year

The plot on the left is the raw plot, while the plot on the right superimposes an approximating straight line and a grid to help estimate its slope and intercept. The intercept term appears to be about -0.02, while the line goes up 3.5 squares while going across 4 squares, making a slope of about 3. 5 / 4 ≈ 0 .88. Hence -0.02 and 0.88 are reasonable estimates for α and β respectively. What about σ^2? σ^2 is the variance of the Ei terms. Re-arranging the model gives:

Ei = Ti+1 − α − βTi

Hence if we find the variance of the observed values of:

Ti+1 + 0. 02 − 0. 88 Ti

we should get a reasonable estimate of σ^2 (recall that observed Ti+1 are in t0 while observed Ti are in t1):

var(t0+0.02-0.88*t1) [1] 0.

The R commands to simulate from this model and plot the results are straightforward. Complete them yourself:

t<-array(0,144) t[1]<-temp[1] e<-rnorm(144,0,0.014^0.5)

for (i in 1:143)

plot(year,

1860 1880 1900 1920 1940 1960 1980 2000

−0.

−0.

−0.

ar(1) GT model

year

t

... clearly we are now well on the way towards having a reasonable model. Given how much better this model is than the previous efforts, it is worth thinking more carefully about estimating its parameters: drawing a line by eye is not very objective, and it is possible to come up with much better mathematical methods.

4.4.1 Least squares estimation

Drawing a line on the Ti− 1 vs Ti plot was a matter of trying to find a line that on average is not too far from any of the data points. This is a sensible aim to keep in mind when constructing a mathematical method for estimating the slope and intercept of the model. So, to start constructing a mathematical method for estimating α and β, we need first to find some way of measuring how well the line fits the data. i.e. how well does the line α + βTi fit the observations Ti+1? Consider the differences between Ti+ and α + βTi. Some sort of total of these differences would be a good measure of how well the model fits. A straight sum of the differences would be one possibility:

n∑− 1

i=

(Ti+1 − α − βTi)

... but the problem with this is that big positive terms in the sum cancel big negative terms, which means that the line can be a long way from some Ti+1’s without this measure of fit noticing. An obvious alternative would be to use: n∑− 1

i=

|Ti+1 − α − βTi|

which would eliminate the problem with the straight summation, but suffers from the disadvantage of be- ing mathematically quite awkward to work with because of having to take magnitudes. A mathematically easier quantity to work with is the sum of squared differences:

n∑− 1

i=

(Ti+1 − α − βTi)^2

... and methods based on this measure of model fit have some very “nice” properties.^8 The following figure schematically illustrates what is being done: (^8) This measure of fit is also a very natural measure if the differences between the line and the data Ti+1 can be modelled as observations of normal r.v.s, but more theoretical apparatus is needed in order to pursue this point.

1860 1880 1900 1920 1940 1960 1980 2000

−0.

−0.

−0.

Estimated ar(1) GT model

year

t

4.4.2 Covariance, correlation and the acf

Now that we have a model that isn’t obviously wrong, we need to devote a little more effort to finding ways of assessing just how close to reality it is. We are interested in knowing whether the randomness in the temperature series, coupled with the way in which one year’s temperature is related to previous years’ temperatures, is sufficient to produce runs of increasing temperature like the one that has happened, or whether we’ll have to look for another explanation of the temperature rise (i.e. CO 2 driven climate change). The dependence structure of one year’s temperature on previous year’s temperatures is crucial here: what is needed is a direct way of representing this, in order to allow comparison of model output and the real data. To see how to do this we need a new concept: covariance. Recall that the variance of a set of data x 1 , x 2 ,... , xn is:

1 n − 1

∑^ n

i=

(xi − x¯)^2

The covariance of one set of data x 1 , x 2 ,... , xn with another set y 1 , y 2 ,... , yn is

1 n − 1

∑^ n

i=

(xi − x¯)(yi − y¯)

Notice how the covariance of the xi’s with themselves is just the variance of the xi’s. The following figure attempts to illustrate what it is that covariance measures:

( y -yi - ) -ve

( x -xi - ) +ve ( x -xi - )( y -yi - ) -ve

x, y-^ -

( y -yi - ) +ve ( x -xi^ - ) +ve ( x -xi - )( y -yi - ) +ve

( y -yi - ) -ve

( x -xi - ) -ve ( x -xi - )( y -yi - ) +ve

( y -yi - ) +ve

( x -xi^ - ) -ve ( x -xi - )( y -yi - ) -ve

( y -yi - ) -ve

( x -xi - ) +ve ( x -xi - )( y -yi - ) -ve

x, y-^ -

hence .....cov( x , y )= Σ( x -xi - )( y -yi ) -ve -

( y -yi - ) +ve ( x -xi^ - ) +ve ( x -xi - )( y -yi - ) +ve

( y -yi - ) -ve

( x -xi - ) -ve ( x -xi - )( y -yi - ) +ve

( y -yi - ) +ve

( x -xi^ - ) -ve ( x -xi - )( y -yi - ) -ve

( y -yi - ) -ve

( x -xi - ) +ve ( x -xi - )( y -yi - ) -ve

x, y-^ -

hence .....cov( x , y )= Σ( x -xi - )( y -yi - ) 0

( y -yi - ) +ve ( x -xi^ - ) +ve ( x -xi - )( y -yi - ) +ve

( y -yi - ) -ve

( x -xi - ) -ve ( x -xi - )( y -yi - ) +ve

( y -yi - ) +ve

( x -xi^ - ) -ve ( x -xi - )( y -yi - ) -ve

1 hence .....cov( x , y )= Σ( x -xi - )( y -yi - ) +ve n-1___ n-1___^1 n-1___

The figure on the left shows a positively correlated set of x and y data (i.e. large x values correspond to large y values, small x values to small y values). The figure is split into 4 quadrants: y > ¯y and x > x¯; y < y¯ and x < ¯x; y < ¯y and x > x¯; y > y¯ and x < ¯x. Clearly, from the way that the points fall into the quadrants, this picture corresponds to positive covariance. The middle panel shows covariance quite close to zero (at least when compared to the variances of x and y)... there are roughly equal numbers of points in all 4 quadrants, so that positive terms in

(xi − ¯x)(yi − y¯) will tend to balance the negative

terms, leading to a covariance near zero. The final panel on the right shows negatively correlated x and y data. In this case most points fall into the quadrants making a negative contribution to

(xi − x¯)(yi − y¯), so the covariance is negative. Notice how data lying very close to a straight line will tend to have mostly terms of the same sign in the covariance, which tends to increase the magnitude of the covariance. More scattered data will have more points falling in all 4 quadrants, so that there is always some cancelling of negative and positive terms, leading to a reduction in covariance:

( y -yi - ) -ve ( x -xi - ) +ve ( x -xi - )( y -yi - ) -ve hence .....cov( x , y )= Σ( x -xi - )( y -yi - ) is high

( y -yi - ) +ve

( x -xi - ) +ve ( x -xi - )( y -yi - ) +ve

( y -yi - ) -ve ( x -xi - ) -ve ( x -xi - )( y -yi - ) +ve

( y -yi - ) +ve ( x -xi^ - ) -ve ( x -xi - )( y -yi - ) -ve

( y -yi - ) -ve ( x -xi - ) +ve ( x -xi - )( y -yi - ) -ve hence .....cov( x , y )= Σ( x -xi - )( y -yi ) is lower -

( y -yi - ) +ve ( x -xi^ - ) +ve ( x -xi - )( y -yi - ) +ve

( y -yi - ) -ve ( x -xi - ) -ve ( x -xi - )( y -yi - ) +ve

( y -yi - ) +ve ( x -xi^ - ) -ve ( x -xi - )( y -yi - ) -ve

n-1___^1 n-1___

The only problem with covariance, as a measure of how variables are related to each other, is that it mixes up the variability of the variables with their relatedness. For example, if x is very variable then (xi − x¯) will typically be large so that

(xi − x¯)(yi − y¯) will tend to be large, even if x and y show little correlation. This can make the interpretation of covariances a bit difficult. A more interpretable measure of how related two variables are is the correlation coefficient, r which is obtained by dividing the covariance of x and y by their standard deviations:

r =

√∑^ i(xi^ −^ ¯x)(yi^ −^ y¯) i(xi^ −^ x¯)

i(yi^ −^ y¯) 2

r measures the relatedness of x and y independent of how variable they are individually. It is positive, negative or near zero, in the same circumstances as the covariance, but is bounded between -1 and +1. r = 1 (-1), correspond to points lying exactly of a straight line, with positive (negative) slope. Looking at the correlation between temperatures in neighbouring years is a very useful way of exam- ining the patterns of relatedness between different years. For example, here is how you could work out the correlation between one year’s temperature and the next:

data(GT150) t0<-GT150$temp[2:144] t1<-GT150$temp[1:143] cor(t0,t1) [1] 0.

If we work out the correlations between year i and year i − m for a range of m’s and then plot these correlations against m, we’ll get what is known as an auto correlation function (acf). Production of acf plots is built in to R in package ts...

library(ts) acf(GT150$temp,lag.max=40,main="ACF of global temperature series")