PRIMERA PART
1. Formulació de la recerca
1.4. Marc teòric
1.4.2. Línies de recerca o bibliografia específica
ILWIS has a number of built-in statistical and geostatistical functions. Considering the interpolation possibilities, it can be used to analyse prepare a variogram, analyse the anisotropy in the data (including the variogram surface), run ordinary kriging and co-kriging (with one covariable), universal co-kriging with coordinates2as predictors and linear regression. ILWIS has also a number of original geostatistical algorithms that can often be handy for use.
Fig. 3.4: Overlay between points and rasters: table calculation in ILWIS.
For example, it offers direct krig-ing from raster that can be used to filter the missing values in a raster map, and a direct calculation of var-iograms from raster data. ILWIS is also very handy to run some basic statistical analysis on multiple raster layers (map lists): it offers principal component analysis on rasters, cor-relation analysis between rasters and multi-layer map statistics (min, max, average and standard deviation).
Although ILWIS can not be used to run regression-kriging as defined in
§2.1.3, it can be used to run a similar type of analysis. For example, a table can be imported and converted to a
point map using the Table to PointMap operation. The point map can then be overlaid over raster maps to analyze if the two variables are correlated. This can be done by
2In ILWIS, the term Universal kriging is used exclusively for interpolation of point data without any auxiliary maps.
3.2 Geostatistics in ILWIS 59
using a table calculation and MapValue function (Fig.3.4):
TWI=mapvalue(TWI, coord(X,Y,germany3))
where mapvalue is the overlay function that obtains values of a map TWI by using coordinates X, Y of the points and the germany3 coordinates system. In the same table, you can then derive a simple linear regression model e.g. SAND = b0 + b1 * TWI. By fitting a least square fit using a polynomial, you will get: b0=67.985 and b1=-4.429.
This means that the sand content decreases with an increase of TWI — Topographic Wetness Index (Fig. 3.5). Note that, in ILWIS, you can not derive the Generalized Least Squares (GLS) regression coefficients (Eq.2.1.3) but only the OLS coefficients, which is statistically suboptimal because the residuals are possibly auto-correlated (see
§2.1). In fact, regression modelling in ILWIS is so limited that I can only advise you to always export the table data to R and then run statistical analysis. After you estimate the regression coefficients, you produce a map of SAND content (deterministic part of variation) by running a map calculation:
SAND lm=67.985-4.429*TWI
Now you can estimate the residuals at sampled locations using a table calculation as in Fig. 3.4:
SAND res=SAND-MapValue(SAND lm, coord(X,Y,germany3))
Fig. 3.5: Correlation plot TWI vs SAND.
You can create a point map for residuals and derive a variogram of residuals by using operations Statis-tics 7→ Spatial correlation from the main menu. If you use a lag spac-ing of 800 m, you will get a var-iogram that can be fitted3 with a spherical variogram model (C0=180, C1=220, R=1800). The residuals can now be interpolated using ordinary kriging, which gives typical kriging pattern. The fitted trend and residu-als can then be added back together using:
SAND RK=SAND lm+SAND res OK which gives regression-kriging predic-tions. Note that, in this case, we will
produce negative values for SAND in the areas where the TWI is high (Fig. 3.5). Also note that, because a complete RK algorithm with GLS estimation of regression is not implemented in ILWIS (§2.1.3), we are not able to derive a map of the prediction variance (Eq.2.1.5).
Raster maps from ILWIS can be exported to other packages. You can always use export them to the Arc/Info ASCII (.ASC) format. If the georeference in ILWIS has been set as center of the corner pixels, then you might need to manually edit the *.asc header4. Otherwise, you will not be able to import such maps to ArcGIS (8 or higher) or Idrisi.
3ILWIS does not support automated variogram fitting.
4Simply replace in the header of the file xllcenter and yllcenter to xllcorner and yllcorner.
3.2.1 Visualization of uncertainty using whitening
As mentioned previously, an advantage of ILWIS is that it is a script-based package so that various scripts can be developed that allow data processing automation. One such script that will be used later on in the exercise is the script to visualize uncertainty of the map together with the actual predictions — VIS error. This script produces colour maps that should be associated with the special 2D legends.
SATURATION
Fig. 3.6: Design of the special 2D legend used to visualize the prediction variance using whitening:
(a) the HSI colour model, (b) the 2D legend and (c) the common types of Hues.
This visualization methods is based on the Hue-Saturation-Intensity (HSI) colour model (Fig.3.6a) and calculations with colours using the colour mixture (CM) concept.
The HSI is a psychologically appealing colour model – hue is used to visualise values or taxonomic space and whiteness (paleness) is used to visualise the uncertainty (Doo-ley and Lavin, 2007). For this purpose, a 2D legend was designed to accompany the visualisations. Unlike standard legends for continuous variables, this legend has two axis (Fig. 3.6b): (1) vertical axis (hues) is used to visualise the predicted values and (2) horizontal axis (whiteness) is used to visualise the prediction error. Fig. 3.7shows some examples of visualizing the mapping precision for different variables using the same input data. Note how different can be the precision of spatial prediction.
To visualize the uncertainty for your own case study using this technique, you should follow these steps:
(1.) Download the VIS error script for visualization of prediction error and unzip it to the default directory (C:\Program Files\ILWIS\Scripts\).
(2.) Derive the predictions and prediction variance for some target variable. Import both maps to ILWIS. The prediction variance needs to be then converted to nor-malized prediction variance by using Eq.(4.6.4), so you will also need to determine the global variance of your target variable.
(3.) Start ILWIS and run the script from the left menu (operations list) or from the
3.2 Geostatistics in ILWIS 61
main menu 7→ Operations 7→ Scripts 7→ VIS error. Use the help button to find more information about the algorithm.
(4.) To prepare final layouts, you will need to use the legend hsi.bmplegend file5.
90.0 74.0 58.0 42.0 26.0 10.0
90.0 74.0 58.0 42.0 26.0 10.0
90.0 74.0 58.0 42.0 26.0 10.0
10.0 8.0 6.0 4.0 2.0 0.0
1.8 1.4 1.1 0.7 0.4 0.0
SAND
SILT
CLAY
EC
OM
Fig. 3.7: Success of spatial predictions for various soil variables: sand (SAND), silt (SILT) and clay (CLAY) content in %, Electric conductivity (EC) and organic matter (OM) content in
%. On the left are the predicted values and on the right are the predictions visualized using whitening. After Hengl and Toomanian (2006).
You can manually change the lower and upper values for both prediction and error maps depending on your mapping requirements. By default, thresholds of 0.4 and 0.8 (max 1.0) are used for the normalized prediction error values. This assumes that a satisfactory prediction is when the model explains more than 85% of the total variation (normalized error = 40%). Otherwise, if the values of the normalized error gets above
5This legend is a Hue-whitening legend: in the vertical direction only Hue values change, while in the horizontal direction amount of white colour is linearly increased from 0.5 up to 1.0.
80%, the model accounted for less than 50% of variability at the validation points and the prediction is unsatisfactory (Fig.3.7).