Sunteți pe pagina 1din 36

geoR : Package for Geostatistical Data Analysis An illustrative session

Paulo J. Ribeiro Jr. & Peter J. Diggle Last update: 26 De! 2""#
http://www.leg.ufpr.br/geoR/geoRdoc/geoRintro.html

Cross-validation Spatial Interpolation

Getting started Bayesian analysis

Exploratory Tools Simulation

Parameter Estimation citing geoR

The package geoR provides unctions or geostatistical data analysis using the so t!are R" This document illustrates some #but not all $$ o the capa%ilities o the package" The o%&ective is to amiliarise the reader !ith the geoR's commands or data analysis and sho! some o the graphical outputs !hich can %e produced" The commands used here are &ust illustrative( providing %asic examples o the package handling" )e did not attempt to per orm a de initive analysis o this data" In !hat ollo!s the R commands are sho!n in
typewriter fonts like this"

Typically( de ault arguments are used or the unction calls and the user is encouraged to inspect other arguments o the unctions" *or example( to see all the arguments or the unction variog type+
args(variog)

The commands sho!n in this page are also availa%le in the ile geoRintro"R" )e re er to the geoR documentation or more details on the unctions included in the package geoR"

%. &'AR'()G A &*&&(+) A)D L+AD()G DA'A


, ter starting an R session( load geoR !ith the command+

library(geoR)

I the installation directory or the package is the de ault location or R packages( type+
library(geoR, lib.loc="PATH T! geoR")

!here "PATH T! geoR" is the path to the directory !here geoR !as installed" I the package is loaded correctly the ollo!ing message !ill %e displayed+
"""""""""""""""""""""""""""""""""""""""""""""""" geoR# f$nctions for geostatistical %ata analysis geoR version &.'"&( is now loa%e% """"""""""""""""""""""""""""""""""""""""""""""""

Typically( data are stored as an o%&ect #a list$ o the class "geo%ata"" ,n o%&ect o this class contains at least the coordinates o data locations and the data values" Click or in ormation on ho! to read data rom an ,SCII #text$ ile" )e re er to the documentation or the unctions as.geo%ata and rea%.geo%ata or more in ormation on ho! to import-convert data and on the de initions or the class "geo%ata"" *or the examples included in this document !e use the data set s&)) included in the geoR distri%ution" To load this data type+
%ata(s&)))

2. *,PL+RA'+R- '++L&
%. A .uick su//ary for t0e geodata ob1ect , .uick summary o the data can %e o%tained typing
s$**ary(s&)))

!hich !ill return a summary o the coordinates and data values like this
+coor%s.s$**ary

,,&,,.*in ).))/0'1))0 ).)&)2&).( *a3 ).21'2.)/44 ).22&.42(2 +%ata.s$**ary 5in. &st 6$. "&.&01) )..(') 5e%ian &.&)/) 5ean 'r% 6$. ).2')( &.0&)) 5a3. ..101)

Elements covariate, bor%ers and or $nits.* !ill %e also summari/ed i present in the geo%ata o%&ect" 2. Plotting data locations and 2alues The unction plot.geo%ata sho!s a 0 x 0 display !ith data locations #top plots$ and data versus coordinates #%ottom plots$" *or an o%&ect o the class "geo%ata" the plot is produced %y the command+
plot(s&)))

1otice that the top-right plot is produced using the package scatterplot3d" I this package is not installed a histogram o the data !ill replace this plot" The unction points.geo%ata produces a plot sho!ing the data locations" ,lternatively( points indicating the data locations can %e added to a current plot" There are options to speci y point si/es( patterns and colors( !hich can %e set to %e proportional to the data values or speci ied .uantiles" Some examples o graphical outputs are illustrated %y the commands and corresponding plots as sho!n %elo!" )e start saving the current graphical parameters"
par.ori 7" par(no.rea%only = TR89) par(*frow = c(.,.)) points(s&)), 3lab = ":oor% ;", ylab = ":oor% <") points(s&)), 3lab = ":oor% ;", ylab = ":oor% <", pt.%ivi%e = "rank.prop") points(s&)), 3lab = ":oor% ;", ylab = ":oor% <", ce3.*a3 = &.(, col = gray(se=(&, ).&, l=&)))), pt.%ivi%e = "e=$al") points(s&)), pt.%ivi%e = "=$intile", 3lab = ":oor% ;", ylab = ":oor% <") par(par.ori)

#. */pirical 2ariogra/s Empirical variograms are calculated using the unction variog" There are options or the classical or modulus estimator" Results can %e returned as variogram clouds( %inned or smoothed variograms"
clo$%& 7" variog(s&)), option = "clo$%", *a3.%ist=&) clo$%. 7" variog(s&)), option = "clo$%", esti*ator.type = "*o%$l$s", *a3.%ist=&) bin& 7" variog(s&)), $vec=se=(),&,l=&&)) bin. 7" variog(s&)), $vec=se=(),&,l=&&), esti*ator.type= "*o%$l$s") par(*frow=c(.,.)) plot(clo$%&, *ain plot(clo$%., *ain plot(bin&, *ain = plot(bin., *ain = par(par.ori) = "classical esti*ator") = "*o%$l$s esti*ator") "classical esti*ator") "*o%$l$s esti*ator")

*urthermore( the points o the variogram clouds can %e grouped into classes o distances #2%ins2$ and displayed !ith a %ox-plot or each %in"
bin& 7" variog(s&)),$vec = se=(),&,l=&&), bin.clo$% = T) bin. 7" variog(s&)),$vec = se=(),&,l=&&), esti*ator.type = "*o%$l$s", bin.clo$% = T) par(*frow = c(&,.)) plot(bin&, bin.clo$% = T, *ain = "classical esti*ator") plot(bin., bin.clo$% = T, *ain = "*o%$l$s esti*ator") par(par.ori)

Theoretical and empirical variograms can %e plotted and visually compared" *or example( the igure %elo! sho!s the theoretical variogram model used to simulate the data s&)) and t!o estimated variograms"
bin& 7" variog(s&)), $vec = se=(),&,l=&&)) plot(bin&) lines.vario*o%el(cov.*o%el = "e3p", cov.pars = c(&,).'), n$gget = ), *a3.%ist = &, lw% = ') s*ooth 7" variog(s&)), option = "s*ooth", *a3.%ist = &, n.points = &)), kernel = "nor*al", ban% = )..) lines(s*ooth, type ="l", lty = .) legen%().4, ).', c("e*pirical", "e3ponential *o%el", "s*oothe%"), lty = c(&,&,.), lw% = c(&,',&))

3irectional variograms can also %e computed %y the unction variog using the arguments %irection and tolerance" *or

example( to compute a variogram or the direction 45 degrees !ith the de ault tolerance angle #00"6 degrees$ the command !ould %e+
vario0) 7" variog(s&)), *a3.%ist = &, %irection=pi>') plot(vario0)) title(*ain = e3pression(paste("%irectional, angle = ", 0) ? %egree)))

and the plot is sho!n on the le t panel o the igure %elo!" *or a .uick computation in our directions !e can use the unction variog4 and the corresponding plot is sho!n on the right panel o the next igure"
vario.4 7" variog4(s&)), *a3.%ist = &) plot(vario.4, lw%=.)

#. PARA3*'*R *&'(3A'(+)
The model parameters can %e estimated+ o by "eye"+ trying di erent models over empirical variograms #using the unction lines.vario*o%el$( o by least squares fit of empirical variograms + !ith options or ordinary #78S$ and !eighted #)8S$ least s.uares #using the unction variofit$(
o

by likelihood based methods+ !ith options or maximum likelihood #98$ and restricted maximum likelihood #RE98$ #using the unction likfit$(

Bayesian methods are also implemented and !ill %e presented in Section 6 #using the unction krige.bayes$"

The ollo!ing commands sho! ho! to add a line !ith a variogram model to a variogram plot"
plot(variog(s&)), *a3.%ist=&)) lines.vario*o%el(cov.*o%el="e3p", cov.pars=c(&,.'), n$g=), *a3.%ist=&) lines.vario*o%el(cov.*o%el="*at", cov.pars=c(.1/,..), n$g=).&, kappa=&,*a3.%ist=&, lty=.) lines.vario*o%el(cov.*o%el="sph", cov.pars=c(.1,.1), n$g=).&,*a3.%ist=&, lw%=.)

In the parameter estimation unctions variofit and likfitthe nugget e ect parameter can either %e estimated or set to a ixed value" The same applies or smoothness( anisotropy and trans ormation parameters" 7ptions or taking trends into account are also included" Trends can %e speci ied as polynomial unctions o the coordinates and-or linear unctions o given covariates" The commands %elo! sho!s models itted %y di erent methods !ith options or ixed or estimated nugget parameter" *eatures not illustrated here include estimation o trends( anisotropy( smoothness and Box-Cox trans ormation parameter"
@ Aitting *o%els with n$gget fi3e% to Bero *l 7" likfit(s&)), ini = c(&,)./), fi3.n$gget = T) re*l 7" likfit(s&)), ini = c(&,)./), fi3.n$gget = T, *etho% = "R5C") ols 7" variofit(bin&, ini = c(&,)./), fi3.n$gget = T, weights="e=$al") wls 7" variofit(bin&, ini = c(&,)./), fi3.n$gget = T)

@ Aitting *o%els with a fi3e% val$e for the n$gget *l.fn 7" likfit(s&)), ini = c(&,)./), fi3.n$gget = T, n$gget = ).&/) re*l.fn 7" likfit(s&)), ini = c(&,)./), fi3.n$gget = T, n$gget = ).&/, *etho% = "R5C") ols.fn 7" variofit(bin&,ini = c(&,)./), fi3.n$gget = T, n$gget = ).&/, weights="e=$al") wls.fn 7" variofit(bin&, ini = c(&,)./), fi3.n$gget = T, n$gget = ).&/) @ Aitting *o%els esti*ate% n$gget *l.n 7" likfit(s&)), ini = c(&,)./), n$g = )./) re*l.n 7" likfit(s&)), ini = c(&,)./), n$g = )./, *etho% = "R5C") ols.n 7" variofit(bin&, ini = c(&,)./), n$gget=)./, weights="e=$al") wls.n 7" variofit(bin&, ini = c(&,)./), n$gget=)./) @ Dow, plotting fitte% *o%els against e*pirical variogra* par(*frow = c(&,')) plot(bin&, *ain = e3pression(paste("fi3e% ", ta$E. == )))) lines(*l, *a3.%ist = &) lines(re*l, lw% = ., *a3.%ist = &) lines(ols, lty = ., *a3.%ist = &) lines(wls, lty = ., lw% = ., *a3.%ist = &) legen%()./, ).', legen%=c("5C","R95C","!CF","GCF"),lty=c(&,&,.,.),lw%=c(&,.,&,.), ce3=).() plot(bin&, *ain = e3pression(paste("fi3e% ", ta$E. == ).&/))) lines(*l.fn, *a3.%ist = &) lines(re*l.fn, lw% = ., *a3.%ist = &) lines(ols.fn, lty = ., *a3.%ist = &) lines(wls.fn, lty = ., lw% = ., *a3.%ist = &) legen%()./, ).', legen%=c("5C","R95C","!CF","GCF"), lty=c(&,&,.,.), lw%=c(&,.,&,.), ce3=).() plot(bin&, *ain = e3pression(paste("esti*ate% ", ta$E.))) lines(*l.n, *a3.%ist = &) lines(re*l.n, lw% = ., *a3.%ist = &) lines(ols.n, lty = ., *a3.%ist = &) lines(wls.n, lty =., lw% = ., *a3.%ist = &) legen%()./, ).', legen%=c("5C","R95C","!CF","GCF"), lty=c(&,&,.,.), lw%=c(&,.,&,.), ce3=).() par(par.ori)

Summary methods have %een !ritten to summari/e the resulting o%&ects" *or example( or the model !ith estimated nugget itted %y maximum likelihood( typing+
*l.n

!ill produce the output+

likfit# esti*ate% *o%el para*eters# beta ta$s= sig*as= phi ).((00 ).)))) ).(/&( ).&1.( likfit# *a3i*ise% log"likelihoo% = "1'./020

!hilst a more detailed summary is o%tained !ith+


H s$**ary(*l.n) F$**ary of the para*eter esti*ation """"""""""""""""""""""""""""""""""" 9sti*ation *etho%# *a3i*$* likelihoo% Para*eters of the *ean co*ponent (tren%)# beta ).((00 Para*eters of the spatial co*ponent# correlation f$nction# e3ponential (esti*ate%) variance para*eter sig*as= (partial sill) = ).(/&( (esti*ate%) cor. fct. para*eter phi (range para*eter) = ).&1.( anisotropy para*eters# (fi3e%) anisotropy angle = ) ( ) %egrees ) (fi3e%) anisotropy ratio = &

Para*eter of the error co*ponent# (esti*ate%) n$gget = ) Transfor*ation para*eter# (fi3e%) Io3":o3 para*eter = & (no transfor*ation) 5a3i*ise% Cikelihoo%# log.C n.para*s AJ: IJ: "1'./020 4.)))) &(/.&'2& &1/.//21 :all# likfit(geo%ata = s&)), ini.cov.pars = c(&, )./), n$gget = )./)

T!o kinds o variogram envelopes computed %y simulation are illustrated in the igure %elo!" The plot on the le t-hand side sho!s an envelope %ased on permutations o the data values across the locations( i"e" envelopes %uilt under the assumption o no spatial correlation" The envelopes sho!n on the right-hand side are %ased on simulations rom a given set o model parameters( in this example the parameter estimates rom the WLS variogram it" This envelope sho!s the varia%ility o the empirical variogram"
env.*c 7" variog.*c.env(s&)), obK.var=bin&) env.*o%el 7" variog.*o%el.env(s&)), obK.var=bin&, *o%el=wls) par(*frow=c(&,.)) plot(bin&, envelope=env.*c) plot(bin&, envelope=env.*o%el) par(par.ori)

Pro ile likelihoods #:-3 and 0-3$ are computed %y the unction proflik" ;ere !e sho! the pro ile likelihoods or the covariance parameters o the model !ithout nugget e ect previously itted %y likfit" 4AR)()G: R5))()G '6* )*,' 7+33A)D 7A) 8* '(3*9 7+)&53()G
prof 7" proflik(*l, geo%ata = s&)), sill.val = se=().41, ., l=&&), range.val = se=().&, )./., l=&&), $ni.only = AACF9) par(*frow=c(&,')) plot(prof, nlevels=&0) par(par.ori)

2.

7R+&&9:AL(DA'(+)
The unction 3vali% per orms cross-validation either using the leavingone-out strategy or using a di erent set o locations provided %y the user" *or the irst strategy( data points are removed one %y one and predicted %y kriging using the remaining data" The commands %elo! illustrates crossvalidation or the models itted %y maximum likelihood and !eighted least s.uares" In the irst t!o calls the model parameters remains the same or the prediction at each location" In the next t!o calls the model parameters are re-estimated each time a point is removed rom the data-set" Graphical results are sho!n or the cross-validation results !here the leaving-oneout strategy com%ined !ith the !ls estimates or the parameters !as used"
3v.*l 7" 3vali%(s&)), *o%el=*l)

3v.wls 7" 3vali%(s&)), *o%el=wls)

4AR)()G: R5))()G '6* )*,' 7+33A)D 7A) 8* '(3*9 7+)&53()G


3vR.*l 7" 3vali%(s&)), *o%el=*l, reest=TR89) 3vR.wls 7" 3vali%(s&)), *o%el=wls, reest=TR89, variog.obK=bin&) par(*fcol = c(/,.), *ar=c(',',./,./), *gp=c(&./,.(,))) plot(3v.wls) par(par.ori)

3.

&PA'(AL ()'*RP+LA'(+)

Conventional geostatistical spatial interpolation # kriging$ can %e per ormed !ith options or+ o Simple kriging o Ordinary kriging o Trend universal! kriging o "#ternal trend kriging There are additional options or Box-Cox trans ormation #and %ack trans ormation o the results$ and anisotropic models" Simulations can %e dra!n rom the resulting predictive distri%utions i re.uested" ,s a irst example consider the prediction at our locations la%eled $% &% '% ( and indicated in the igure %elo!"
plot(s&))+coor%s, 3li*=c(),&..), yli*=c(),&..), 3lab=":oor% ;", ylab=":oor% <") loci 7" *atri3(c().., ).0, ).., &.&, ).., ).', &.), &.&), ncol=.) te3t(loci, as.character(&#4), col="re%") polygon(3=c(),&,&,)), y=c(),),&,&), lty=.)

The command to per orm ordinary kriging using the parameters estimated %y !eighted least s.uares !ith nugget ixed to /ero !ould %e+
kc4 7" krige.conv(s&)), locations = loci, krige = krige.control(obK.* = wls))

The output is a list including the predicted values # kc4+pre%ict$ and the kriging variances #kc4+krige.var$" Consider no! a second example" The goal is to per orm prediction on a grid covering the area and to display the results" ,gain( !e use ordinary kriging" The commands are+
@ %efining the gri% pre%.gri% 7" e3pan%.gri%(se=(),&, l=/&), se=(),&, l=/&)) @ kriging calc$lations kc 7" krige.conv(s&)), loc = pre%.gri%, krige = krige.control(obK.* = *l)) @ %isplaying pre%icte% val$es i*age(kc, loc = pre%.gri%, col=gray(se=(&,).&,l='))), 3lab=":oor% ;", ylab=":oor% <")

4.

8A-*&(A) A)AL-&(&
Bayesian analysis or Gaussian models is implemented %y the unction krige.bayes" It can %e per ormed or di erent 2degrees o uncertainty2( meaning that model parameters can %e treated as ixed or random"

,s an example consider a model !ithout nugget and including uncertainty in the mean( sill and range parameters" Prediction at the our locations indicated a%ove is per ormed %y typing a command like+
WARNING: RUNNING THE NEXT COMMAN CAN !E TIME"CON#UMING bsp4 7" krige.bayes(s&)), loc = loci, prior = prior.control(phi.%iscrete = se=(),/,l=&)&), phi.prior="rec"), o$tp$t=o$tp$t.control(n.post=/)))))

;istograms sho!ing posterior distri%ution or the model parameters can %e plotted %y typing+
par(*frow=c(&,'), *ar=c(',',./,./), *gp=c(.,&,))) hist(bsp4+posterior+sa*ple+beta, *ain="", 3lab=e3pression(beta), prob=T) hist(bsp4+posterior+sa*ple+sig*as=, *ain="", 3lab=e3pression(sig*aE.), prob=T) hist(bsp4+posterior+sa*ple+phi, *ain="", 3lab=e3pression(phi), prob=T) par(par.ori)

<sing summaries o these posterior distri%utions #means( medians or modes$ !e can check the 2estimated Bayesian variograms2 against the empirical variogram( as sho!n in the next igure" 1otice that it is also possi%le to compare these estimates !ith other itted variograms such as the ones computed in Section ="
plot(bin&, yli* = c(),&./)) lines(bsp4, *a3.%ist = &.., s$** = *ean) lines(bsp4, *a3.%ist = &.., s$** = *e%ian, lty = .)

lines(bsp4, *a3.%ist = &.., s$** = "*o%e", post="par",lw% = ., lty = .) legen%()../, ).4, legen% = c("variogra* posterior *ean", "variogra* posterior *e%ian", "para*eters posterior *o%e"), lty = c(&,.,.), lw% = c(&,&,.), ce3 = ).1)

The next igure sho!s predictive distri%utions at the our selected locations" 3ashed lines sho! Gaussian distri%utions !ith mean and variance given %y results o ordinary kriging o%tained in Section >" The ull lines correspond to the Bayesian prediction" The plot sho!s results o density estimation using samples rom the predictive distri%utions"
par(*frow=c(.,.), *ar=c(',',./,./), *gp=c(&./,.(,))) for(i in &#4)L kp3 7" se=(kc4+pre%,i- " '?s=rt(kc4+krige.var,i-), kc4+pre%,i- M'?s=rt(kc4+krige.var,i-), l=&))) kpy 7" %nor*(kp3, *ean=kc4+pre%,i-, s%=s=rt(kc4+krige.var,i-)) bp 7" %ensity(bsp4+pre%ic+si*,i,-) r3 7" range(c(kp3, bp+3)) ry 7" range(c(kpy, bp+y)) plot(cbin%(r3, ry), type="n", 3lab=paste("Cocation", i), ylab="%ensity", 3li*=c("4, 4), yli*=c(),&.&)) lines(kp3, kpy, lty=.) lines(bp) N par(par.ori)

Consider no!( under the same model assumptions( o%taining simulations rom the predictive distri%utions on a grid o points covering the area" The commands to de ine the grid and per orm Bayesian prediction are+
pre%.gri% 7" e3pan%.gri%(se=(),&, l='&), se=(),&, l='&))

4AR)()G: R5))()G '6* )*,' 7+33A)D 7A) 8* '(3*9 7+)&53()G


bsp 7" krige.bayes(s&)), loc = pre%.gri%, prior = prior.control(phi.%iscrete = se=(),/,l=/&)), o$tp$t=o$tp$t.control(n.pre%ictive=.))

9aps !ith the summaries and simulations o the predictive distri%ution can %e plotted as ollo!s"
par(*frow=c(.,.))

i*age(bsp, loc = pre%.gri%, *ain = "pre%icte%", col=gray(se=(&,).&,l=')))) i*age(bsp, val ="variance", loc = pre%.gri%, *ain = "pre%iction variance", col=gray(se=(&,).&,l=')))) i*age(bsp, val = "si*$lation", n$*ber.col = &, loc = pre%.gri%, *ain = "a si*$lation fro*Onthe pre%ictive %istrib$tion", col=gray(se=(&,).&,l=')))) i*age(bsp, val = "si*$lation", n$*ber.col = .,loc = pre%.gri%, *ain = "another si*$lation fro* On the pre%ictive %istrib$tion", col=gray(se=(&,).&,l=')))) par(par.ori)

)ote: *urther examples or the unction krige.bayes are given in the ile e#amples)krige)bayes)*

$.

&i/ulation of Gaussian Rando/ ;ields


The unction grf generates simulations o Gaussian random ields on regular or irregular sets o locations Some o its unctionality is illustrated %y the next commands"
si*& 7" grf(&)), cov.pars=c(&, ../)) points.geo%ata(si*&, *ain="si*$late% locations an% val$es") plot(si*&, *a3.%ist=&, *ain="tr$e an% e*pirical variogra*s")

si*. 7" grf(44&, gri%="reg", cov.pars=c(&, ../)) i*age(si*., *ain="a s*all"ish si*$lation", col=gray(se=(&, .&, l='))))

si*' 7" grf(4)4)&, gri%="reg", cov.pars=c(&), ..), *et="circ") i*age(si*', *ain="si*$lation on a fine gri%", col=gray(se=(&, .&, l='))))

17TE+ !e recommend the package Ran%o*Aiel%s or a more comprehensive implementation or simulation o Gaussian Random *ields"

%.

7iting geoR
The unction cite.geoR() sho!s in ormation on ho! to cite geoR in pu%lications"
H cite.geoR() To cite geoR in p$blications, $se RJI9JR! Pr., P.P. Q RJSSC9, P.P. (.))&) geoR# A package for geostatistical analysis. R"D9GF, Tol &, Do ., &/"&1. JFFD &0)2" '0'&. Please cite geoR when $sing it for %ata analysisU A IibTe; entry for CaTe; $sers is VArticleL, title analysisN, a$thor Ko$rnal year vol$*e n$*ber pages issn $rl N = LLgeoRN# a package for geostatistical = = = = = = = = LRibeiro Pr., P.P. an% Riggle, P.P.N, LR"D9GFN, L.))&N, L&N, L.N, L&/""&1N, L&0)2"'0'&N, Lhttp#>>cran.R"proKect.org>%oc>RnewsN

Site maintained %y+ Paulo ?" Ri%eiro ?r" #Paulo"Ri%eiro@est"u pr"%r$

'utorials on t0e usage of t0e package geoR


%. *<ploratory data analysis :" 8asic aspects of t0e spatial e<ploratory data analysis +
0"

Reading data and e<ploratory analysis+ a tutorial on irst steps o the data analysis"

2. &i/ulating geostatistical data


1.

&i/ulating fro/ t0e geostatistical /odel: simulations using the unction grf illustrating di erent aspects o the geostatistical model" Ani/ated 2D si/ulations: #%e patientA this may take a !hile to load in your %ro!ser$

0"

=" &i/ulating fro/ t0e generalised linear geostatistical /odel " #. (llustrating geostatistical calculations step by step :" *<a/ple on t0e si/ple kriging algorit0/" 0" *<a/ple of so/e geostatistical calculations" =" 7onstructing a co2ariate and obtaining t0e confidence inter2al for t0e coeficcient" >" =riging >it0 co2ariates+ example on ho! to construct a covariate on the prediction points to %e used in the kriging calculations"
6"

=riging in presence of co2ariates: a note+ comments on the usage o the arguments trend)l and trend)d"

?. Generic tutorials
1.

A traditional geostatistical data analysis+ example o the %asic steps or a simple geostatistical analysis" Some commands or a standard geostatistical analysis: illustrate the package syntax or exploratory analysis #including variograms$( parameter estimation and kriging prediction" An introduction to geoR+ !e% page !ith the main unctionality o the package geoR" 7o//ands file !ith contents sho!n during a pratical session during a short course on geostatistics" A basic e<a/ple o a geostatistical analysis o a soil conductivity data-set using R geoR" -et anot0er e<a/ple o the steps o a data analysis"

0"

3.

>"

6"

4"

@. 3ore on 8ayesian analysis


1.

An e<a/ple of 8ayesian prediction+ Illustrates the usage o the geoR's unction krige)bayes ! *urther examples or the unction krige.bayes are given in the ile e#amples)krige)bayes)*

2.

6. 8i2ariate geostatistical data :" &i/ulating bi2ariate proccess+

0" (nference and prediction for t0e bi2ariate Gaussian co//on co/ponent /odel+ A. +t0er data9sets Bin addition to t0e ones already included in t0e packageC Data this is a directory !ith data-sets used in some o the tutorials" Typically there are t!o iles corresponding to each data set+ o iles !ith extension .dat are the data iles" o iles !ith extension .t<t are iles !ith a %rie explanation on the data"
2.

geoR and sp: con2erting data for/ats :" +onverting kriging results to Spatial,rid-ata.rame and Spatial/i#els-ata.rame formats

D. +t0er tutorials
0"

An introduction to geoRgl/+ !e% page !ith the main aspects o the package geoRgl/" &i/ulating stoc0astic proccesses+ simulation routines to illustrate %asic concepts o stochastic proccesses"

="

paulo0us 1T ufpr)br Last /odified: 'ue Dec %6 %2:"#:26 8R&' 2""D

geoR: related publications

RIBEIR7 ?r( P"?"( C;RISTE1SE1( 7"*" ,13 3IGG8E( P"?" ,eostatistical soft2are - geo* and geo*glm #055=$ Procedings o the 3istri%uted Statistical Computing #3SC-055=$ Con erence" Ri%eiroEt,l"pd C;RISTE1SE1( 7"*" B RIBEIR7 ?r"( P"?" #0550$ geo*glm3 1 package for generalised linear spatial models" R-1E)S( Col 0( 1o 0( 04-0D" ISS1 :45E-=4=:" Rne!sF0550-0"pd 3IGG8E( P"?"( RIBEIR7 ?r( P"?" B C;RISTE1SE1( 7"*" #055=$ ,n introduction to model %ased geostatistics" 4n 9Gller( ?" #ed$ &patial

statistics and co/putational /et0ods" 8ecture notes in statistics( vol" :H=( p" >=-D4( Springer"

S1I88( T"( RIBEIR7 ?r( P"?" B RJ3I1( ;" 1 ne2 conceptual model for regional spatio-temporal dynamics% the substrate-tracking metapopulation model) #su%mitted$ *EJE1( 8"( RIBEIR7 ?r( P"?"( 3e S9E3T( *" B 3IGG8E( P"?" #0550$ Bayesian methodology to stochastic capture 5one determination3 conditioning on transmissivity measurements " )ater Resources Research( =D #E$+ ::4>-::H>" RIBEIR7 ?R"( P"?" and 3IGG8E( P"?" #055:$ geoR+ , package or geostatistical analysis" *-6"WS Col :( 1o 0" ISS1 :45E-=4=:" do!nload+ http+--cran"r-pro&ect"org-doc-Rne!s RIBEIR7 ?R"( P"?" and BR7)1( P"E" #055:$ Some !ords on the R pro&ect" The 4SB1 Bulletin Col :( 1o D #9arch$" do!nload+ *isba)pdf C;RISTE1SE1( 7"*"( 3IGG8E( P"?" ,13 RIBEIR7 ?R( P"?" #055:$" 1nalysing positive-valued spatial data3 the transformed ,aussian model) 4n 9onestie/( P"( ,llard( 3" and *roidevaux #eds$( Geo*): ((( 9 Geostatistics for en2iron/ental applications" Kuantitative Geology and Geostatistics( Llu!er Series( %%( 0DH--0ED" abstract 3IGG8E( P"?" ,13 RIBEIR7 ?R( P"?" #0555$" 3odel9based geostatistics" Caxam%u+ ,ssociaMNo Brasileira de EstatOstica" #:>P SI1,PE - SimpQsio 1acional de Pro%a%ilidade e EstatOstica$" preface 3IGG8E( P"?" ,13 RIBEIR7 ?R( P"?" #055:$" Bayesian in erence in Gaussian model-%ased geostatistics" ,eographical and "nvironmental 7odelling #to appear$ abstract 9,TE<( ?" ,13 RIBEIR7 ?R( P"?" #:EEE$" ,eostatistical data versus point process data3 analysis of second-order characteristics) 4n GQme/;ernRnde/( P"( Soares( 3" and *roidevaux #eds$( Geo*): (( 9 Geostatistics for en2iron/ental applications( Kuantitative Geology and Geostatistics( Llu!er Series( %"( 0:=-00>" abstract

RIBEIR7 ?R( P"?" ,13 3IGG8E( P"?" #:EEE$" geoS3 1 geostatistical library for S-/L8S) Technical report ST-EE-5E( 3ept o 9aths and Stats( 8ancaster <niversity" abstract 'o do>nload t0is report in co/pressed postscript B .ps.g!C file for/at click for: 2 pages per sheet Bdouble pageC or 1 page per sheet Bsingle pageC. RIBEIR7 ?R( P"?" ,13 3IGG8E( P"?" #:EEE$" Bayesian inference in ,aussian model-based geostatistics) Technical report ST-EE-5D( 3ept o 9aths and Stats( 8ancaster <niversity" abstract NOTE: Although this Tech. Report has the same name as a paper mentioned above the contents are not exactly the same. 'o do>nload t0is report in co/pressed postscript B .ps.g!C file for/at click for: 2 pages per sheet Bdouble pageC or 1 page per sheet Bdouble pageC"

Back to geoR home page Back to Paulo ?" Ri%eiro ?r home page Site contact3 paulo0us9est)ufpr)br

Last /odified: ;ri Jan %6 %%:##:2A 8R&' 2""?

8ayesian inference in Gaussian /odel9based geostatistics


Peter ?" 3iggle#:$ B Paulo ?" Ri%eiro ?r"#0$ Abstract

This paper considers data S/F:(Tldots(/FnS assumed to stem rom a reali/ation o a spatial process SUS and collected at sites SsF:(Tldots(sFnS" The random ield and the marked point process are t!o kinds o spatial processes" The ormer is de ined in every point o the area o interest and the sample positions can %e

determined %y the scientist himsel " *or the latter the locations are given %y a stochastic point process" In general it is GeostGeostatistical data versus point process data+ analysis o second-order characteristicsatistical data versus point process data+ analysis o second-order characteristics not possi%le to extend a given marked point process to a random ield %ecause o the interactions among the locations and the marks o the point process" ;o!ever( such an extension is possi%le in the so called random ield model !hich is there ore o particular interest in data analysis as a re erence model" Second-order characteristics descri%e the association %et!een the random varia%les SU#sF:$S and SU#sF0$S located at the locations SsF:S and SsF0S" Kuantities like pair correlation( mark correlation and mark variogram unctions are use ul in order to assess the second-order characteristics o marked point processes( !hile covariance-correlation unctions and the variogram are commonly used or the random ields" The goal o this paper is to analy/e the practical implications o all the a%ove mentioned characteristics using examples rom ecology and( in general( rom environmental science ields" Comparisons %et!een statistics in the geostatistical and the point process context are developed" :ey2ords3 geostatistics% model based inference% Bayesian inference% spatial interpolation) #:$ 8ancaster <niversity ,ddress+ 3epartment o 9athematics and Statistics( 8ancaster <niversity( 8,: >J* 8ancaster( <L" :05H:" Castellon( Spain" e-mail+ p"diggle@lancaster"ac"uk #0$ <niversidade *ederal do ParaBaacureV and 8ancaster <niversity" ,ddress+ 3epartment o 9athematics and Statistics( 8ancaster <niversity( 8ancaster 8,: >J*( <L" e-mail+ paulo&us@est"u pr"%r http3;;222)maths)lancs)ac)uk;<ribeiro; Last /odified: 4ed )o2 %@ 2":%E:2@ G3' 2"""

