37
Kriging dan Cokriging Praktikum 6 | Statistika Spasial [email protected]

Kriging dan Cokriging Spatial... · 2017. 11. 29. · 1. a feature-space correlation with the target variable; 2. a spatial structure (i.e. be modelled as a regional variable); 3

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

  • Kriging dan CokrigingPraktikum 6 | Statistika Spasial

    [email protected]

  • Outline

    • Semivariance

    • Variogram

    • Ordinary Kriging

    • Cokriging

  • Semivariance

    Regionalized variable theory uses a related property called the

    semivariance to express the degree of relationship between points on a surface.

    The semivariance is simply half the variance of the differences between all possible points spaced a constant distance apart.

    Semivariance is a measure of the degree of spatial dependence between samples (elevation(

  • Meuse River Data Set

    library(sp)

    class(meuse)

    coordinates(meuse)

  • plot(meuse, asp = 1, pch = 1)

    data(meuse.riv)

    lines(meuse.riv)

  • Display a postplot of the untransformed Zn values, that is, plotthe sample locations (as above) and represent the data value bythe size of the symbol.

    plot(meuse, asp = 1,

    cex = 4*meuse$zinc/max(meuse$zinc), pch = 1)

    lines(meuse.riv)

  • Compute the number of point-pairs

    meuse$logZn

  • Compute the distance and semivariancebetween the first two points in the data setdim(coordinates(meuse))

    [1] 155 2

    coordinates(meuse)[1, ]

    x y

    181072 333611

    coordinates(meuse)[2, ]

    x y

    181025 333558

    (sep

  • Plot the experimental variogram of the log-Zn concentrations

    (v

  • Plot the experimental variogram of the log-Zn concentrationsprint(plot(v, plot.numbers = T))

    The trend in decreasing

    semivariance with decreasing

    separation seems to intersect the y-

    axis (i.e., at 0 separation) at about

    0.01 log(mg kg-1)2; this is thenugget.

  • Variogram

    The semivariance at a distance d = 0 should be zero, because there are no differences between points that are compared to themselves.

    However, as points are compared to increasingly distant points, the semivariance increases.

  • Display the variogram model forms which can be used in gstat

    print(show.vgms())

  • Fit a spherical variogram model

    vm

  • Adjust the model with gstat automatic fit

    Adjust the parameters

  • Theory of Ordinary Kriging

    • The theory of regionalised variables leads to an ”optimal“ prediction method, in the sense that the kriging variance is minimized.

    What is so special about kriging?

    • Predicts at any point as the weighted average of the values at sampled points

    • Weights given to each sample point are optimal, given the spatial covariance structure as revealed by the variogram model (in this sense it is “best”)

    • The kriging variance at each point is automatically generated as part of the process of computing the weights

  • Ordinary kriging on a regular grid

    > data(meuse.grid)

    > coordinates(meuse.grid) gridded(meuse.grid) k40

  • Display the structure of the kriging prediction object

  • Display the map of predicted values

    print(spplot(k40, "var1.pred",

    asp=1, main="OK prediction,

    log-ppm Zn"))

  • Display the map of kriging prediction variances

    print(spplot(k40, "var1.var",

    col.regions=cm.colors(64),

    asp=1,

    main="OK prediction variance,

    log-ppm Zn^2"))

    Describe the variances map:

    1. Where is the prediction variance lowest?

    2. Does this depend on the data value?

  • Show the post-plot: value proportional to circle size

    pts.s

  • show the observation locations on the kriggingprediction variance

    pts.s

  • Evaluating the model

    zn.okcv

  • Co-Kriging

    • Co-kriging allows samples of an auxiliary variable (also called the covariable),besides the target value of interest, to be used when predicting the target valueat unsampled locations. The co-variable may be measured at the same points asthe target (co-located samples), at other points, or both.

    • The most common application of co-kriging is when the co-variable is cheaper tomeasure, and so has been more densely sampled, than the target variable.

  • Eksplorasi Data

    data(meuse.riv)# outline of the river

    meuse.lst

  • Eksplorasi Data

    par(mfrow=c(1,2))

    plot(zinc ~ dist, meuse)

    plot(log10(zinc) ~ sqrt(dist), meuse)

    abline(lm(log10(zinc) ~ sqrt(dist), meuse),col=2)

  • Eksplorasi Data

    zn.lm

  • Generate a new kriged surface with the covariate - distance to rivervm.ck

  • m.ck

  • ko.ck

  • ko.ck$sek

  • Evaluasi

    zn.ckcv

  • Back Transform

    ko.ck$predt

  • Target Variable

    • We select lead (abbreviation “Pb”) as the target variable, i.e. the one we want to map. This metal is aserious human health hazard.

    • It can be inhaled as dust from disturbed soil or taken up by plants and ingested.

    • The critical value for Pb in agricultural soils, according to the Berlin Digital Environmental Atlas2, is600 mg kg-1 for agricultural fields: above this level grain crops can not be grown for humanconsumption.

  • Selecting the co-variables

    Candidates for co-variables must have:

    1. a feature-space correlation with the target variable;

    2. a spatial structure (i.e. be modelled as a regional variable);

    3. a spatial co-variance with the target variable.

    Two main ways to select a co-variable:

    1) theoretically, from knowledge of the spatial process that caused the observed spatial (co-)distribution;

    2) empirically, by examining the feature-space correlations (scatterplots) and then the spatial co-variance (cross-correlograms or crossvariograms).

  • Kandidat Peubah Penjelas

    1. organic matter content (OM)

    2. zinc content (Zn)

  • Tugas 1

    Lakukan prediksi Pb dengan menyertakan co-variables (OM atau Zn), diskusikan hasil yang Anda peroleh.

  • Tugas 2

    • Perhatikan data yg tersedia pada alamat berikut:

    https://raw.githubusercontent.com/raoy/Spatial-Statistics/master/database_Nickel.csv

    • Keterangan variabel:• XCOLLAR: Longitude

    • YCOLLAR: Latitude

    • ZCOLLAR: Kedalaman

    • Ni: Kandungan Nikel

    Coba lakukan interpolasi dengan beberapametode yang telah Anda pelajari, bandingkanhasilnya, manakah interpolasi yang palingbaik menurut Anda?