[R-sig-Geo] spatial correlation model and variogram
ONKELINX, Thierry
Thierry.ONKELINX at inbo.be
Fri Jul 19 10:04:00 CEST 2013
Dear Moshood,
Pleasenotethataddingspacestoyourcodemakesyourcodemuchmorereadable
You want
model.vc <- gls(yield ~ easting + northing, method = "ML")
model.sph <- update(model.vc, corSpher(form = ~easting + northing, nugget = TRUE))
which is equivalent to
model.sph <- gls(yield ~ 1, corr = CorSpher(form = ~ easting + northing, nugget = TRUE), method="ML")
Save the residuals and modeling those again is not a good idea.
Best regards,
Thierry
PS I recommend setting some sensible starting values for the range and nugget. With the default range the optimizer tends to get stuck at very small ranges.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx at inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
-----Oorspronkelijk bericht-----
Van: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-project.org] Namens Moshood Agba Bakare
Verzonden: vrijdag 19 juli 2013 1:22
Aan: r-sig-geo at r-project.org
Onderwerp: [R-sig-Geo] spatial correlation model and variogram
Dear All,
Consider yield as attribute and easting and northing in meters as spatial coordinates.
I used gls function of nlme package because of spatial dependency of the residual. I tried to remove large-scale trend by using the easting and northing as covariates of yield.
model.vc<-gls(yield~easting+northing,method="ML").
Being a spatial data, we are most interested in carrying out variogram modelling of the spatial structure on the small-scale component i.e. the residual and equally fit the spatial correlation structure on the residual as well.
Do I need to obtain the residual from the model.vc above i.e
resid<-residuals(model.vc) and fit the other models as follow
model.sph<-gls(resid~1,corr=CorSpher(form=~easting+northing, nugget=T)) or
model.sph<-update(model.vc,corSpher(form=~easting+northing,nugget=T))
Please which one is correct.
Thank you.
Moshood
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
More information about the R-sig-Geo
mailing list