Geostatistics project 2 (PETE 630)

  • Upload
    dptsen

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    1/28

    1

    PETE 630: Geostatistics

    Project 2

    Deepthi Sen

    I. Problem 1-Sample set study and Variogram

    The given set of 64 point data set were fed into SGeMS as a point set and the variograms at various directions were

    computed. The plots of the sample points are given below:

    A histogram analysis of the 64 data points suggest strong Gaussianity in the set.

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    2/28

    2

    The Quantile-Quantile plot of the data versus the standard normal also seems to suggest that the data set is strongly

    Gaussian.

    Direction of anisotropy

    It is evident from the truedata field given that the maximum anisotropy is at angle around45 from the vertical (N

    direction).The generated variograms from all directions (azimuths ranging from 0 to 180) are given below:

    It is clear from the directional variograms that the maximum anisotropy is along 45 from the vertical and the

    minimum around135. We refine our estimate by generating variograms around these two angles. The results are given

    below:

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    3/28

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    4/28

    4

    Gaussian models are used in case of high continuity in spatial variability. An appropriate value of nugget effect

    is included to model the discontinuity at the origin due to various reasons such as measurement noise.

    To build a common variogram that honors all directions, all structures from all directions are considered and some

    of these are implicitly eliminated by setting range a =

    Modeling the anisotropy

    Based on the above procedure, the separate model fits for the minimum and maximum anisotropy direction ( 33, 123)

    are shown below:

    The overall variogram model for the sample set is

    (h33, h123) = Nug(40) + 225Gauss

    |h|

    40

    + 225Sph

    h123

    20000

    2+

    h33

    40

    2 (1)where h stands for the lag separation vector.

    1) A nugget effect of40.

    2) An isotropic Gaussian component with sill 225 and a 2-dimensional range ellipse of semimajor and semiminor

    axes equal to 40.

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    5/28

    5

    3) An anisotropic spherical component at an azimuthal angle of 123 with a range ellipse of semimajor axis at

    infinity (a very high value of20, 000was provided) and a semiminor axis of40.

    In order to coordinatize the separation vector h in a reference frame aligned with the axes of the anisotropy ellipse,

    the following coordinate transformation is performed.

    [h33, h123]T =

    cos(33) sin (33)

    sin(33) cos(33)

    [hx, hy]T (2)

    Note: By definition, a variogram 2(x, y) = E(|Z(x) Z(y)|2). On transformation into normal scores, the equation

    of the variogram becomes2(x, y) = E(|[Z(x)msample

    sample] [

    Z(y)msamplesample

    ]|2). Consequently,2(x, y) = 1sample2

    E(|Z(x)

    Z(y)|2). The variogram generated in the previous section has been modeled based on the original data.

    In order to generate the variogram using the normal scores, it is sufficient to divide the earlier one by 2sample.

    III. Problem 3: Kriging

    Kriging is a method of spatial interpolation which involves the generation of a property field obtained using a

    weighted linear combination of known property samples. The kriged estimates have minimum variance and exhibits

    the exactitude property. Ordinary kriging may be proved to be an unbiased estimator.

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    6/28

    6

    A. Simple Kriging

    Here, it is assumed that the global mean of the data is known, which is then subtracted from the given sample data

    to ensure that the estimate is unbiased. The kriging matrix is of the form

    211

    212

    213

    21N

    ......

    2N1 2N2

    2NN

    1

    2

    ...

    N

    =

    2o1

    2o2

    ...

    2oN

    (3)

    where 2kj = Cov(Z(xk), Z(xj)), which is the covariance between the known data points and 2ok =

    Cov(Z(x), Z(xk)), the covariance between the known and unknown data points. The estimation variance of simple

    kriging is calculated as:

    2k = 2o

    Ni=1i

    2oi (4)

    The kriging equations may be expressed in terms of variogram instead of covariances. A rigorous derivation of these

    are provided in [5].The kriging estimate is expressed as:

    Z(x) = Ni=1iZ(xi) (5)

    The MATLAB code for simple kriging is provided in the Appendix. It has been assumed that the global mean is

    known and is equal to the sample mean for unbiasedness.

    The results of simple kriging using my MATLAB code and SGeMS are given below along with the true field data

    for comparison. Each unit field distance has been divided into 10 parts. Hence (40 10)2 = 1600values of permeability

    are being estimated out of which 64 are known from the sample.

    Fig. 1: Kriged perm fields using Matlab and SGeMS

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    7/28

    7

    Fig. 2: True permeability field

    The variance fields calculated using Matlab and SGeMS are given below:

    Fig. 3: Kriged perm variance fields using Matlab and SGeMS

    It is to be observed how the variance falls to near zero at points where observations are made.

    A finer version of the simulation may be obtained by reducing the axes division size from 1 per cell to 4 per cell:

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    8/28

    8

    Fig. 4: Fine permeability field - SK

    B. Ordinary Kriging

    This variant of kriging enforces unbiasedness by enforcing a constraint on the kriging weights via a Langrange

    multiplier . As in simple kriging, the estimator is expressed as equation 5. The constraint may be expressed as:

    Ni=1i = 1 (6)

    Hence the kriging equation set may be expressed in the matrix form as:

    211 212

    213 21N 1

    ...... 1

    2N1 2N2

    2NN 1

    1 1 1 0

    1

    2

    ...

    N

    =

    2o1

    2o2

    ...

    2oN

    1

    (7)

    The ordinary kriging variance may be expressed as:

    2k= 2o

    Ni=1i

    2oi+ (8)

    The results of ordinary kriging using my MATLAB code and SGeMS are given below along with the true field data

    for comparison. Each unit field distance has been divided into 10 parts. Hence (40 10)2 = 1600values of permeability

    are being estimated out of which 64 are known from the sample.

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    9/28

    9

    Fig. 5: Kriged perm fields using Matlab and SGeMS

    Fig. 6: True permeability field

    The variance fields calculated using Matlab and SGeMS are given below:

    Fig. 7: Kriged perm variance fields using Matlab and SGeMS

    A finer version of the simulation may be obtained by reducing the axes division size from 1 per cell to 4 per cell:

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    10/28

    10

    Fig. 8: Fine permeability field - OK

    IV. Problem 3: Comparison of Simple and Ordinary Kriging

    Under the assumption that sample mean is equal to the global mean, the results of performing simple kriging

    were obtained as below:

    Fig. 9: Kriged perm fields using Matlab and SGeMS

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    11/28

    11

    Fig. 10: True permeability field

    An error study was perform on both types of kriging by calculating the absolute value of difference between the

    kriged field and the true field, normalized by the value of the true field at each point.

    Fig. 11: Error % between Kriged and True fields

    We see that the results are almost identical. In fact, the maximum value of error percentage in simple kriging (given

    the above assumption) is 127.47% and that in ordinary kriging is 126.26%. The distribution of error percents have

    been plotted below:

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    12/28

    12

    Fig. 12: Error % between Kriged and True fields distribution

    The variance trends are similar in both cases since the global mean of the data is not known. If it were, we would

    expect SK to have lesser variance. It is to be pointed out that the global mean may not be taken to be equal to the

    mean value of the true field, since the permeability is most likely not an ergodic process.

    V. Sequential Gaussian Simulation

    Sequential Gaussian simulation is a conditional simulation method by which multiple realization so of a random

    vector field (in this case the permeability field) may be generated honoring the permeabilities at the known location

    and the sample mean and covariance. SGS is found to be more sensitive to heterogeneity in data since kriging tends

    to smoothen out minor variations. This method is based on the probability principle mentioned below:

    f(Z(x1), Z(x2), , Z(xN)|Z(xsample1 ), , Z(x

    sampleN0

    ))

    =f(Z(x1)|Z(x2), Z(x3), , Z(xN), Z(xsample1 ), , Z(x

    sampleN0

    ))f(Z(x2)|Z(x3), ,

    Z(xN), Z(xsample1 ), , Z(x

    sampleN0

    )) f(Z(x1)|Z(xsample1 ), Z , Z(x

    sampleN0

    ))

    Therefore, a multivariate pdf is broken down into several univariate conditional pdfs which are generated by simple

    kriging. Hence, the kriged estimate is generated at a random location and a permeability value is sampled out of a

    distribution with the kriged value as mean and the kriging variance at that point as distribution variance. This value

    of permeability is assigned to the location is absorbed into the set of known data points. With this augmented set of

    data points, the permeability field value is computed at the next random location using kriging. This goes on till the

    permeability field is evaluated at all cells. Hence SGS computes the distribution ofZat each xi such that the

    mean is the value ofZ(xi) obtained by simple kriging and the variance at xi is equal to 2SK(xi).

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    13/28

    13

    It is practically impossible with the available computational power to process the permeability field at all points

    using all data generated/available previously. Hence in my code, I have considered a constant number (64)

    of points nearest to the location in question, in forming the sample data matrix. This is because, on

    running the code with a constant search radius, the execution is found to get progressively slower as

    more data points are generated. This is so due to the fact that, with a constant search radius, the size of the

    matrix to be inverted (to solve the linear set of equations) keeps increasing over time.

    The results of 5 realizations of SGS have been included in this report. The arithmetic average of these realizations

    have also been provided. It is noteworthy how the mean field tends to the one obtained on simple kriging, demonstrating

    the fact that the SGS distribution has the mean at the SK values of the field.

    Fig. 13: True permeability field

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    14/28

    14

    The error study conducted on each of the realizations yielded the following results, where darker blue signifies lower

    error:

    Fig. 14: True permeability field

    It is seen that each realization shows considerable variability in error percentage. The distribution of errors, measured

    with respect to the true data field was also computed. Results follow:

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    15/28

    15

    Fig. 15: True permeability field

    No particular trend is observed in the relative accuracy of SGS realizations with respect to simple and ordinary

    kriging. It is seen that realization 4 performs better than both SK and OK in simulating the perm field, but other

    realizations show the opposite trend.

    VI. Sequential Gaussian Cosimulation

    Brief development of Sequential Gaussian Cosimulation

    In case two or more sets of data are available (different property fields), the prediction of one property value (primary

    variable) at a given location may benefit from the information about that location from the rest of the data sets

    (secondary variables). Cokriging is a modified form of kriging wherein more than one variable may be processed at a

    time in order to estimate the primary variable. The estimator is given as:

    z= Ni=1izi+ Mj=1iyj (9)

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    16/28

    16

    Traditional cokriging turns out to be computationally expensive due to tedious auto and cross-covariance requirements

    and also due to occurrence of singular matrices that are non-invertible.

    Cokriging is simplified to a large extent by collocated cokriging wherein only secondary data closest to the location

    of estimation, is retained. This requires the availability of secondary data at every location where the primary variable

    is to be evaluated.

    z= Ni=1izi+ Mj=1iyj (10)

    where j is the location of the estimator.

    Collocated cokriging is much less computationally expensive as compared to traditional cokriging since

    the requirement for secondary data covariance calculation is precluded

    the kriging matrix size is greatly reduced

    Yet collocated cokriging requires the computation of cross-covariance between primary and secondary data sets. The

    need for calculating the cross-covariance is eliminated by the Markov hypothesis by which:

    CZY(h) = ZY(0)

    CY(0)

    CZ(0)CZ(h) (11)

    In case of a Bayesian update methodology, the probability of the primary variable conditioned on the secondary data

    and the known primary variable values at other locations is proportional to the product of the conditional distribution

    of the secondary variable and the distribution of the primary variable conditioned on just the known primary data set.

    This may be expressed as:

    p(Z(xi)|Y(xi), Z(x1), , Z(xN)) = f(Y(xi)|Z(xi), Z(x1), , Z(xN)).p(Z(xi)|Z(x1), , Z(xN)) (12)

    Since f(Y(xi)|Z(xi), Z(x1), , Z(xN)) = f(Y(xi)|Z(xi)) from the Markov hypothesis, the above equation may be

    written as:

    p(Z(xi)|Y(xi), Z(x1), , Z(xN)) = f(Y(xi)|Z(xi)).p(Z(xi)|Z(x1), , Z(xN)) (13)

    For a single secondary variable, the distribution of the perm field after co-simulation may be written as:

    Z(xi)SCC =

    Y(xi)2SK(xi) +Z(xi)

    SK(12)

    2[2SK(xi)1] + 1 (14)

    2SCC(xi) = 2SK(xi)

    12

    2[2SK(i)1] + 1 (15)

    Results of cosimulation are given below along with the true permeability field for comparison.

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    17/28

    17

    Fig. 16: Cosimulation realizations

    A comparison of the mean of all 5 realizations with the true data field has also been made.

    Fig. 17: Cosimulation mean field

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    18/28

    18

    The percentage error with respect to the true data field for each realization is represented in the surface plot below

    and the distribution in the error is shown in the following set of histograms. The color code for the surface plots is the

    same as that of previous plots.

    Fig. 18: Cosimulation error

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    19/28

    19

    Fig. 19: Cosimulation error distribution

    We see from the error distribution (on comparison with those of previous algorithms) that the accuracy has increased

    in almost every realization. This may be explained by the presence of secondary data that adds information regarding

    the value of the primary field at each location.

    But we also encounter a major disadvantage of using cosimulation which is the requirement that all cells

    must have ad value of secondary field associated with it. Due to this, it is not possible to generate finer

    simulations using smaller cells as we have done in the previous cases .

    References

    1. Datta-Gupta A. Geostatistics Lectures. Fall 2014.

    2. Armstrong M, Dowd PA. Geostatistical Simulations-Proceedings of the Geostatistical Simulation Workshop,Fontainebleau, France. 27-28

    May 1993.

    3. Bohling G.Introduction to Geostatistics and Variogram Analysis.

    4. Kentwell DJ.Fractal Relationship and Spatial Distributions in Ore body modeling. Master of Science Thesis (Mathematics and Planning).

    August 1997.

    5. Ordinary kriging. Statistics C173/C273, UCLA, Dept. of Statistics. www.stat.ucla.edu/~nchristo/statistics_c173_c273/c173c273_lec10.

    pdf Last accessed on 12/8/2014.

    Appendix

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    20/28

    20

    function [C D zup mse]=krig1(Z)

    %Simple Kriging

    [x y]=meshgrid(0:0.25:39,0:0.25:39);

    mu1=mean(Z(:,3));

    Zsigma1=std(Z(:,3));

    Z(:,3)=Z(:,3)-mu1;

    Z(:,3)=Z(:,3)/Zsigma1;

    A=bsxfun(@minus,Z(:,1),Z(:,1)');

    B=bsxfun(@minus,Z(:,2),Z(:,2)');

    theta=-33*pi/180;

    A1=cos(theta)*A+sin(theta)*B;

    B1=-sin(theta)*A+cos(theta)*B;

    h=hypot(A,B);

    h1=hypot(A1/20000,B1/40);

    for i=1:length(Z(:,1))

    for j=1:length(Z(:,2))if h(i,j)==0

    nug1=0;

    hgauss=0;

    hsphr=0;

    else

    hgauss=225*(1-exp(-3*((h(i,j)/40)^2)));

    nug1=40;

    if h1(i,j)

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    21/28

    21

    hgauss=0;

    hsphr=0;

    else

    hgauss=225*(1-exp(-3*((h2(i,j)/40)^2)));

    nug1=40;

    if h21(i,j)

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    22/28

    22

    hgauss=225*(1-exp(-3*((h(i,j)/40)^2)));

    nug1=40;

    if h1(i,j)

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    23/28

    23

    end

    zup=reshape(zip,[length(x) length(y)]);

    mse=reshape(zap,[length(x) length(y)]);

    function [C D zup zapstore]=sgsbeta(Z)

    %Sequential Gaussian simulation

    [x y]=meshgrid(0:0.25:39,0:0.25:39);

    zapstore=[];

    L=numel(x);

    flagmat=ones(1,L);

    x1=reshape(x,[1,numel(x)]);

    y1=reshape(y,[1,numel(y)]);

    Nlim=64;

    theta=-33*pi/180;

    mu1=mean(Z(:,3));

    Zsigma1=std(Z(:,3));Z(:,3)=Z(:,3)-mu1;

    Z(:,3)=Z(:,3)/Zsigma1;

    final=zeros(numel(x),1);

    while sum(flagmat)>0

    k=1;

    z1=randi(L);

    clear C;

    clear D;

    clear b;

    while sum(flagmat(1,1:k))

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    24/28

    24

    for i=1:Nlim

    if h3u(i,1)==0

    nug1=0;

    hgauss=0;

    hsphr=0;

    else

    hgauss=225*(1-exp(-3*((h3u(i,1)/40)^2)));

    nug1=40;

    if h21(i,1)

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    25/28

    25

    end

    end

    D=pinv(C);

    W=D*b;

    zip=Zu(:,3)'*W;

    zap=W'*b;

    zapstore=[zapstore zap];

    if zap0

    k=1;

    z1=randi(L);

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    26/28

    26

    clear C;

    clear D;

    clear b;

    while sum(flagmat(1,1:k))

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    27/28

    27

    A=bsxfun(@minus,Zu(:,1),Zu(:,1)');

    B=bsxfun(@minus,Zu(:,2),Zu(:,2)');

    A1=cos(theta)*A+sin(theta)*B;

    B1=-sin(theta)*A+cos(theta)*B;

    h=hypot(A,B);

    h1=hypot(A1/20000,B1/40);

    % Ddog=length(Zu(:,1))

    for i=1:length(Zu(:,1))

    for j=1:length(Zu(:,2))

    if h(i,j)==0

    nug1=0;

    hgauss=0;

    hsphr=0;

    else

    hgauss=225*(1-exp(-3*((h(i,j)/40)^2)));

    nug1=40;if h1(i,j)

  • 7/21/2019 Geostatistics project 2 (PETE 630)

    28/28

    28

    end

    final=final*Zsigma1;

    final=final+mu1;

    zup=reshape(final,[length(x) length(y)]);