EasyKrig3.0的说明文档(kriging插值)
克里金插值-Kriging插值-空间统计-空间分析
克里金插值方法-Kriging 插值-空间统计-空间分析1.1 Kriging 插值克里金插值(Kriging 插值)又称为地统计学,是以空间自相关为前提,以区域化变量理论为基础,以变异函数为主要工具的一种空间插值方法。
克里金插值的实质是利用区域化变量的原始数据和变异函数的结构特点,对未采样点的区域化变量的取值进行线性无偏、最优估计。
克里金插值包括普通克里金插值、泛克里金插值、指示克里金插值、简单克里金插值、协同克里金插值等,其中普通克里金插值是最为常用的克里金插值方法。
以下介绍普通克里金插值的原理。
包括普通克里金方法在内的各种克里金插值方法的使用前提是空间数据存在着显著的空间相关性。
判断数据空间相关性是否显著的工具是半变异函数(semi-variogram ),该函数以任意两个样本点之间的距离h 为自变量,在h 给定的条件下,其函数值估计方法如下:2||||1()[()()]2()i j i j s s h h z s z s N h γ-==-∑其中()N h 是距离为h 的样本点对的个数。
()h γ最大值与最小值的差m a x m i n γγ-可以度量空间相关性的强度。
max min γγ-越大,空间相关性越强。
如果()h γ是常数,即max min 0γγ-=,则说明无论样本点之间的距离是多少,样本点之间的差异不变,也就是说样本点上的值与其周围样本点的值无关。
在实际操作中,会取一些离散的h 值,当||s s ||i j -接近某个h 时,即视为||||i j s s h -=。
然后会通过这些离散点拟合成连续的半变异函数。
拟合函数的形式有球状、指数、高斯等。
在数据存在显著的空间相关性的前提下,可以采用普通克里金方法估计未知点上的值。
普通克里金方法的基本公式如下:01ˆ()()()n i ii Z s w s Z s ==∑普通克里金方法的基本思想是:通过调整i s 的权重()i w s ,使未知点的估计值0ˆ()Z s 满足两个要求:1.0ˆ()Z s 是无偏估计,即估计误差的期望值为0,2.估计误差的方差达到最小。
地统计内插方法 克里金插值(Kriging)共45页
8.1 Introduction
Some common summary statistics: –Measurements of location: mean, median –Measurements of spread: variance, standard deviation, coefficient of variation –Measurements of shape: coefficient of skewness
•What are the elevation values in an unmeasured location? •How to infer elevation values from other measurements in the same and other locations?
8.1 Introduction
8.1 Introduction
Review of Probability
•Frequency table records how often (in terms of percentage) observed values fall within certain intervals or classes.
8.2 Random Field
8.1 Introduction
Probability density function (PDF): p(u)– Discrete PDF: assigns a probability to each event • The outcome of flipping a coin • The number of road in an area Continuous PDF: determines the probability that an
克里金(kriging)插值的原理与公式推导
克里金(kriging)插值的原理与公式推导
克里金插值是一种空间插值方法,用于估计未知区域的数值,其
原理是基于空间数据的空间相关性来进行插值。
具体来说,克里金插
值假设空间数据在不同位置之间具有一定的相关性,即在空间上相邻
的点具有相似的数值。
克里金插值利用这种相关性来进行插值,从而
可以更准确地估计未知位置的数值。
克里金插值的公式推导涉及到半变异函数的定义,通常使用高斯
模型、指数模型或球形模型来描述数据的空间相关性。
在推导过程中,会利用已知数据点的数值和位置信息,以及半变异函数的参数来构建
插值模型,进而估计未知位置的数值。
克里金插值的公式可以表示为:
\[Z(u) = \sum_{i=1}^{n} \lambda_i \cdot Z(u_i)\]
其中,\(Z(u)\)为未知位置的数值,\(Z(u_i)\)为已知数据点的
数值,\(\lambda_i\)为插值权重,通过半变异函数及数据点之间的空
间距离计算得出。
除了基本的克里金插值方法外,还有一些相关的扩展方法,如普通克里金、泛克里金等,这些方法在建模和插值的过程中考虑了更多的因素,如均值趋势、空间方向等,使得插值结果更加准确和可靠。
总的来说,克里金插值是一种常用的空间插值方法,适用于各种地学环境下的数据分析与建模。
在实际应用中,需要根据具体数据的特点选择合适的插值方法和模型参数,以获得准确的插值结果。
克里金插值法的详细介绍。kriging。
克里金插值法的详细介绍。
kriging。
kriging 插值作为地统计学中的一种插值方法由南非采矿工程师D.G.Krige于1951年首次提出,是一种求最优、线形、无偏的空间内插方法。
在充分考虑观测资料之间的相互关系后,对每一个观测资料赋予一定的权重系数,加权平均得到估计值。
这里介绍普通Kriging插值方法的基本步骤:1.该方法中衡量各点之间空间相关程度的测度是半方差,其计算公式为:h为各点之间距离,n 是由h 分开的成对样本点的数量,z 是点的属性值。
2.在不同距离的半方差值都计算出来后,绘制半方差图,横轴代表距离,纵轴代表半方差。
半方差图中有三个参数nugget(表示距离为零时的半方差),sill(表示基本达到恒定的半方差值),range(表示一个值域范围,在该范围内半方差随距离增加,超过该范围,半方差值趋于恒定)。
利用做出的半方差图找出与之拟合的最好的理论变异函数模型(这是关键所在),可用于拟合的模型包括高斯模型、线性模型、球状模型、指数模型、圆形模型。
----球状模型,球面模型空间相关随距离的增长逐渐衰减,当距离大于球面半径后,空间相关消失。
3.用拟合的模型计算出三个参数。
例如球状模型中nugget为c0,range为a,sill为c。
4.利用拟合的模型估算未知点的属性值,方程为:,z0为估计值,zx是已知点的值,wx为权重,s是用来估算未知点的已知点的数目。
假如用三个点来估算,则有这样权重就可以求出,然后估算未知点。
(上述内容根据《地理信息系统导论》(Kang-tsung Chang著;陈健飞等译,科学出版社,2003)第十三章内容进行总结,除球状模型公式外其余公式皆来自此书)下面是本人自己编写的利用海洋中断面上观测站点的实测温度值来估算未观测处的温度的Fortran程序,利用距离未知点最近的五个观测点来估算未知点的温度,选用模型为球状模型。
do ii=1,nxif(tgrid(ii,1)==0.)thendo i=1,dsite(ii)!首先寻找距离最近的五个已知点位置do j=1,nhif(d(mm(ii),j).ne.0.or.j==1)thenhmie(j)=d(mm(ii),j)-dgrid(i)elsehmie(j)=9999hmid(j)=abs(hmie(j))end dodo j=1,nhdo k=j,nhif(hmid(j)<hmid(k))then< p="">elsem1=hmid(j)hmid(j)=hmid(k)hmid(k)=m1end ifend doend dodo j=1,5do k=1,nhif(abs(hmie(k))==hmid(j))thenlocat(j)=kend ifend doend dodo j=1,4do k=j+1,5if(locat(j)==locat(k))thendo i3=1,nhif(abs(hmie(i3))==abs(hmie(locat(j))).and.i3.ne.locat(j))then locat(j)=i3exitend ifenddoendifenddo!然后求各点间距离,并求半方差do j=1,5do k=1,5hij(j,k)=abs(d(mm(ii),locat(j))-d(mm(ii),locat(k)))/1000.end doend dodo j=1,5hio(j)=sqrt(hmid(j)**2+(abs(latgrid(ii)-lonlat(mm(ii),2))*llat)**2 $ +(abs(longrid(ii)-lonlat(mm(ii),1))*(1.112e5*$ cos(0.017*(latgrid(ii)+lonlat(mm(ii),2))/2)))**2)/1000.end dodo j=1,5do k=1,5if(hij(j,k).eq.0.)thenrleft(j,k)=0.elserleft(j,k)=sill*(1.5*hij(j,k)/range-0.5*hij(j,k)**3/range**3)end ifif(hio(j).eq.0.)thenrrig(1,j)=0.elserrig(1,j)=sill*(1.5*hio(j)/range-0.5*hio(j)**3/range**3)end ifend doend dorrig(1,6)=1.rleft(6,6)=0.rleft(6,j)=1.rleft(j,6)=1.end dotry=rleftcall brinv(rleft,nnn,lll,is,js)ty1=matmul(try,rleft)!求权重wq=matmul(rrig,rleft)!插值所有格点上t,sdo j=1,5tgrid(ii,i)=tgrid(ii,i)+wq(1,j)*t(mm(ii),locat(j)) sgrid(ii,i)=sgrid(ii,i)+wq(1,j)*s(mm(ii),locat(j)) end doenddoendifenddo</hmid(k))then<>。
克里金插值(kriging)
随机场:
P
当随机函数依赖于多个
自变量时,称为随机场。
如具有三个自变量(空间
点的三个直角坐标)的随
机场
随机函数的特征值
协方差(Variance): 二个随机变量ξ,η的协方差为二维随机变量(ξ,
η)的二阶混合中心矩μ11,记为Cov(ξ,η),或σξ,η。
Cov(ξ,η) = σξ,η = E[ξ-E(ξ)][η-E(η)]
块金效应的尺度效应
如果品位完全是典型的随机变量,则不论 观测尺度大小,所得到的实验变差函数曲线总 是接近于纯块金效应模型。
当采样网格过大时,将掩盖小尺度的结构, 而将采样尺度内的变化均视为块金常数。这种 现象即为块金效应的尺度效应。
1
3
3
3
1
2
3
1
1
(h) = C(0) – C(h)
基台值(Sill):代表变量在空间上的总变异性大小。即为变 差函数在h大于变程时的值,为块金值c0和拱高cc之和。 拱高为在取得有效数据的尺度上,可观测得到的变异性幅 度大小。当块金值等于0时,基台值即为拱高。
对于单变量而言:
P
F(u;z)F(uh;z)
可从研究区内所有数据的累积直方图推断而得 (将邻近点当成重复取样点)
太强的假设,不符合实际
二阶平稳
当区域化变量Z(u)满足下列二个条件时,则称其 为二阶平稳或弱平稳:
① 在整个研究区内有Z(u)的数学期望存在, 且等于常数,即: E[Z(u)] = E[Z(u+h)] = m(常数) x h
相当于要求:Z(u)的变差函数存在且平稳。
可出现协方差函数不存在,但变差函数存在的情况。
例:物理学上的著名的布朗运动是一种呈现出无限 离散性的物理现象,其随机函数的理论模型就是维 纳-勒维(Wiener-Levy)过程(或随机游走过程)。
Kriging最优内插法的原理
Kriging最优内插法的原理设X0为未观测的需要估值的点,X i, X2,…,X N为其周围的观测点,观测值相应为y(x i ),y(x2), •••,yx N)。
未测点的估值记为?(x。
),它由相邻观测点的已知观测值加权取和求得:~(X o)=w、y(X i).J (9) 此处,k为待定加权系数。
和以往各种内插法不同,Kriging内插法是根据无偏估计和方差最小两项要求来确定上式中的加权系数▲的,故称为最优内插法。
1. 无偏估计设估值点的真值为y(X。
)。
由丁土壤特性空间变异性的存在,y(X i以及y(X o ), y(X o)均可视为随机变量。
当为无偏估计时,E ~(X。
)-y(X。
)=。
(10)将式(9)代入(1。
)式,应有N•W. * I =1i 1(11)2. 估值~(x。
)和真值y(x o)之差的方差最小。
即D &(x。
)— y(x°)]=mi n(12)利用式(3-1。
),经推导方差D^xC-yCx^Lmin为N N ND ~(x。
)—y(x°)】=—£ £ "Aj(X i ,X j)+2E %J(X i,x。
)i =1 j =1 i =1(13)式中,:(x i , X j)表示以X i和X j两点间的距离作为问距h时参数的半方差值,:'(x i, x。
)则是以X i和X。
两点之间的距离作为问距h时参数的半方差值。
观测点和估值点的位置是已知的,相互问的距离业已知,只要有所求参数的半方差7(h)图, 便可求得各个S X j)和'(x i, X。
)值。
因此,确定式(9)中各加权系数的问题,就是在满足式(11)的约束条件下,求目标函数一以式(13)表示的方差为最小值的优化问题。
求解时可采用拉格朗日法,为此构造一函数犯气-1)=。
,中为待定的拉格朗日算子。
由此,可导出优化问题的解应满足:N' i (X,X j) := (X i,X。
克里金插值(kriging)
二、统计推断与平稳要求
任何统计推断(cdf,数学期望等)均要求重复取样。 但在储层预测中,一个位置只能有一个样品。 同一位置重复取样,得到cdf,不现实
P
考虑邻近点,推断待估点
区域化变量: 能用其空间分布来表征一个自然现象的变量。
(将空间位置作为随机函数的自变量)
空间一点处的观测值可解释为一个随机变量在该点
P
F(u; z) F(u h; z)
可从研究区内所有数据的累积直方图推断而得 (将邻近点当成重复取样点)
太强的假设,不符合实际
二阶平稳
当区域化变量Z(u)满足下列二个条件时,则称其 为二阶平稳或弱平稳:
① 在整个研究区内有Z(u)的数学期望存在, 且等于常数,即: E[Z(u)] = E[Z(u+h)] = m(常数) x h
为相应的观测值。区域化变量在 x0处的值 z* x0 可
采用一个线性组合来估计:
n
z*x0 i zxi i 1
无偏性和估计方差最小被作为 i 选取的标准
无偏 E Zx0 Z * x0 0 最优 Var Zx0 Z * x0 min
绝对收敛,则称它为ξ的数学期望,记为E(ξ)。
E(ξ) =
xp( x)dx
数学期望是随机变量的最基本的数字特征,
相当于随机变量以其取值概率为权的加权平均数。
从矩的角度说,数学期望是ξ的一阶原点矩。
对于一组样本:
N
( zi )
m i1 N
(2)方差 为随机变量ξ的离散性特征数。若数学期望
随机函数在空间上的变化没有明显趋势, 围绕m值上下波动。
python克里金插值法
python克里金插值法Python克里金插值法克里金插值法(Kriging)是一种用于空间插值的统计方法,常用于地质学、地球物理学、环境科学等领域。
它通过样本点的空间分布信息,推断未知点的值,并生成一幅连续的表面。
一、克里金插值法的原理克里金插值法的核心思想是通过已知点之间的空间相关性来估计未知点的值。
该方法基于两个假设:1)空间上相近的点具有相似的值;2)相邻点之间的差异可以通过某种函数来描述。
插值的第一步是计算已知点之间的空间相关性。
通常使用半方差函数(semivariogram)来量化相邻点之间的差异。
半方差函数表示了不同距离下的样本点间的差异,可以通过实际数据的半方差函数图来选择合适的函数模型。
插值的第二步是确定权重。
克里金插值法假设未知点的值是已知点的线性组合,权重由已知点之间的空间相关性决定。
一般来说,距离已知点越近且权重越大,距离已知点越远且权重越小。
插值的第三步是计算未知点的值。
根据已知点的值和权重,使用线性插值的方法来估计未知点的值。
这样,就可以生成一幅连续的表面,反映了未知点的分布情况。
二、克里金插值法的应用克里金插值法在地质学、地球物理学、环境科学等领域有广泛的应用。
以下是一些典型的应用案例:1. 地下水位插值地下水位的空间分布对于水资源管理和环境保护至关重要。
通过收集已知点的地下水位数据,可以利用克里金插值法推断未知点的地下水位值,从而绘制出地下水位的分布图。
2. 污染物扩散模拟污染物扩散对于环境风险评估和污染治理具有重要意义。
通过收集已知点的污染物浓度数据,可以利用克里金插值法推断未知点的污染物浓度值,从而模拟污染物的扩散情况。
3. 地震震级插值地震震级是评估地震强度的重要指标。
通过收集已知点的地震震级数据,可以利用克里金插值法推断未知点的地震震级值,从而绘制出地震震级的分布图。
4. 土壤质量评估土壤质量是农业生产和生态环境保护的关键因素。
通过收集已知点的土壤质量数据,可以利用克里金插值法推断未知点的土壤质量值,从而评估土壤质量的空间分布。
克里金插值
克里金插值克里金(Kriging)插值克里金(Kriging)插值法又称空间自协方差最佳插值法,它是以南非矿业工程师D.G.Krige的名字命名的一种最优内插法。
克里金法广泛地应用于地下水模拟、土壤制图等领域,是一种很有用的地质统计格网化方法它首先考虑的是空间属性在空间位置上的变异分布.确定对一个待插点值有影响的距离范围,然后用此范围内的采样点来估计待插点的属性值。
该方法在数学上可对所研究的对象提供一种最佳线性无偏估计(某点处的确定值)的方法。
它是考虑了信息样品的形状、大小及与待估计块段相互间的空间位置等几何特征以及品位的空间结构之后,为达到线性、无偏和最小估计方差的估计,而对每一个样品赋与一定的系数,最后进行加权平均来估计块段品位的方法。
但它仍是一种光滑的内插方法在数据点多时,其内插的结果可信度较高。
克里金法类型分常规克里金插值(常规克里金模型/克里金点模型)和块克里金插值。
常规克里金插值其内插值与原始样本的容量有关,当样本数量较少的情况下,采用简单的常规克里金模型内插的结果图会出现明显的凹凸现象;块克里金插值是通过修改克里金方程以估计子块B内的平均值来克服克里金点模型的缺点,对估算给定面积实验小区的平均值或对给定格网大小的规则格网进行插值比较适用。
块克里金插值估算的方差结果常小于常规克里金插值,所以,生成的平滑插值表面不会发生常规克里金模型的凹凸现象。
按照空间场是否存在漂移(drift)可将克里金插值分为普通克里金和泛克里金,其中普通克里金(Ordinary Kriging简称OK法)常称作局部最优线性无偏估计.所谓线性是指估计值是样本值的线性组合,即加权线性平均,无偏是指理论上估计值的平均值等于实际样本值的平均值,即估计的平均误差为0,最优是指估计的误差方差最小。
在科学计算领域中,空间插值是一类常用的重要算法,很多相关软件都内置该算法,其中GodenSoftware 公司的Surfer软件具有很强的代表性,内置有比较全面的空间插值算法,主要包括:Inverse Distance to a Power(反距离加权插值法)Kriging(克里金插值法)Minimum Curvature(最小曲率)Modified Shepard's Method(改进谢别德法)Natural Neighbor(自然邻点插值法)Nearest Neighbor(最近邻点插值法)Polynomial Regression(多元回归法)Radial Basis Function(径向基函数法)Triangulation with Linear Interpolation(线性插值三角网法)Moving Average(移动平均法)Local Polynomial(局部多项式法)下面简单说明不同算法的特点。
克里金插值方法
克里金插值方法克里金插值方法(Kriging Interpolation)是一种常用的空间插值技术,用于预测未知位置的属性值。
它是由南非地质学家克里金(Danie G. Krige)在20世纪60年代提出的。
克里金插值方法通过对已知点周围的样本点进行空间插值,推断出未知点的属性值,从而实现对空间数据的预测。
克里金插值方法的基本思想是建立一个局部的空间模型,考虑样本点之间的空间相关性,并利用这种相关性来预测未知点的属性值。
它的核心思想是将空间数据看作是一个随机场,通过对随机场的统计分析来确定未知点的属性值。
克里金插值方法的具体步骤如下:1. 数据收集:首先需要收集一定数量的已知点数据,这些数据应该包含未知点的属性值以及其空间坐标。
2. 变异函数拟合:根据已知点的属性值和空间坐标,建立变异函数模型。
变异函数描述了样本点之间的空间相关性,可以采用不同的函数形式进行拟合,如指数函数、高斯函数等。
3. 半变异函数计算:通过对已知点之间的差异进行半变异函数计算,确定样本点之间的空间相关性。
4. 克里金权重计算:根据已知点的属性值、空间坐标和半变异函数,计算未知点与已知点之间的空间权重。
5. 属性值预测:利用已知点的属性值和克里金权重,对未知点进行属性值预测。
预测值可以根据不同的权重计算方法得到,如简单克里金、普通克里金、泛克里金等。
6. 模型验证:对预测结果进行验证,可以使用交叉验证等方法评估预测的准确性。
克里金插值方法在地质学、环境科学、农业、地理信息系统等领域广泛应用。
它可以用于地下水位、气象数据、土壤污染等空间数据的插值预测。
克里金插值方法不仅可以提供对未知点的预测值,还能估计预测误差,并提供空间数据的空间分布图。
尽管克里金插值方法具有很多优点,但也存在一些限制。
首先,克里金插值方法假设样本点之间的空间相关性是平稳的,即在整个研究区域内具有一致性。
然而,在实际应用中,样本点之间的空间相关性可能会随着距离的增加而变化。
克里格插值法
克里格法(Kriging)——有公式版二、克里格法(Kriging)克里格法(Kriging)是地统计学的主要内容之一,从统计意义上说,是从变量相关性和变异性出发,在有限区域内对区域化变量的取值进行无偏、最优估计的一种方法;从插值角度讲是对空间分布的数据求线性最优、无偏内插估计一种方法。
克里格法的适用条件是区域化变量存在空间相关性。
克里格法,基本包括普通克里格方法(对点估计的点克里格法和对块估计的块段克里格法)、泛克里格法、协同克里格法、对数正态克里格法、指示克里格法、折取克里格法等等。
随着克里格法与其它学科的渗透,形成了一些边缘学科,发展了一些新的克里金方法。
如与分形的结合,发展了分形克里金法;与三角函数的结合,发展了三角克里金法;与模糊理论的结合,发展了模糊克里金法等等。
应用克里格法首先要明确三个重要的概念。
一是区域化变量;二是协方差函数,三是变异函数一、区域化变量当一个变量呈空间分布时,就称之为区域化变量。
这种变量反映了空间某种属性的分布特征。
矿产、地质、海洋、土壤、气象、水文、生态、温度、浓度等领域都具有某种空间属性。
区域化变量具有双重性,在观测前区域化变量Z(X)是一个随机场,观测后是一个确定的空间点函数值。
区域化变量具有两个重要的特征。
一是区域化变量Z(X)是一个随机函数,它具有局部的、随机的、异常的特征;其次是区域化变量具有一般的或平均的结构性质,即变量在点X 与偏离空间距离为h的点X+h处的随机量Z(X)与Z(X+h)具有某种程度的自相关,而且这种自相关性依赖于两点间的距离h与变量特征。
在某种意义上说这就是区域化变量的结构性特征。
二、协方差函数协方差又称半方差,是用来描述区域化随机变量之间的差异的参数。
在概率理论中,随机向量X与Y的协方差被定义为:区域化变量在空间点x 和x+h处的两个随机变量Z(x) 和Z(x+h) 的二阶混合中心矩定义为Z(x) 的自协方差函数,即区域化变量Z(x) 的自协方差函数也简称为协方差函数。
kriging插值
l 反映了变量的空间结构性 l 能得到估计精度
克里金方法的局限性
(1)克里金插值为局部估计方法,对估计值的 整体空间相关性考虑不够,它保证了数据的估计局 部最优,却不能保证数据的总体最优,因为克里金 估值的方差比原始数据的方差要小。因此,当井点 较少且分布不均时可能会出现较大的估计误差,特 别是在井点之外的无井区误差可能更大。
(4)变差函数参数的最优性检验: 变差函数是否符合实际,应该进行检验。 一种实用的检验方法为“交叉验证法” (Cross-validation),检验标准是在各实测 点,根据周围点计算的克里金估计值与该实测 值的误差平方平均最小。 估计误差的平方与克里金估计方差之比越接 近1,则说明变差函数与实际的符合程度越高。 实际上,这种方法在检验变差函数的同时,也 在检验所使用的克里金估计方法的适用性。
可得到关系式:
i 1
n
i
1
(2)估计方差最小
k2
E Z x Z x
* 2 0 0
E Z * x0 Z x0 E Z * x0 Z x0 min
2
应用拉格朗日乘数法求条件极值
j
假设空间点x只在一维的x轴上变化,则将区域化 变量Z(x)在x,x+h两点处的值之差的方差之半定义 为Z(x)在x轴方向上的变差函数,记为 ( x, h )
( x, h ) =
=
1 2 1 2
Var[Z(x)-Z(x+h)]
E[Z(x)-Z(x+h)]2-{E[Z(x)-Z(x+h)]}2
半变差函数(或半变异函数)
i 1
n
k2 i xi x0 x0 x0
Kriging插值法
Kriging插值法克⾥⾦法是通过⼀组具有 z 值的分散点⽣成估计表⾯的⾼级地统计过程。
与插值⼯具集中的其他插值⽅法不同,选择⽤于⽣成输出表⾯的最佳估算⽅法之前,有效使⽤⼯具涉及 z 值表⽰的现象的空间⾏为的交互研究。
什么是克⾥⾦法?IDW(反距离加权法)和样条函数法插值⼯具被称为确定性插值⽅法,因为这些⽅法直接基于周围的测量值或确定⽣成表⾯的平滑度的指定数学公式。
第⼆类插值⽅法由地统计⽅法(如克⾥⾦法)组成,该⽅法基于包含⾃相关(即,测量点之间的统计关系)的统计模型。
因此,地统计⽅法不仅具有产⽣预测表⾯的功能,⽽且能够对预测的确定性或准确性提供某种度量。
克⾥⾦法假定采样点之间的距离或⽅向可以反映可⽤于说明表⾯变化的空间相关性。
克⾥⾦法⼯具可将数学函数与指定数量的点或指定半径内的所有点进⾏拟合以确定每个位置的输出值。
克⾥⾦法是⼀个多步过程;它包括数据的探索性统计分析、变异函数建模和创建表⾯,还包括研究⽅差表⾯。
当您了解数据中存在空间相关距离或⽅向偏差后,便会认为克⾥⾦法是最适合的⽅法。
该⽅法通常⽤在⼟壤科学和地质中。
克⾥⾦法公式由于克⾥⾦法可对周围的测量值进⾏加权以得出未测量位置的预测,因此它与反距离权重法类似。
这两种插值器的常⽤公式均由数据的加权总和组成:其中:Z(s i) = 第i个位置处的测量值λi = 第i个位置处的测量值的未知权重s0 = 预测位置N = 测量值数在反距离权重法中,权重λi仅取决于预测位置的距离。
但是,使⽤克⾥⾦⽅法时,权重不仅取决于测量点之间的距离、预测位置,还取决于基于测量点的整体空间排列。
要在权重中使⽤空间排列,必须量化空间⾃相关。
因此,在普通克⾥⾦法中,权重λi取决于测量点、预测位置的距离和预测位置周围的测量值之间空间关系的拟合模型。
以下部分将讨论如何使⽤常⽤克⾥⾦法公式创建预测表⾯地图和预测准确性地图。
使⽤克⾥⾦法创建预测表⾯地图要使⽤克⾥⾦法插值⽅法进⾏预测,有两个任务是必需的:找到依存规则。
matlab 克里金说明书译文
matlab 克里金说明书译文
克里金插值法是一种用于空间插值的技术,它可以根据已知的点值数据来估计其他位置的值。
在 MATLAB 中,克里金插值可以通过使用 `kriging` 函数来实现。
克里金插值需要输入已知点的坐标和对应的数值,然后可以使用插值结果来估计其他位置的数值。
在克里金插值中,有几个重要的参数需要注意。
首先是插值模型的类型,通常有普通克里金、简单克里金和泛克里金等类型可供选择。
不同的类型对应着不同的空间变异性模型,需要根据实际数据的特点来选择合适的类型。
其次是半变异函数的选择,克里金插值需要假设数据的变异性是平稳的,因此需要选择合适的半变异函数来描述数据的空间相关性。
在 MATLAB 中,可以通过设置 `variogram` 函数来定义半变异函数的类型和参数。
另外,还可以通过设置 `kriging` 函数的其他参数,如块大小、块形状等来进一步调整插值的效果。
除了基本的克里金插值方法,MATLAB 还提供了一些扩展的工具箱,如 Mapping Toolbox 和 Statistics and Machine Learning Toolbox,它们提供了更多高级的空间分析和插值工具,可以更加灵
活地处理空间数据。
总的来说,MATLAB 提供了丰富的工具和函数来支持克里金插值的实现和应用,可以根据具体的需求和数据特点来选择合适的方法和参数,从而进行准确的空间插值分析。
希望这些信息对你有所帮助。
克里金插值方法第二节
•
地变化,否则可能导致KT
线性系统不稳定;
(2)在主变量的所有数据点u处和待估计的 位置u处,外部变量都必须是已知的。
(K=0时,?)
四、 协同克里金(CK) (Cokriging)
利用几个变量之间的空间相关性,对其中的一个或几 个变量进行空间估计,尤其适用于被估计变量的观察数据 较少的情况 。
协同克里金估计值(初始变量和二级变量)
n
m
Z
* 0
i xi
jyj
i 1
j 1
Z
* 0
----随机变量在位置0处的估计值;
x1,, x-n---初始变量的n个样本数据;
•
y1,, ym----二级变量的m个样本数据;
a1,, an 及 1,, --m--需要确定的协同克里金加权系数。
协同克里金方程组
n
i C
xi x j
1
( 1,2,, n)
应用条件:
随机函数二阶平稳 随机函数的期望值 m为常数并已知
不能用于具有局部趋势的情况
二、普通克里金(OK) (Ordinary Kriging)
n
Z *u (u)Z u 1
n 1
(u)C
u
u
(u) Cu u
n
(u) 1
1
1,, n
观察数据:是指那些精度比较高,但数量比较少的数据 猜测数据:是指那些精度比较低,但分布广泛的数据
在观测数据比较多的地方,估计 结果主要受观测数据的影响;在 观测数据比较少的地方,则主要 受猜测数据的影响。
n
(u)C(u ,u ) C(u,u ),
1
( 1,2,, n)
求(n+1)个m(u), 求(n+1)×(n+1) 个C(u,u)
克里金插值法
克里金插值法克里金插值法又称空间局部插值法,是以变异函数理论和结构分析为基础,在有限区域对区域化变量进行无偏最优估计的一种方法,是地统计学的主要容之一,由南非矿产工程师D. Matheron 于1951年在寻找金矿时首次提出,法国著名统计学家G. Matheron 随后将该方法理论化、系统化,并命名为Kriging ,即克里金插值法。
1克里金插值法原理克里金插值法的适用围为区域化变量存在空间相关性,即如果变异函数和结构分析的结果表明区域化变量存在空间相关性,则可以利用克里金插值法进行插或外推。
其实质是利用区域化变量的原始数据和变异函数的结构特点,对未知样点进行线性无偏、最优估计,无偏是指偏差的数学期望为0,最优是指估计值与实际值之差的平方和最小[1]。
因此,克里金插值法是根据未知样点有限领域的若干已知样本点数据,在考虑了样本点的形状、大小和空间方位,与未知样点的相互空间关系,以及变异函数提供的结构信息之后,对未知样点进行的一种线性无偏最优估计。
假设研究区域a 上研究变量Z (x ),在点x i ∈A (i=1,2,……,n )处属性值为Z (x i ),则待插点x 0∈A 处的属性值Z (x 0)的克里金插值结果Z*(x 0)是已知采样点属性值Z (x i )(i=1,2,……,n )的加权和,即:)()(10*i n i i x Z x Z ∑==λ (1) 式中i λ是待定权重系数。
其中Z(x i )之间存在一定的相关关系,这种相关性除与距离有关外,还与其相对方向变化有关,克里金插值方法将研究的对象称“区域化变量”针对克里金方法无偏、最小方差条件可得到无偏条件可得待定权系数i λ (i=1,2,……,n)满足关系式: 11=∑=n i i λ(2)以无偏为前提,kriging 方差为最小可得到求解待定权系数i λ的方程组:⎪⎪⎩⎪⎪⎨⎧=⋯⋯==+∑∑==1)n,2,1)(,(),(11niijjiniijxxCxxCλμλ,(3)式中,C(x i,x j)是Z(x i)和Z(x j)的协方差函数。
克里金kriging插值的几种方法
克⾥⾦kriging插值的⼏种⽅法
1.ordinary kriging是单个变量的局部线形最优⽆偏估计⽅法,也是最稳健常⽤的⼀种⽅法。
2.simple kriging很少直接⽤于估计,因为它假设空间过程的均值依赖于空间位置,并且是已知的,但在实际中均值⼀般很难得到。
它可以⽤于其它形式的克⽴格法中例如指⽰和析取克⽴格法,在这些⽅法中数据进⾏了转换,平均值是已知的。
3.universal kriging是把⼀个确定性趋势模型加⼊到克⽴格估值中,将空间过程总可以分解为趋势项和残差项两个部分的和,有其合理的⼀⾯。
如果能够很容易地预测残差的变异函数,那么该⽅法将会得到⾮常⼴泛的应⽤。
4.indicator kriging 将连续的变量转换为⼆进制的形式,是⼀种⾮线性、⾮参数的克⽴格预测⽅法。
5.disjunctive kriging也是⼀种⾮线性的克⽴格⽅法,但它是有严格的参数的。
这种⽅法对决策是⾮常有⽤的因为它不但可以进⾏预测,还提供了超过或不超过某⼀阈值的概率。
6.ordianry cokriging是将单个变量的普通克⽴格法的扩展到两个或多个变量,且这些变量间要存在⼀定的协同区域化关系。
如果那些测试成本低、样品较多的变量与那些测试成本较⾼的、样品较少的变量在空间上具有⼀定的相关性,那么该⽅法就尤其有⽤。
可以利⽤较密采样得到的数据来提⾼样品较少数据的预测精度
8.probability kriging是由于指⽰克⽴格法并没有考虑⼀个值与阈值的接近程度⽽只是它的位置,因此提出了概率克⽴格法。
对每个值它利⽤rank order 作为辅助变量利⽤协同克⽴格法来预测指⽰值。
克里格插值法
工程数学
提出了如下的平稳假设及内蕴假设: 提出了如下的平稳假设及内蕴假设:
{ 随机函数: 随机函数:Z (u ), u ∈ 研究范围} ,其空间分布律不因平移 而改变,即若对任一向量h, 而改变,即若对任一向量 ,关系式
F ( z1 , z2 , ⋅⋅⋅; x1 , ⋅⋅⋅) = F ( z1 , z2 , ⋅⋅⋅; x1 + h, x2 + h, ⋅⋅⋅)
D(ξ ) = Var (ξ ) = E[ξ − E (ξ )] = E (ξ ) − E (ξ )2 22来自工程数学工程数学
(3)协方差 ) 协方差是用来刻画随机变量之间协同变化程度的指标, 协方差是用来刻画随机变量之间协同变化程度的指标,其 大小反映了随机变量之间的协同变化的密切程度。 大小反映了随机变量之间的协同变化的密切程度。
σ ij = Cov(ξ1 , ξ 2 ) = E[(ξ1 − E (ξ1 ) (ξ 2 − E (ξ 2 ) ] ) )
= E (ξ1ξ 2 ) − E (ξ1 ) E (ξ 2 )
(4)相关系数 ) 协方差是有量纲的量,与随机变量分布的分散程度有关, 协方差是有量纲的量,与随机变量分布的分散程度有关,为 消除分散程度的影响,提出了相关系数这个指标。 消除分散程度的影响,提出了相关系数这个指标。
成立时,则该随机函数 成立时,则该随机函数Z(x)为平稳性随机函数。 为平稳性随机函数。 这实际上就是指,无论位移h多大,两个 维向量的随机变量 多大, 这实际上就是指,无论位移 多大 两个k维向量的随机变量
{ Z ( x1 ), Z ( x2 ),L , Z ( xk )} 和 { Z ( x1 + h), Z ( x2 + h),L , Z ( xk + h)}
简单克里金插值代码
简单克里金插值代码克里金插值是一种常用的空间插值方法,用于根据已知的离散点数据估计未知位置的数据值。
本文将介绍一段简单的克里金插值代码,并解释其原理和用法。
克里金插值的原理是基于空间自相关性的假设,即相邻位置的数据值之间存在一定的空间相关性。
根据这个假设,我们可以通过已知点的数据值和它们之间的空间关系,推断未知点的数据值。
以下是一段简单的克里金插值代码:```pythonimport numpy as npfrom sklearn.metrics.pairwise import pairwise_distancesdef simple_kriging(x, y, z, xi, yi):n = len(x)d = pairwise_distances(np.column_stack((x, y)), np.column_stack((xi, yi)))r = np.exp(-d)A = np.ones((n + 1, n + 1))A[:n, :n] = rA[-1, -1] = 0b = np.concatenate((z, [1]))w = np.linalg.solve(A, b)zi = np.dot(r.T, w[:-1])return zi```这段代码实现了简单克里金插值的计算过程。
它接受输入参数x、y、z,分别表示已知点的横坐标、纵坐标和数据值。
xi、yi表示需要估计的未知点的坐标。
代码先计算已知点之间的距离矩阵d,并将其转换为相关性矩阵r。
然后构建线性方程组A和向量b,并使用numpy的linalg.solve函数求解线性方程组,得到权重向量w。
最后,通过点积运算得到未知点的估计值zi。
使用这段代码的方法很简单。
首先,准备好已知点的坐标和数据值,以及需要估计的未知点的坐标。
然后,调用simple_kriging函数并传入这些参数,即可得到未知点的估计值。
克里金插值在地理信息系统、环境科学、地质勘探等领域有着广泛的应用。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
The GLOBEC Kriging Software Package – EasyKrig3.0July 15, 2004 Copyright (c) 1998, 2001, 2004 property of Dezhang Chu and Woods Hole Oceanographic Institution. All Rights Reserved.The kriging software described in this document was developed by Dezhang Chu with funding from the National Science Foundation through the U.S. GLOBEC Georges Bank Project's Program Service and Data Management Office. It was originally inspired by a MATLAB toolbox developed by Yves Gratton and Caroline Lafleur (INRS-Océanologie, Rimouski, Qc, Canada), and Jeff Runge (Institut Maurice-Lamontagne, now with University of New Hampshire). This software may be reproduced for noncommercial purposes only.This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. Contact Dr. Chu at dchu@ with enhancements or suggestions for changes.Table of Contents:1. INTRODUCTION1.1 General Information1.1.1 About kriging1.1.2 Brief descriptions of easy_krig3.01.2 Getting started1.2.1 Operating systems1.2.2 Down-load the program1.2.3 Quick start2. DATA PROCESSING STAGES2.1 Data Preparation2.2 Semi-variogram2.3 Kriging2.4 Visualization2.5Saving Kriging Results3. EXAMPLES3.1 Example 1: An Aerial Image of Zooplankton Abundance Data3.2 Example 2: A Vertical Section of Salinity Data – An Anisotropic Data set3.3 Example 3: Batch Process of Pressure (dbar) at Different Potential Density Layers3.4 Example 4: 3-Dimensional Temperature Data4. REFERENCES1.INTRODUCTION 1.1General Information 1.1.1 About krigingThis section provides a brief theoretical background for kriging. If the user(s) is not interested in thetheoretical background, he/she can skip this section and go to section 1.1.2 directly.Kriging is a technique that provides the Best Linear Unbiased Estimator of the unknown fields (Journel andHuijbregts, 1978; Kitanidis, 1997). It is a local estimator that can provide the interpolation and extrapolation of the originally sparsely sampled data that are assumed to be reasonably characterized by the Intrinsic Statistical Model (ISM). An ISM does not require the quantity of interest to be stationary, i.e. its mean and standard deviation areindependent of position, but rather that its covariance function depends on the separation of two data points only, i.e.E[ (z(x ) – m)(z(x ’) – m) ] = C (h ), (1)where m is the mean of z(x ) and C (h ) is the covariance function with lag h , with h being the distance between two samples x and x ’:h = || x – x ’ || = .)()()(2,332,222,11x x x x x x -+-+- (2)Another way to characterize an ISM is to use a semi-variogram,)(h γ= 0.5* E[ (z(x ) – z(x ’) )2]. (3)The relation between the covariance function and the semi-variogram is)(h γ = C (0) – C (h ). (4)The kriging method is to find a local estimate of the quantity at a specified location, L x . This estimate is aweighted average of the N adjacent observations:)()(ˆ1α=αα∑λ=x x N L z z(5)The weighting coefficients αλ can be determined based on the minimum estimation variance criterion:[]{})()(2)0()(ˆ)(2βααββαααα-∑λ∑λ+-∑λ-=-x x x x x x C C C z z E L L L(6)subject to the normalization condition∑=λ=ααN11. (7)Note that we don’t know the exact value at L x , but we are trying to find a predicted value that provides the minimum estimation variance. The resultant kriging equation can be expressed as1)()(11=∑λ-=μ--∑λ=ββαβα=ββN L n n NC C x x x x , (8)where μ is the Lagrangian coefficient. In addition, we have replaced the covariance function with the normalizedcovariance function [normalized by C (0)]. Equivalently, by using Eq. (4), the kriging equation can also be expressed in terms of the semi-variogram as1)()(11=∑λ-γ=μ+-γ∑λ=ββαβα=ββN L n n N x x x x , (9)where we have used normalized semi-variogram, i.e., semi-variogram normalized by C (0) as we did in deriving Eq. (8).Having obtained the weighting coefficients (βλ ) and the Lagrangian coefficient (μ ) by solving either Eq. (8) OR Eq. (9), the kriging variance, Eq. (6), can be expressed as:[]{})0()()()0()(ˆ)(22γ--γ∑λ+μ=-∑λ-μ+=-=σααααααL L L L L C C z z E x x x x x x . (10)The above equations are the basis of the Easykrig software package.1.1.2 Brief description of EasyKrig3.0The EasyKrig program package uses a Graphical User Interface (GUI). It requires MATLAB 5.3 or higherwith or without optimization toolbox (see section 2.2) and consists of five components, or processing stages: (1) data preparation, (2) variogram computation, (3) kriging, (4) visualization and (5) saving results. It allows the user toprocess anisotropic data, select an appropriate model from a list of variogram models, and a choice of kriging methods, as well as associated kriging parameters, which are also common features of the other existing software packages. One of the major advantages of this program package is that the program minimizes the users' requirements to "guess" the initial parameters and automatically generates the required default parameters. In addition, because it uses a GUI, the modifications from the initial parameter settings can be easily performed. Another feature of this program package is that it has a built-in on-line help library that allows the user to obtain the descriptions of the use of parameters and operation options easily.The current EasyKrig3.0 is the upgraded version of the previous version (EasyKrig2.1). In addition to having corrected some programming errors in the previous version (mostly GUI related errors), there are many new features included in the current version:∙ Matlab Version 6.x and 7.0 (tested under Windows) compatible∙ Capable of handling 3-D data∙ Enhanced batch file processing capability∙ More flexible in loading input data and saving output data∙Capable of handling the customized grid file∙More examples with detailed step by step instructions are provided to allow user(s) to master the functionality of the software package more quickly and easily.Although this software package lacks some abilities such as Co-kriging, it does provide a convenient tool for geostatistical applications and should also help scientists from other fields.For people who do not want to use GUI but only interested in function-based m-files can go to a different website that provides a function-based m-file Kriging package(/software/kriging/V3/intro_v3.html) developed by Caroline Lafleur and Yves Gratton, INRS-Océanologie, Universit du Qubec Rimouski.1.2 Getting Started1.2.1 Operating systemsThe software was originally developed under MATLAB 6.5 on a PC (windows 2000) and intended to be computer and/or operating system independent. The program has been tested on various machines (PC, Macintosh, and Sun Workstation) and operating systems (windows 2000/Xp, Linux) and performs fine.1.2.2 Down-load the programThe user needs to download the compressed file from GLOBEC web site first, the URL isftp:///pub/software/kriging/easy_krig/V3.0.1/ and the compressed file isWindows 95/98/NT/2000/XP,Macintosh and Linux: easy_krig30.zipUnix: easy_krig30.tar.gzAfter having downloaded the file, the user needs to uncompress the file. A directory of easy_krig3.0 will be created and you are ready to run the program.1.2.3 Quick startStart MATLAB and go to the designated easy_krig3.0 home directory. Just type “startkrig” in the MATLAB command window, a window will pop up. This window is the base window, called the Navigator window. The Menubar in this window contains many options you can choose. Now you are ready to move on.Note: You can add the kriging home directory to the Matlab search path and run the program from otherdirectories. However, you have to make sure that there are no functions of your own having the same names as those used for easy_krig3.0. Since the program will allow you to load and save files using a file browser, it is recommended that you run the program under the easy_krig3.0 home directory.The program provides a full on-line help function that provides the descriptions the use of almost all of the selectable functions, options, and parameters. It is quite self-explanatory and easy to use.2. DATA PROCESSING STAGESThere are several data processing stages (tasks) that are selectable from the Menubar on the top of the Navigator window, as well as other task windows. By selecting or clicking on any of the tasks, a window corresponding to the selected task will pop up. On each task window including the Navigator window, the descriptions and explanations of every option and selection in each task window can be found by click on the “Help” opt ion on theMenubar. On any of the task windows, clicking on the “Navigator” button, or selecting “Navigator” from the Menubar will bring back the Navigator window.2.1 Data PreparationSelecting “Load Data” from “Task” on the Menubar of any window le ads to the Data Preparation window. Click on the “'Load” button or select “Load” from the Menubar to load the raw data file. The format of the data file should be a 3-column ASCII file for 2D data and 4-column ASCII file for 3D data. Comments at the beginning of the data file will not affect the data as long as each comment line begins with a percentage symbol “%”.User(s) can provide their own m-file to load the data by using “External Program” option in the Data Preparation window. This function allows the user to generate the input data directly from the raw data instead of generating an ASCII file that is required by the Easykrig3.0. The required format for the input and output parameters by using an external program can be found by clicking on the “Help” from the Menubar and selecting “External Program”.One can set the other parameters such as reduction factor (or just accept default settings) before loading the file. After the file is loaded, if the user wants to change the other (default) settings, such as data filter, he/she can do so and then click on “Apply” pushbutton after the parameters have been set. The difference between “Load'” and “Apply” is that the latter operation is faster since it will not re-load the data file. For example, to change the axis labels after having loaded the data, one does not need to re-load the data.One can also save the “Data Format” information into a file, which will save all the parameter and option settings in this window. This feature allows the user(s) to load the data file with the same settings in the task window Kriging without opening or using this window. It is very useful when a batch process operation is needed (see explanation in 2.3 and the example 3 for more details).The usage of the other opti ons in this window can be found by selecting appropriate items from “Help” option on the Menubar.2.2Semi-variogramSelecting “Variogram” from “Task” on the Menubar leads to a popup Variogram/Correlogram window. Click on the “Compute” button to generate a d ata-based semi-variogram (or correlogram). Then, we need to seek a model-based semi-variogram or correlogram to fit the data-based variogram just computed. It can be proved that, based on Eq.(4), the relation between the normalized semi-variogram γn(h) [ normalized by the variance C(0)] and the correlogramC n(h) is:C n(h) = 1 - γn(h),where h is the lag distance (Eq. 2). An appropriate variogram/correlogram model can be selected depending on the shape of the variogram/correlogram computed from the data. The explanations of the parameters associated with the model can be found using the on-line help. Click on the “Apply” button and the program will compute the model-based variogram/correlogram using the current settings. The parameter settings can be changed either by changing the slider positions or by entering the numbers directly into the associated text-edit fields. If using the slider, the theoretical curve will change automatically, while if entering the number(s) into the text-edit field(s), the user needs to click on the “Apply” button to re-compute the curve.If the optimization toolbox (recommended) is installed, the user can use the Least-Squares Fit function to fit the data by clicking on the “LSQ fit” button. If the optim ization toolbox isn't installed, the program will automatically disable the Least-Squares fit function.Note that since the LSQ fit has a certain range for each parameter, different initial settings or parameters will produce different results.In some cases when the data are anisotropic, an anisotropic variogram or correlogram model can be activated. By selecting “Anisotropy” radio option, the corresponding settings are enabled. If you don't know or are not sure of the orientation and aspect ratio of the anisotropic feature of the data, you can use the default settings first and then adjust to obtain satisfactory results.One can save the current variogram parameters to a file and can also retrieve the variogram parameters previously saved to a file.The usage of the other options in this window can be found by selecting appropriate items from “Help” option on the Menubar.2.3KrigingSelecting “Kriging” from “Task” on the Menubar leads to a popup Kriging window. The parameters of the variogram or correlogram needed in the kriging operation are automatically passed from the Variogram window to the Kriging window.Click on the “Refresh” button to obtain the most recent semi-variogram and coordinates parameters if the user has loaded a new data set.The “Relative Variance” parameter will set the kriging values to “NaN” (Not a number) when the kriged values are larger than this parameter and will become blank in the kriging map. The default value of this parameter is 2.5.Click on the “Krig” button to start kriging. In general, accepting the default parameters will produce a reasonable kriging map to start with. Changing the variogram and kriging parameters will offer fine-tuning on these parameters and can further improve the quality of the kriging results.One of the important features of the EasyKrig is its ability of performing “Batch Process”, which allows the user to process a group of data sets that have the same data structures, i.e., having the same data format and using the same variogram and kriging parameters. The user will provide a file in which a list of the data file will be included. The outputs of each data set from kriging will be automatically saved to appropriate file in Matlab binary format.Another added feature in EasyKrig3.0 is that it allows users to provide their own grid file to specify the coordinates of regular or irregular grids on which the kriged values are generated.The usage of the other options in this window can be found by selecting appropriate items from “Help” option on the Menubar.2.4VisualizationChoosing “Visualization” from “Task” on the Menubar leads to the Visualization window. Three types of figures can be viewed in this window: kriging map, kriging-variance map and cross-validation. The first two maps are commonly used in the kriging literature while the last one is a unique approach of this program.Click on the “Show Plot” button to display the current kriging results.The shading option is for the display purpose only and their explanations can be found by typing “help shading” in the MATLAB command window.Sliders next to the colorbar case can be used to change the display range of the colormap scale. Sliders next to the X, Y, and Y axes in 3D case are used to change the positions of the slices in X, Y, and Z directions, respectively.If the data have been transformed in the Data Preparation window, the kriging results are the results from transformed data.An important feature of the EasyKrig is it can provide “cross-validation”, which ca n be performed by selecting the “Validation” radio option. One can compute and display the results from different cross-validation schemes in a separate Cross-Validation window. Among these schemes, the Q1 and Q2 are good indicators that provide a plausible assessment of the performance of the kriging in addition to the kriging-variance map. More detailed descriptions of these cross-validation can be found from the built-in “Help” function. In general, the Q1 criterion (distribution of the deviation for the mean) is easy to satisfy while the Q2 criterion (distribution of deviations for the standard deviation) is much more difficult to satisfy.As a rule of thumb, reducing the area under the theoretical curve of the variogram (smaller nugget, lower sill, smaller length scale, etc.) will increase the Q2 value, while increasing this area will reduce the Q2 value.The usage of the other options in this window can be found by selecting appropriate items from “Help” option on the Menubar.2.5Saving Kriging ResultsIn the Visualization window, by selecting “File” from the Menubar and then choosing “Save File As”, the user can save the outputs to a .mat file with a user-defined filename and at the user-selected location. The program saves the parameters and data structures (para and data) in the file. For information on the structures, the user needs to select “File” from the Menubar in the Navigator window and then “Variable Structure” to obtain explanations for some important variables (note that many variables are not relevant to users).3.EXAMPLESThere are several sample data files included in the package. All files are in ASCII format required by the program. In the following examples, the designated directory is assumed to be “easy_krig3.0”.3.1 Example 1: An Aerial Image of Zooplankton Abundance Data(1)Start MATLAB, in command window, change directory to the home directory of EasyKrig3.0. Type“startkrig” to launch the program.(2)Adjust the window size and position and select “Save Window Position” option from “Task” on the Menubarand then “Save Position” from the sub-menu. Note that after saving the window size and position, any of other task windows created afterwards will have the same size and at the same position. You can resize and re-position the window in any other task windows as well.(3)Select “Load Data” from “Task” on the Menubar to open the Data Preparation window.(a)Select “Data Col. 2” from the listbox of “Column” for X-Axis and “Data Col. 1” for Y-Axis (defaults).(b)Select “LONGITUDE” from listbox of “Variable” for X-Axis and “LATITUDE” for Y-Axis (defaults).(c)Leave other parameters unchanged.(d)Click on the “Load” button to open a dialog box, go to “data” directory, and then select the data file“zooplankton.dat” to load the selected file into memor y.(e)Select “Sample Sequence” in the “Display Type” frame to display the sample sequence. By selecting“2D/3D Color-coded View” to bring back the color-coded display.(4) Select “Variogram” from “Task” on the Menubar to open the Variogram/Correlogram wind ow.(a)Click on the “Compute” button to compute the semi-variogram. This plots the data-based semi-variogram as discrete open circles.(b)Select “general exponential-Bessel” (default) from the variogram model listbox on the upper right. Clickon the “LSQ Fit” button. If you don't have optimization toolbox, click on the “Apply” button, atheoretical model-based semi-variogram will be superimposed on the original data-based semi-variogram. The resultant semi-variogram parameters from the least-squares fit (if you have optimizationtoolbox) or from the default settings (if you don't have optimization toolbox) are shown in the text-editfields within the “Model Parameters” frame.(c)Click on the sliders associated with the variogram parameters, the theoretical curves will changeaccordingly to reflect the parameter changes. The parameters can also be changed by entering the valuesdirectly into the text-edit fields and then clicking on the “Apply” pushbutton.(d)Type 0 in the “nugget” text-edit field, 1.0 in the “sill” te xt-edit field, 0.1 in the “length” text-edit field,1.5 in the “power” field, and 0 in the 'hole scl' (hole scale) text-edit field. Then, click on the “Apply”button. A revised theoretical curve of the model-based semi-variogram will be generated and plotted(red curve).(e)By selecting the “Variogram” or “Correlogram” in the “Model Parameter” frame (top row) will provideeither variogram or correlogram depending on the user selection.(5) Select “Kriging” from “Task” on the Menubar to open the Kriging wind ow.(a) Simply click on the “Krig” button to start kriging by accepting the default settings. A status windowpops up and displays the processing progress. When the kriging is done, click on the “Quit” button toclose the status window.(6) Select “Visualization” from “Task” on the Menubar to open the Visualization window.(a)Simply click on the “Show Plot” button to display the kriging results. Note that the station positions onthe kriging map are color-coded to reflect the level of the agreement of the kriged results with theoriginal data. If they are invisible it is because they agree with the kriged values very well.(b)Select “Faceted” and then “Flat” for the “Shading” to see the changes in the display.(c)Click on “Data” from the Menubar and then select between “Color”, “Black/White” and “None” toobserve the color change at the locations of the original data. Selecting “Value” or “Error” andspecifying the “Color” and “Fontsize” allow the user to display the observed values or the differencebetween the observed values and those from kriging.(d)Select “Variance Map” to display kriging variance map.(e)Selecting “Validation” will open a small popup “Validation” window. Click on “Compute” button, theQ1-validation curve occurs. A vertical red line at about 0.09 in between the two black lines at about 0.5and -0.5 indicates the model parameters are good based on the Q1 criterion.(f)Selecting “Q2” from the listbox of “Method” results in another plot. A vertical red line is located withinthe accept region at about 1.09, which means the model parameters are likely “good” based on the Q2criterion. Click on “Quit” button to close the Validation window.(g)Activate the “Kriging” window by either selecting “Kriging” from “Task” on the Menubar, or selecting“Kriging Configuration” from “Window” on the Menubar, or simply clicking on the minimized“Kriging Configuration” on the Toolbar at the bottom of the screen. Type 1.1 in the “Relative Variance”text-edit field and click on “Krig” to perform a new kriging. Note that in th e Matlab command window,there is one line message resulting from kriging “Anomaly_cnt for |Ep| > Relative Error =37”. This is toinform the user that there are 37 kriged values whose normalized kriging variances or relative errors aregreater than 1.1. The total number of kriged value for this example is 266 (19 x 14), which can beverified by typing “data.out.krig” (look for Xg, Yg, Vg, and Eg) in the command window.(h)Go back to the “Visualization” window, click on “Krig Map” to refresh the kriging map. T here are blankregions on the kriging map, where the normalized kriging variance (normalized by the variance) exceedsspecified “Relative Variance”, i.e. 1.1.(7)Select “Kriging” from “Task” on the Menubar or simply click on the minimized the figure on the toolbar at thebottom of the screen to bring back the Kriging window.(a)Change “Relative Variance” back to 2.5.(b)Select “Customized Grid File” in the “Coordinates” frame and click on “Browse” button to open a filedialogue box. Load “globec_grid.dat” from the directory “data/GLOBEC_gridfile”.(c)Click on the “Krig” button to perform kriging by accepting the other settings in this window.(8) Select “Visualization” from “Task” on the Menubar or simply click on the minimized the figure on the toolbarat the bottom of the screen to bring back the Visualization window.(a)Click on the “Show Plot” button to display the kriging results.(b)Select “Interp” for the “Shading” to changes in the display.(9) Select “File” the Menubar and then select “Save File As” to o pen a dialog box.(a)Go to “output” directory or any directory you like and specify any filename you like (the defaultfilename is zooplankton.mat) and then click on the “Save” button to save all the data and parameterstructures to a MATLAB binary file.(b)Cli ck on “Quit” from the Menubar and then “Quit Easykrig” to quit the program. Restart the programagain by typing “startkrig” in the MATLAB command window. Click on the “Visualization” button toopen the Visualization window, and click on the “Load” button or select “File” and then “Load” fromthe Menubar to load the output file that has just been saved by using the file browser.(c)Click on the “Show Plot” button to display the kriging results, which should be the same as before.(10) Click on “Navigator” button or select “Navigator” from “Task” on the Menubar to open the Navigator window.(a)Select “About” from the Menubar and then “Variable Structure” to open the data structure descriptionfile. You can view how the data and para are structured and can extract many parameters such asvariogram parameters related to the kriging outputs.(b)Click on “Quit” from the Menubar and then “Quit Easykrig” to quit the program. Type “cd misc_mfiles”in the Matlab command window to go to the “misc_mfiles” directory.(c) Ty pe “display_globec_grid” in command window and a load data window pops up.(d) Use the file browser to load the data just saved in step (9)-(a) to view the results.(e) You can modify the display_globec_grid.m to plot the output variables yourself.3.2 Example 2: A Vertical Section of Salinity Data – An Anisotropic Data set(1)Start MATLAB in the MATLAB command window. Change directory to the home directory of EasyKrig3.0and type “startkrig” to launch the program.(2)Select “Load Data” from “Task” on the Men ubar to open the Data Preparation window.(a)Click on the “Load” button to open a dialog box, select “data” directory, and then select “salinity.dat”file to load the selected file into memory.(b)Select “Data Col. 1” and “Data Col. 2” from listbox “Column” for X-Axis and Y-Axis, respectively.(c)Select “X” and “Depth” from the listbox of “Variable” for X-Axis and Y-Axis, respectively.(d)Leave other parameters unchanged and click on “Apply” button.(e)Select “Reverse” radio option on the Y-Axis column to reverse the y-axis direction.(3)Select “Variogram” from “Task” on the Menubar to open the Variogram window.(a)Click on the “Compute” button to compute the semi-variogram.(b)Click on the “LSQ Fit” button [If you don't have optimization toolbox, go to step (c).] A theoreticalmodel-based semi-variogram will be superimposed on the original data-based semi-variogram.(c)Type 0 in the “nugget” parameter text-edit field, 1.28 for “sill”, 0.36 for “length”, 1.76 for “power”, and0 for “hole scl” (hole scale), and then click on the “Apply” button to generate a theoretical curve of themodel-based semi-variogram.(4) Select “'Kriging” from “Task” on the “Task” on the Menubar to open the Kriging window.(a) Simply click on the “Krig” button to start kriging by accepting the defau lt settings.(5) Select “Visualization” from “Task” on the Menubar to open the Visualization window.(a)Click on the “Show Plot” button to display the kriging results.(b)Verify that “Reverse” is selected for the y axis direction.(c)Select “Validation” from “Display” will open a small popup “Validation” window. Click on “Compute”to obtain the “Q1”value. A vertical red line around 0.08 in between the two black lines at about 0.1 and-0.1 indicates the model parameters are good based on Q1 criterion.(d)Select “Q2” from the listbox of “method” results. There is no red vertical line in between the two blacklines defining the Q2-accept region, but a value about 2.27 displayed on the top of the figure, indicatingthat the Q2 value is beyond the accept region and th e variogram model parameters are likely not “good”.。