X hits on this document

# Fuentes’ LAB NOTES: - page 10 / 12

39 views

0 shares

10 / 12

coal.wind2\$krige.var

[1] 8.350462 1.362241

t(coal.wind2\$beta[1:2,])

[,1]      [,2]      [,3]

[1,] 7.467317 0.4058152 0.3430783

[2,] 7.030745 0.4716316 0.3130314

######################

## EXERCISE 3: ANISOTROPY.

#The function coords.aniso transform your coordinates

# into the coordinates in the new space where we have isotropy

# first one is  the rotation angle  (in radians) (psiA) and the second is psiR

# where psiR is

# the stretching parameter

# and it is greater than 1, if lambda is 1 there is not

# stretching (these parameters can be estimated with likfit)

#

#

new.coord<-coords.aniso(coal.m[,2:3],aniso.pars=c(.2,3))

# do kriging for anisotropic case

coal.wind2 <-ksline(coords=coal.m[,2:3],data=coal.m[,4],locations=loci,

cov.pars=c(3,1),nugget=0,

cov.model="exponential",

m0="kt",trend=1,aniso.pars=c(.2,3))

#################################

##EXERCISE 4: Maps and Images

#use library akima and fields

X11()

rx <- range(ozone.txt[,1])

ry <- range(ozone.txt[,2])

#to obtain map of us within the limits rx (long) and ry (lat):

par(mfrow=c(1,1))

US(xlim = rx, ylim = ry, lwd = 2, col = 1,add=F)

surf<- interp(ozone.txt[,1], ozone.txt[,2], ozone.txt[,3])

#to create an image: