資源簡(jiǎn)介
老外編的kriging插值 老外編的kriging插值 老外編的kriging插值 老外編的kriging插值

代碼片段和文件信息
function?[zis2zi]?=?kriging(vstructxyzxiyichunksize)
%?interpolation?with?ordinary?kriging?in?two?dimensions
%
%?Syntax:
%
%?????[zizivar]?=?kriging(vstructxyzxiyi)
%?????[zizivar]?=?kriging(vstructxyzxiyichunksize)
%
%?Description:
%
%?????kriging?uses?ordinary?kriging?to?interpolate?a?variable?z?measured?at
%?????locations?with?the?coordinates?x?and?y?at?unsampled?locations?xi?yi.
%?????The?function?requires?the?variable?vstruct?that?contains?all
%?????necessary?information?on?the?variogram.?vstruct?is?the?forth?output
%?????argument?of?the?function?variogramfit.
%
%?????This?is?a?rudimentary?but?easy?to?use?function?to?perform?a?simple
%?????kriging?interpolation.?I?call?it?rudimentary?since?it?always?includes
%?????ALL?observations?to?estimate?values?at?unsampled?locations.?This?may
%?????not?be?necessary?when?sample?locations?are?not?within?the
%?????autocorrelation?range?but?would?require?something?like?a?k?nearest
%?????neighbor?search?algorithm?or?something?similar.?Thus?the?algorithms
%?????works?best?for?relatively?small?numbers?of?observations?(100-500).
%?????For?larger?numbers?of?observations?I?recommend?the?use?of?GSTAT.
%
%?????Note?that?kriging?fails?if?there?are?two?or?more?observations?at?one
%?????location?or?very?very?close?to?each?other.?This?may?cause?that?the?
%?????system?of?equation?is?badly?conditioned.?Currently?I?use?the
%?????pseudo-inverse?(pinv)?to?come?around?this?problem.?If?you?have?better
%?????ideas?please?let?me?know.
%
%?Input?arguments:
%
%?????vstruct???structure?array?with?variogram?information?as?returned
%???????????????variogramfit?(forth?output?argument)
%?????xy???????coordinates?of?observations
%?????z?????????values?of?observations
%?????xiyi?????coordinates?of?locations?for?predictions?
%?????chunksize?nr?of?elements?in?zi?that?are?processed?at?one?time.
%???????????????The?default?is?100?but?this?depends?largely?on?your?
%???????????????available?main?memory?and?numel(x).
%
%?Output?arguments:
%
%?????zi????????kriging?predictions
%?????zivar?????kriging?variance
%
%?Example:
%
%?????%?create?random?field?with?autocorrelation
%?????[XY]?=?meshgrid(0:500);
%?????Z?=?randn(size(X));
%?????Z?=?imfilter(Zfspecial(‘gaussian‘[40?40]8));
%
%?????%?sample?the?field
%?????n?=?500;
%?????x?=?rand(n1)*500;
%?????y?=?rand(n1)*500;
%?????z?=?interp2(XYZxy);
%
%?????%?plot?the?random?field
%?????subplot(221)
%?????imagesc(X(1:)Y(:1)Z);?axis?image;?axis?xy
%?????hold?on
%?????plot(xy‘.k‘)
%?????title(‘random?field?with?sampling?locations‘)
%
%?????%?calculate?the?sample?variogram
%?????v?=?variogram([x?y]z‘plotit‘false‘maxdist‘100);
%?????%?and?fit?a?spherical?variogram
%?????subplot(222)
%?????[dumdumdumvstruct]?=?variogramfit(v.distancev.val[][][]‘model‘‘stable‘);
%?????title(‘variogram‘)
%
%?????%?now?use?the?sampled?locations?in?a?kriging
%?????[ZhatZvar]?=?kriging(vstructxyzXY);
%?????subplot(223)
%?????imagesc(X(1:)Y(:1)Zhat);?axis
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2014-08-28?21:29??kriging-master\
?????文件??????117862??2014-08-28?21:29??kriging-master\kriging.jpg
?????文件????????6165??2014-08-28?21:29??kriging-master\kriging.m
?????文件????????1320??2014-08-28?21:29??kriging-master\license.txt
- 上一篇:批量更改文件名 任意位置插入相同的字符
- 下一篇:惡意dns列表
評(píng)論
共有 條評(píng)論