[R-sig-Geo] problem in krige function

Edzer J. Pebesma e.pebesma at geo.uu.nl
Fri Apr 6 09:29:19 CEST 2007


temiz wrote:
> ...
> I regarded some modifications in 
> http://grass.gdf-hannover.de/wiki/GRASS_6_Tutorial#GRASS_and_R_kriging_interpolation
>
> I encountered a new problem :
>  > OK_pred <- krige(z ~ 1, el3, newdata=mask_SG, model=efitted)
> [using ordinary kriging]
>
> "memory.c", line 57: can't allocate memory in function m_get()
> Error in predict.gstat(g, newdata = newdata, block = block, nsim = nsim,  :
>         m_get
>
>
>
> Why does this problem arise ?
>
> I selected a great deal smaller area in R than I did in grass and 
> carried out with spline tension without any problem.
>
> is the data too dense or grid size too small ?
>
>   
Hard to tell without knowing the dimensions from el3 and mask_SG. 
Kriging involves solving a system as large as the full covariance matrix 
of the data, if you don't constrain it to looking at local search 
neighbourhoods only. So, if el3 has 10.000 points, you're trying to form 
a covariance matrix of 800 Mb.

I'd suggest you look into setting the nmax or maxdist arguments to 
krige() if this seems the case.

And yes, if mask_SG is massively large, than that may be the cause and 
you may want to split up the problem in a batch of smaller ones.
--
Edzer




More information about the R-sig-Geo mailing list