Geostatistical data 2ersus point process data: analysis of second9order c0aracteristics


?orge 9ateu#:$ B Paulo ?" Ri%eiro ?r"#0$

Abstract This paper considers data S/F:(Tldots(/FnS assumed to stem rom a reali/ation o a spatial process SUS and collected at sites SsF:(Tldots(sFnS" The random ield and the marked point process are t!o kinds o spatial processes" The ormer is de ined in every point o the area o interest and the sample positions can %e determined %y the scientist himsel " *or the latter the locations are given %y a stochastic point process" In general it is not possi%le to extend a given marked point process to a random ield %ecause o the interactions among the locations and the marks o the point process" ;o!ever( such an extension is possi%le in the so called random ield model !hich is there ore o particular interest in data analysis as a re erence model" Second-order characteristics descri%e the association %et!een the random varia%les SU#sF:$S and SU#sF0$S located at the locations SsF:S and SsF0S" Kuantities like pair correlation( mark correlation and mark variogram unctions are use ul in order to assess the second-order characteristics o marked point processes( !hile covariance-correlation unctions and the variogram are commonly used or the random ields" The goal o this paper is to analy/e the practical implications o all the a%ove mentioned characteristics using examples rom ecology and( in general( rom environmental science ields" Comparisons %et!een statistics in the geostatistical and the point process context are developed" :ey2ords3 second-order characteristics% mark correlation function% geostatistics% marked point process) #:$ <niversitat ?aume I" ,ddress+ 3epartment o 9athematics( <niversitat ?aume I( Campus Penyeta Ro&a( :05H:" Castellon( Spain" e-mail+ mateu@mat"u&i"es #0$ <*PR- C,PES- 8ancaster <niversity" ,ddress+ 3epartment o 9athematics and Statistics( 8ancaster <niversity( 8ancaster 8,:->J* e-mail+ paulo&us@est"u pr"%r http3;;222)maths)lancs)ac)uk;<ribeiro; Last /odified: 'ue +ct 2? %#:"E:26 8&' 2"""

3odel9based Geostatistics

Bto be presented in t0e %?F &()AP*G 2?92D July 2"""G 7a<a/buG 3GG 8rasilC eter !. "iggle 8ancaster <niversity( <L p"diggle@lancaster"ac"uk aulo !. Ribeiro !r. <niversidade *ederal do ParanR( Brasil paulo&us@est"u pr"%r Contact address+ 3epartment o 9athematics and Statistics( 8ancaster <niversity( 8ancaster 8,: >J*( <L"

Pre ace Course transparencies

1otes or the geoR>geoF tutorial PR*;A7*

,eostatistics has an interesting history" 7riginally( the term !as coined %y Georges 9athWron and colleagues at *ontaine%leau( *rance( to descri%e their !ork addressing pro%lems o spatial prediction arising in the mining industry" The ideas o the *ontaine%leau school !ere developed largely independently o the mainstream o spatial statistics( !ith a distinctive terminology and style" This tended to conceal the strong connections !ith parallel developments in spatial statistics %y 9atWrn( !hose S!edish doctoral thesis pu%lished in :E45 is still !idely cited( )hittle( Bartlett and others" *or example( the core geostatistical method kno!n as kriging is e.uivalent to minimum mean s.uare error prediction under a linear Gaussian model" Brian Ripley's irst %ook on spatial statistics #Ripley( :ED:$ made the connection explicit" Ten years later( 1oel Cressie's much larger %ook #Cressie( :EE:$ considered geostatistics to %e one o three main %ranches o spatial statistics( the others %eing discrete spatial variation #distri%utions on lattices( 9arkov random ields("""$ and spatial point processes" Geostatistical methods are no! used in many areas o application( ar %eyond the mining context in !hich they !ere originally developed" 3espite this apparent integration !ith spatial statistics( geostatistical practice still re lects its independent origins( and our vie! is that this has some undesira%le conse.uences" In particular( geostatistical in erence is o ten ad hoc in nature(

!ith explicit stochastic models rarely declared and( conse.uently( little use made o the likelihood-%ased methods o in erence !hich are central to modern statistics" 3iggle( 9oyeed and Ta!n #:EED$ used the phrase model-based geostatistics to descri%e an approach to geostatistical pro%lems %ased on the application o ormal statistical methods under an explicitly assumed stochastic model" This course takes the same point o vie!" The course is an applied statistical counterpart to 9ichael Stein's excellent %ook #Stein( :EEE$( !hich gives a rigorous mathematical theory o kriging" )e illustrate the methodology %y applying it to real data-sets" )e have !ritten a li%rary #geoF$ o &9PL5& unctions( and its R counterpart #geoR$ to implement the methods descri%ed in the course" This so t!are( together !ith the data-sets used in the course( is reely availa%le rom the !e%-address+
http#>>www.*aths.lancs.ac.$k>W%iggle

*inally( !e thank ,BE #,ssociaMNo Brasileira de EstatOstica$ or the opportunity to present our ideas at the :>X SI1,PE and our colleagues in 8ancaster( <L or their help ul input" )e particularly thank 8aura Regina Bernardes Liihl #Instituto ,gronYomico do ParanRa( 8ondrina( Bra/il$ or providing the ParanR rain all data( and 3r Steve Simon or providing the Rongelap residual contamination data" P?3 ackno!ledges inancial support rom the <L Engineering and Physical Sciences Research Council #Grant num%er G8-864054$ and rom the European Commission #T9R 1et!ork in Spatial and Computational Statistics$" These notes !ere !ritten during the second author's Ph3 program at the 3epartment o 9athematics and Statistics( 8ancaster <niversity( <L" P?R?r ackno!ledges inancial support rom C,PES-Brasil #Grant num%er BEZ :4H4-E4-0$ and <niversidade *ederal do ParanR" 7ourse transparencies The course slides are availa%le or do!nload in 0 di erent ormats+ compressed postscript )ps)g5! or pdf ormat" Select one o the options %elo!" :" pd ormat This ile can %e visualised using the 1dobe 1crobat reader o click to do!nload the ile in pd ormat 0" Compressed postscript ormat"

*or iles in this ormat you !ill need to #i$ do!nload one o the iles %elo!V #ii$ uncompress it using Win5ip #)indo!s$ or gun5ip #8inux-<nix$ #iii$ visuali/e and -or send to the printer using ghostvie2"
o o o

compressed "ps ile !ith > pages per sheet compressed "ps ile !ith 0 pages per sheet compressed "ps ile !ith : page per sheet )otes for t0e geoR&geo# tutorial

The tutorial session !ill %e %ased on a Tecnical Report descri%ing the so t!are( availa%le in compressed postscript )ps)g5! or pdf ormat" Select one o the options %elo! or do!nload" :" pd ormat This ile can %e visualised using the 1dobe 1crobat reader o click to do!nload the ile in pd ormat 0" Compressed postscript ormat" *or iles in this ormat you !ill need to #i$ do!nload one o the iles %elo!V #ii$ uncompress it using Win5ip #)indo!s$ or gun5ip #8inux-<nix$ #iii$ visuali/e and -or send to the printer using ghostvie2"
o o

ile !ith 0 pages per sheet ile !ith : page per sheet

go to geoR>geoF home page go to Something a%out geostatistics home page go to :>XSI1,PE home page http3;;222)maths)lancs)ac)uk;<ribeiro; Last /odified: 3on Jun 26 %@:%?:?" 8&' 2"""

3odel9based Geostatistics

Bto be presented in t0e %?F &()AP*G 2?92D July 2"""G 7a<a/buG 3GG 8rasilC eter !. "iggle 8ancaster <niversity( <L p"diggle@lancaster"ac"uk aulo !. Ribeiro !r. <niversidade *ederal do ParanR( Brasil paulo&us@est"u pr"%r Contact address+ 3epartment o 9athematics and Statistics( 8ancaster <niversity( 8ancaster 8,: >J*( <L"

Pre ace Course transparencies

1otes or the geoR>geoF tutorial PR*;A7*

,eostatistics has an interesting history" 7riginally( the term !as coined %y Georges 9athWron and colleagues at *ontaine%leau( *rance( to descri%e their !ork addressing pro%lems o spatial prediction arising in the mining industry" The ideas o the *ontaine%leau school !ere developed largely independently o the mainstream o spatial statistics( !ith a distinctive terminology and style" This tended to conceal the strong connections !ith parallel developments in spatial statistics %y 9atWrn( !hose S!edish doctoral thesis pu%lished in :E45 is still !idely cited( )hittle( Bartlett and others" *or example( the core geostatistical method kno!n as kriging is e.uivalent to minimum mean s.uare error prediction under a linear Gaussian model" Brian Ripley's irst %ook on spatial statistics #Ripley( :ED:$ made the connection explicit" Ten years later( 1oel Cressie's much larger %ook #Cressie( :EE:$ considered geostatistics to %e one o three main %ranches o spatial statistics( the others %eing discrete spatial variation #distri%utions on lattices( 9arkov random ields("""$ and spatial point processes" Geostatistical methods are no! used in many areas o application( ar %eyond the mining context in !hich they !ere originally developed" 3espite this apparent integration !ith spatial statistics( geostatistical practice still re lects its independent origins( and our vie! is that this has some undesira%le conse.uences" In particular( geostatistical in erence is o ten ad hoc in nature(

!ith explicit stochastic models rarely declared and( conse.uently( little use made o the likelihood-%ased methods o in erence !hich are central to modern statistics" 3iggle( 9oyeed and Ta!n #:EED$ used the phrase model-based geostatistics to descri%e an approach to geostatistical pro%lems %ased on the application o ormal statistical methods under an explicitly assumed stochastic model" This course takes the same point o vie!" The course is an applied statistical counterpart to 9ichael Stein's excellent %ook #Stein( :EEE$( !hich gives a rigorous mathematical theory o kriging" )e illustrate the methodology %y applying it to real data-sets" )e have !ritten a li%rary #geoF$ o &9PL5& unctions( and its R counterpart #geoR$ to implement the methods descri%ed in the course" This so t!are( together !ith the data-sets used in the course( is reely availa%le rom the !e%-address+
http#>>www.*aths.lancs.ac.$k>W%iggle

*inally( !e thank ,BE #,ssociaMNo Brasileira de EstatOstica$ or the opportunity to present our ideas at the :>X SI1,PE and our colleagues in 8ancaster( <L or their help ul input" )e particularly thank 8aura Regina Bernardes Liihl #Instituto ,gronYomico do ParanRa( 8ondrina( Bra/il$ or providing the ParanR rain all data( and 3r Steve Simon or providing the Rongelap residual contamination data" P?3 ackno!ledges inancial support rom the <L Engineering and Physical Sciences Research Council #Grant num%er G8-864054$ and rom the European Commission #T9R 1et!ork in Spatial and Computational Statistics$" These notes !ere !ritten during the second author's Ph3 program at the 3epartment o 9athematics and Statistics( 8ancaster <niversity( <L" P?R?r ackno!ledges inancial support rom C,PES-Brasil #Grant num%er BEZ :4H4-E4-0$ and <niversidade *ederal do ParanR" 7ourse transparencies The course slides are availa%le or do!nload in 0 di erent ormats+ compressed postscript )ps)g5! or pdf ormat" Select one o the options %elo!" :" pd ormat This ile can %e visualised using the 1dobe 1crobat reader o click to do!nload the ile in pd ormat 0" Compressed postscript ormat"

*or iles in this ormat you !ill need to #i$ do!nload one o the iles %elo!V #ii$ uncompress it using Win5ip #)indo!s$ or gun5ip #8inux-<nix$ #iii$ visuali/e and -or send to the printer using ghostvie2"
o o o

compressed "ps ile !ith > pages per sheet compressed "ps ile !ith 0 pages per sheet compressed "ps ile !ith : page per sheet )otes for t0e geoR&geo# tutorial

The tutorial session !ill %e %ased on a Tecnical Report descri%ing the so t!are( availa%le in compressed postscript )ps)g5! or pdf ormat" Select one o the options %elo! or do!nload" :" pd ormat This ile can %e visualised using the 1dobe 1crobat reader o click to do!nload the ile in pd ormat 0" Compressed postscript ormat" *or iles in this ormat you !ill need to #i$ do!nload one o the iles %elo!V #ii$ uncompress it using Win5ip #)indo!s$ or gun5ip #8inux-<nix$ #iii$ visuali/e and -or send to the printer using ghostvie2"
o o

ile !ith 0 pages per sheet ile !ith : page per sheet

go to geoR>geoF home page go to Something a%out geostatistics home page go to :>XSI1,PE home page http3;;222)maths)lancs)ac)uk;<ribeiro; 8ast modi ied+ 9on ?un 04 :6+:>+>5 BST 0555

S-ar putea să vă placă și