Dear Edzer,
Thanks for the guide. I tried to use option nmax=100 and it works
perfectly. This implies I am using local interpolation of 100 observations
to predict a value at unknown locations rather than global interpolation
approach. I think this is better considering large size of my observation.

Now, I find the range of projected spatial coordinates (easting and
northing) in meters for each year data from the same field. I intend to
probably consider the interpolation grid of 10 meters spacing for each
data. Does it make sense? I wish to look at the correlation of predicted
yield value among the years obtain from ordinary kriging in other to assess
the stability of the spatial pattern quantitatively.
Since the spatial location of each yield value varies from one year to the
other, I thought of using the interpolation value from block ordinary
kriging rather than point ordinary
kriging. Please advise me on this. If I am to use block ordinary kriging,
how do I modify my script below?

The table below shows how the spatial coordinates vary from one year to
others in meters within the same production field.




*Easting range (meter)*

*Northing range (meter)*

years

*Min*

*Max*

*Min*

*Max*

2008

299,678

301,298

5,737,285

5,738,128

2009

299,678

301,299

5,737,278

5,738,129

2010

299,678

301,298

5,737,279

5,738,128

2011

299,679

301,298

5,737,279

5,738,123



My R script for obtaining the prediction value on interpolation grid is as
follows
### Create grid for the interpolation (prediction) through ordinary kriging

## get the range of spatial coordinates in the data
easting.range <- as.integer(range(canmod.sp@coords[,1]))
northing.range <-as.integer(range(canmod.sp@coords[,2]))

## now expand to a grid with 10 meter spacing:
grd <- expand.grid(x=seq(from=easting.range[1], to=easting.range[2], by=10),
                   y=seq(from=northing.range[1], to=northing.range[2],
by=10))

names(grd)<-c("easting","northing")

#### Ordinary kriging to create kriging prediction object

pred_ok <- krige(id="yield",yield ~ 1,locations=~easting+northing,
model=exp.mod,data=canocrop, newdata=grd,nmax=100)


Thanks for the support and understanding while looking forward to reading
your response, please.

Moshood














On Fri, Feb 28, 2014 at 1:25 PM, Edzer Pebesma <
edzer.pebesma@uni-muenster.de> wrote:

>
>
> On 02/28/2014 08:29 PM, Moshood Agba Bakare wrote:
> > Dear All,
> >
> > The R script below is to generate interpolation grid for prediction using
> > ordinary kriging. I encountered error message " R  encountered a fatal
> > error, the session was terminated". This is as a result of large
> obervation
> > I have 116,818.  I have no problem in fitting my variogram model with
> this
> > large observation using GSTAT but encountered error  message above during
> > interpolation using ordinary kriging.When I used few observations, the
> > script ran successfully. Please advise me on how to rectify this problem.
> > Does it mean we can use the entire observations for prediction?
> >
>
> Possibly, we'd need more information to be sure. You can set nmax = 100
> (or any other value) to constrain the number of nearest observation used
> for prediction.
>
> >
> > This is my script
> >
> > ### Create grid for the interpolation (prediction) through ordinary
> kriging
> >
> > easting.range <- as.integer(range(canmod.sp@coords[,1]))
> > northing.range <-as.integer(range(canmod.sp@coords[,2]))
> >
> > ## now expand to a grid with 100 meter spacing:
> > grd <- expand.grid(x=seq(from=easting.range[1], to=easting.range[2],
> > by=100),
> >                    y=seq(from=northing.range[1], to=northing.range[2],
> > by=100))
> > names(grd)<-c("easting","northing")
> >
> > coordinates(grd)<-~easting+northing
> > proj4string(grd)<-CRS("+proj=utm +zone=12 +ellps=WGS84 +datum=WGS84
> > +units=m +no_defs +towgs84=0,0,0")
> > Pred_ok <- krige(id="yield",yield ~ 1, canmod.sp, newdata = grd,
> > model=exp.mod)
> >
> >
> > Thanks while looking forward to reading your response please.
> >
> > Moshood
> >
>
> --
> Edzer Pebesma
> Institute for Geoinformatics (ifgi), University of Münster
> Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
> 83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795
>
>

	[[alternative HTML version deleted]]

