Is There Climate Change in Austria?

In this post I analyse the development of mean temperatures in Austrian towns to find evidence for climate change. Using band-pass filters I extract a trend from climate data and find that though mean monthly temperatures tended to decrease during the 50s and 60s they have persistently increased by about 1.5 degree Celsius over the past four decades.

When sitting at the Christmas table yesterday my father and brother were talking about how we used to have white Christmas (in my Austrian home town) when we were younger, whereas we did not have much snow during the past few years. So they concluded that there must have occurred some sort of climate change during the last years. That topic caught my attention and I was wondering whether I could find empirical evidence for their intuition.

I quickly got my notebook and searched the web, where I found suitable data at the national weather service. I downloaded the file, unzipped it and loaded data for a particular weather station into R. The sample consists of daily observations of minimum and maximum temperatures. To make the data more comprehensive I calculated daily means/medians and constructed monthly averages of them. The graph that results from this transformation looks like pure noise that is interrupted in the late 60s. This is straightforward, since the data is not seasonalised and contains only one observation for the year 1968.

Since I thought that extracting a trend with a linear regression would require me to make too much assumptions about the underlying trend, I decided to use filters. For a short intro to the topic see here. The graphic illustration of the results in figure 1 are quite compelling.


Figure 1

Figure 1 plots the trend part of a Hodrick-Prescott filter and the sum of some wavelet filter layers. Both indicate that there was a decline in temperatures from the end 1940s until the mid 1960s. This trend reversed and temperatures have risen since then by some 1.5 degree Celsius.

So, my father and brother were right and there had been some change in the regional climate since they were younger.


# Download data

# Get a list of possible samples
dirs = unlist(strsplit(as.character(dir(paste(getwd(),"/DATEN/Tmax",sep=""))),split="tmax_",fixed=TRUE))
dirs = dirs[dirs!=""]

# Load data
dat = merge(

# Transform
dat = cbind(dat,data.frame("temp"=(dat[,"max"]+dat[,"min"])/2)) # Create daily means
dat[,"date"] = as.Date(as.character(dat[,"date"]),format="%Y%m%d") # Change date format for ggplot2
dat = cbind(dat,"month"=as.character(as.yearmon(dat[,"date"]))) # Create time data only containing year and month

# Create monthly averages
filt = as.character(unique(as.yearmon(dat[,"date"]))) # Get a list of months
g = data.frame("time"=NULL,"temp"=NULL)
for (i in filt){
g = rbind(g,data.frame("time"=as.Date(as.yearmon(i)),"temp"=mean(dat[dat[,"month"]==i,"temp"])))
g = na.omit(g) # Get rid of empty entries

# Plot noisy time series
ggplot(g,aes(x=time,y=temp)) + geom_line() + theme_classic() +
labs(title="Mean Monthly Temperature\n(Some Austrian Town)",x="Year",y="Temperature (°C)")

# Apply Hodrick-Prescott filter
hp = hpfilter(g[,2],freq=240,type="frequency")$trend[,1]

# Apply wavelet filter
w = rowSums([,2],J=9))[,7:10])

# Combine data
g.filter = data.frame("date"=as.Date(g[,1]),"Wavelet"=w,"HP"=hp)
g.filter = melt(g.filter,id.var="date")

# Plot
ggplot(g.filter,aes(x=date,y=value,colour=variable)) + geom_line() + theme_classic() +
labs(title="Trend Temperature\n(Some Austrian Town)",x="Year",y="Temperature (°C)",colour="Filter")

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s