X hits on this document

# Fuentes’ LAB NOTES: - page 3 / 12

59 views

0 shares

3 / 12

#

# covariance model, you can choose: "exponential", "matern", "gaussian",

#"spherical",  "wave", "powered.exponential"

#

# if you choose the mattern then the smoothing parameter is kappa

# here kappa is .5 (the default)

#

# You can say fix.nugget=T then the nugget will be 0 and

# you do not need to initizalize the nugget only the partial sill

# and range, therefore ini=c(.5,.3) where .5 is the initial value

# for partial sill and .3 is the initial value for range.

> wls\$nugget:

[1] 1.013864

\$cov.pars:

[1]  1.193859 10.445359

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

##EXERCISE 3: REML

#TO OBTAIN THE REML AND ML ESTIMATORS

#use likfit

#ini to initialize parameters

# partial sill and range

# kappa is power for powered exponential model

# kappa is smoothing for Matern

#method is ML or REML

#trend is cte, but you can also choose a linear

# trend by saying trend=1 or quadratic trend=2

coal.ml<- likfit(coords=coal.m[,2:3],data=coal.m[,4], fix.nugget=T,

ini=c(.5,.5),kappa=.5,

trend ="cte",method='ML',cov.model="powered.exponential")

coalani.ml<- likfit(coords=coal.m[,2:3],data=coal.m[,4], fix.nugget=T,

ini=c(.5,.5),kappa=.5, fix.psiA = FALSE, psiA = 0, fix.psiR = FALSE, psiR = 1,

trend ="cte",method='ML',cov.model="powered.exponential")

summary(coal.ml)

#output:

covariance model: powered.exponential with kappa = 0.5

nugget     sill     range

0 1.564391 0.6769796

REML

covariance model: exponential

nugget     sill     range

0 1.599048 0.8074612

coal.ml<- likfit(coords=coal.m[,2:3],data=coal.m[,4], fix.nugget=T,

ini=c(.5,.5),

trend ="cte",method='ML',cov.model="exponential")

ML:

 Document views 59 Page views 63 Page last viewed Sat Jan 21 21:49:23 UTC 2017 Pages 12 Paragraphs 458 Words 1924