Troy's Scratchpad

January 21, 2011

Testing the PHA with Synthetic Data – Part 3

Filed under: Uncategorized — troyca @ 7:00 pm

This is a continuation of Part 1 and Part 2.   Since these datasets are large, I’ve only put up the new synthetic data and the updated Java code here.  Older ones can be retrieved from Part 2.

For a quick summary, Part 1 simply ran the PHA on datasets with an underlying trend and a stochastic component.  Part 2 added in a strong UHI bias, and attempted to see how well the PHA was able to remove this bias.  I believe that post highlighted an area of concern — that the PHA can potentially remove traces of a UHI signal without removing the contamination itself — which had not, to my knowledge, been previously shown with the actual algorithm.

In this (final?) segment, I insert additional inhomogeneities (step and trend) to see how this affects the PHA.  This will go on top of the UHI contamination already present.

Adding Inhomogeneities

There are two separate steps here.

1) Based on the probability of a station change occurring within a year, we determine if a particular month will be the month that a station changes.  If so, a randomly selected step change and trend change are inserted at the month, and subsequent monthly temperatures are adjusted accordingly.

2) Furthermore, we determine if that station will undergo an “instrumentation” change based on the specified probability.  This instrumentation change will insert a cooling bias centered around 1985, to roughly simulate the CRS to MMTS change we see in the USCHNv2 dataset.

Now, if we perform our 1970-2000 pairwise test on the data set that includes the UHI contamination and additional inhomogeneities, we get the following graph:

We see a significantly worse correlation here than in Part 2, obviously due to the inhomogeneities occurring right in the middle of the period we’re examining.

Running the PHA

After running the PHA on the dataset with UHI contamination and inhomogeneities, here is what we get for the average yearly anomalies:

The trends for the various sets are as follows:

Without UHI or Inhom: 0.191 Degrees/Decade

With UHI: 0.389 Degrees/Decade

With UHI + Inhom: 0.370 Degrees/Decade

PHA Adjusted From UHI + Inhom: 0.350 Degrees/Decade

As you can see, we do get a small cooling bias from the inhomogeneities, and the PHA does adjust the trend downwards.  However, one interesting thing here to note is that the 0.350 Post-PHA trend is slightly larger than the 0.345 Post-PHA trend from Part 2, despite this part including the inhomogeneities with an overall cooling bias (and hence starting from a lower point).  This may be due to UHI contamination bleeding into more stations because of the additional change-points detected. 

So, how does it look if we try to search for our original UHI signal after the PHA?

Clearly, as predicted, the additional change-points have smeared this UHI signal even more.  We might expect that with more changepoints (or those of greater effect) this would get diluted further.


As I said in part 2, I think these tests show that we should not expect the PHA to be a miracle worker.  If there is a UHI signal in the RAW or TOB dataset that seems to disappear in the F52 dataset, it does not necessarily imply that the PHA has taken care of it.  It may simply be that the blending of nearby stations has removed the signal, without removing the bias itself.


  1. Thanks for your comment Troy. I see you got the PHA code to run. I was looking at the code a little while back and it was painful to see it in written in old-school F77. When I get around to looking at this in closer detail, I’m definitely re-writing in modern Fortran.

    I see that you had to install Ubuntu in a virtual machine to get the necessary tools to run the code. All the tools you need have been ported to Windows. When I was a Windows user, I was using MinGW and MSYS for my Fortran programming. If you find it a hassle to run a virtual machine, I’d recommend looking into those two.

    Comment by Chad — January 22, 2011 @ 12:37 am

  2. Nice work. I’ve alerted some folks to it.

    Comment by Steven Mosher — January 22, 2011 @ 4:07 pm

RSS feed for comments on this post. TrackBack URI

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

Create a free website or blog at

%d bloggers like this: