Exercise 0-C. Regression Kriging and What a Covariate Buys
Part 0. Fundamentals and Their Failure Modes
| At a glance | |
|---|---|
| Textbook sections | the multivariate interpolation fundamentals behind sections 10.4, 13.2 and 15.6 |
| Fundamentals covered | the relationship between a target and a covariate, trend estimation, residual variograms, regression kriging, held out validation |
| Technical demand | Tier 1 and Tier 2 required. Python with numpy, scipy, pandas and matplotlib |
| Effort | two to three hours including the write up |
| Prerequisites | Exercise 0-B |
Overview
Temperature falls with elevation, and across the Arizona network that relationship is strong enough to carry an interpolation. Regression kriging exploits such a relationship by fitting a trend on a secondary variable and kriging what the trend leaves behind, and co-kriging pursues the same goal through a joint model of the two variables. Either method improves the surface between stations only under one condition, and the condition is that the secondary variable be known where the primary is not. Software presents co-kriging without stating that condition anywhere in its interface.
Students first establish the relationship, fitting mean annual temperature on station elevation and reporting the lapse rate, the correlation and the cross validated error. They then predict temperature three ways from identical points, being ordinary kriging on temperature alone, a linear trend on station elevation with no kriging, and regression kriging, which kriges the residuals from that trend. The program has no terrain grid, so off the stations it interpolates elevation from the same 31 stations, and the exercise asks what that choice does to the surface between stations. Students who predict the outcome before running it, and record their prediction, learn more from the result than students who read it off the report.
Step by step
- Establish the relationship. Tier 1. Change to the toolkit folder inside GeoAI_Exercises and type python exercise_0c.py. The program fits temperature on elevation and reports the slope as a lapse rate in degrees per thousand meters, the intercept, the correlation, r squared, and the root mean square and mean absolute leave one out cross validated errors. Record all six. Then compare the observed lapse rate against the standard atmospheric value near 6.5 degrees per thousand meters and explain the direction of the difference, which has a real physical answer involving surface heating and the elevation distribution of the network.
- Predict three ways. Tier 1. Record the cross validated error under ordinary kriging, under the trend on elevation alone, and under regression kriging. Record the two surfaces the program maps and the difference between them. State which methods improved on ordinary kriging and by how much, and what share of the regression kriging gain the trend alone delivers.
- Explain the result. Tier 1. Cross validation predicts each station from the others. State where elevation is known when the program predicts a held out station, explain why the trend and the regression kriging improve cross validated error there, and state what the surface between stations can gain when elevation there comes from the same 31 points. Section 13.2 defines a proxy as a measure used where the target is difficult or impossible to observe directly at the required scale, frequency or cost, and Table 13.2.1 classes elevation as a mechanistic proxy, so the chapter's definition already carries the condition this step asks about.
Map, three panels. The ordinary kriging surface and the regression kriging surface, each titled with its cross validated error, and the difference between them.
- Break the covariate. Tier 2. Block 4 degrades the elevation covariate by adding noise at each level listed in
NOISE_LEVELSat the top of exercise_0c.py and reruns the regression kriging at each level. Record the cross validated error against the noise level and identify the point at which the covariate stops helping. Then add a noise level of your own between the last level that helps and the first that does not, rerun, and refine the estimate. State what that implies about using a modeled or remotely sensed covariate whose own error is unreported.
- Read the code. Tier 1. Annotate the branch of
ordinary_krigingin kriging.py that handles thesecondaryargument, stating what it consumes, what it produces, and why it needs the covariate at every prediction site.
- Complete the handoff. Tier 1. Answer the questions in the decisions file, which include the search neighborhood, the treatment of stations outside the state boundary, and whether the prediction grid resolution was ever justified.
Key takeaways
A covariate helps an interpolation when it is known where the target is unknown. Where the two are sampled at identical locations, the covariate is already implicit in the primary observations and the mathematics has little left to exploit. Practitioners frequently report co-kriging as an improvement without checking which of those two situations they are in.
Covariate error propagates into the surface and usually goes unreported. A terrain model, a satellite derived index or a modeled output all carry their own uncertainty, and a workflow that treats them as exact transfers that uncertainty into the prediction with no accounting anywhere.