[R-sig-Geo] Spatial and multilevel model with kriging/interpolation in R

Frede Aakmann Tøgersen frtog at vestas.com
Mon Sep 29 08:55:08 CEST 2014


Even though there is a predict() for lme objects and it is easy to put up a regular grid over your region using the coordinates then you do not have values of your covariates at these coordinates making the predict() function fail. One way to go is to use some imputation methods to get values of your covariates at unobserved locations. However you probably need to come up with a joint distribution of response and covariates. That can become somewhat nasty I think.

Using INLA that is based on a Bayesian approach to statistical modelling where it is  easy to build joint distributions of variables this may be the way to go. I don't know the exact properties of your model variables but a joint Gaussian distribution may very well suits your needs on the original scale or on a transformed scale.

An example that may be the starting point for your model and direct you in putting up some R code may be Chapter 4 in http://www.math.ntnu.no/inla/r-inla.org/tutorials/spde/spde-tutorial.pdf. 

If you have further questions on INLA I think that you may get more response on the INLA discussion forum (see e.g. http://www.r-inla.org/) than on r-sig-geo mail list.

Yours sincerely / Med venlig hilsen

Frede Aakmann Tøgersen
Specialist, M.Sc., Ph.D.
Plant Performance & Modeling

Technology & Service Solutions
T +45 9730 5135
M +45 2547 6050
frtog at vestas.com

Company reg. name: Vestas Wind Systems A/S
This e-mail is subject to our e-mail disclaimer statement.
Please refer to www.vestas.com/legal/notice
If you have received this e-mail in error please contact the sender. 

> -----Original Message-----
> From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-
> project.org] On Behalf Of Justice Moses K. Aheto
> Sent: 25. september 2014 21:41
> To: geo-r-r-project
> Subject: Re: [R-sig-Geo] Spatial and multilevel model with
> kriging/interpolation in R
> Hello Thierry and Frede,
> Many thanks for your assistance and I do appreciate it very much and I will
> have a look at inla as suggested.
> Frede, I know how to fit the model in nlme package using lme but the major
> problem is how to use the model in lme for kriging and interpolation for on a
> grid/mesh. The model I fitted in lme last week Monday is shown below:
> m1 <- lme(haz2
> ~m5newf+v445new+hw1new+v012+v190newf+b0new+v481new+m18new,
> random = ~ 1|hhid, method="ML",data = d1) # Multilevel model (no spatial
> component)
> plot(Variogram(m1,form=~x+y)) # Plotting the variogram from the above
> model
> # Updating my model with spatial autocorrelation using Gaussian spatial
> correlation. I have tried Gaussian,exponential and spherical spatial
> correlation and the Gaussian fits my data better (shown below):
> spg <- update(m1, correlation = corGaus(value=c(2000,0.6),form = ~ x+
> y,nugget=T)) # initial values for range and nugget effects are 2000 and 0.6
> respectively.
> summary(spg)
> plot(Variogram(spg,form=~x+y)) # Plotting the variogram
> >From here, I need to use the spatial model above (spg) to do the
> kriging/interpolation on a grid (mesh) to be obtained from my data and I
> struggling to find my way out of it as of last week Monday 15th Sept.
> The size of my data is too large if not I would have attached it for the purpose
> of reproducibility.
> I will definitely have a look also at INLA as suggested and I am looking forward
> to more suggestions.
> Many thanks to you All.
> Kind regards
> *****************************************
> Justice Moses K. Aheto
> PhD Candidate in Medicine (United Kingdom)
> MSc Medical Statistics (United Kingdom)
> BSc Statistics (Ghana)
> HND Statistics (Ghana)
> Chief Executive Officer
> Statistics and Analytics Consultancy Services Ltd.
> Skype: jascall12
> Mobile: +447417589148.
> 	[[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

More information about the R-sig-Geo mailing list