krige                 package:gstat                 R Documentation

_S_i_m_p_l_e, _O_r_d_i_n_a_r_y _o_r _U_n_i_v_e_r_s_a_l, _g_l_o_b_a_l _o_r _l_o_c_a_l, _P_o_i_n_t _o_r _B_l_o_c_k _K_r_i_g_i_n_g

_D_e_s_c_r_i_p_t_i_o_n:

     Function for simple, ordinary or universal kriging (sometimes
     called external drift kriging), kriging in a local neighbourhood,
     point kriging or kriging of block mean values (rectangular or
     irregular blocks), and conditional (Gaussian or indicator)
     simulation equivalents for all kriging varieties.

_U_s_a_g_e:

      krige(formula, locations, data, newdata, model, beta, nmax = Inf,
     nmin = 0, maxdist = Inf, block, nsim = 0, indicators = FALSE, 
     na.action = na.pass, ...) 

_A_r_g_u_m_e_n_t_s:

 formula: formula that defines the dependent variable as a linear model
          of independent variables; suppose the dependent variable has
          name 'z', for ordinary and simple kriging use the formula
          'z~1'; for simple kriging also define 'beta' (see below); for
          universal kriging, suppose 'z' is linearly dependent on 'x'
          and 'y', use the formula 'z~x+y'

locations: formula with only independent variables that define the
          spatial data locations (coordinates), e.g. '~x+y'; if 'data'
          is of class 'spatial.data.frame', this argument may be
          ignored, as it can be derived from the data 

    data: data frame; should contain the dependent variable,
          independent variables, and coordinates. 

 newdata: data frame with prediction/simulation locations; should 
          contain columns with the independent variables (if present)
          and the coordinates with names as defined in 'locations' 

   model: variogram model of dependent variable (or its residuals), 
          defined by a call to vgm or fit.variogram

    beta: only for simple kriging (and simulation based on simple
          kriging); vector with the trend coefficients (including
          intercept); if no independent variables are defined the model
          only contains an intercept and this should be the simple
          kriging mean 

    nmax: for local kriging: the number of nearest observations that
          should be used for a kriging prediction or simulation, where
          nearest is defined in terms of the space of the spatial
          locations. By default, all observations are used 

    nmin: for local kriging: if the number of nearest observations
          within distance 'maxdist' is less than 'nmin', a missing 
          value will be generated; see maxdist 

 maxdist: for local kriging: only observations within a distance of
          'maxdist' from the prediction location are used for
          prediction or simulation; if combined with 'nmax', both
          criteria apply 

   block: block size; a vector with 1, 2 or 3 values containing the
          size of a rectangular in x-, y- and z-dimension respectively
          (0 if not set), or a data frame with 1, 2 or 3 columns,
          containing the points that discretize the block in the x-, y-
          and z-dimension to define irregular blocks relative to (0,0)
          or (0,0,0)-see also the details  section of predict.gstat. By
          default, predictions or simulations  refer to the support of
          the data values. 

    nsim: integer; if set to a non-zero value, conditional simulation
          is used instead of kriging interpolation. For this,
          sequential Gaussian or indicator simulation is used
          (depending on the value of  'indicators'), following a single
          random path through the data.  

indicators: logical, only relevant if 'nsim' is non-zero; if TRUE, use
          indicator simulation; else use Gaussian simulation 

na.action: function determining what should be done with missing values
          in 'newdata'.  The default is to predict 'NA'.  Missing
          values  in coordinates and predictors are both dealt with. 

     ...: other arguments that will be passed to gstat

_D_e_t_a_i_l_s:

     This function is a simple wrapper function around gstat and
     predict.gstat for univariate kriging prediction and conditional
     simulation methods available in gstat. For multivariate prediction
     or simulation, or for other interpolation methods provided by
     gstat (such as inverse distance weighted interpolation or trend
     surface interpolation) use the functions gstat and predict.gstat
     directly.

     For further details, see predict.gstat.

_V_a_l_u_e:

     a data frame containing the coordinates of 'newdata', and columns
     of prediction and prediction variance (in case of kriging) or the
     'abs(nsim)' columns of the conditional Gaussian or indicator
     simulations

_N_o_t_e:

     Daniel G. Krige is a South African scientist who was a mining
     engineer when he first used generalised least squares prediction
     with spatial covariances in the 50's. George Matheron coined the
     term 'kriging' in the 60's for the action of doing this, although
     very similar approaches had been taken in the field of
     meteorology. Beside being Krige's name, I consider "krige" to be
     to "kriging" what "predict" is to "prediction".

_A_u_t_h_o_r(_s):

     Edzer J. Pebesma

_R_e_f_e_r_e_n_c_e_s:

     N.A.C. Cressie, 1993, Statistics for Spatial Data, Wiley. 

     <URL: http://www.gstat.org/>

     Pebesma, E.J., 2004. Multivariable geostatistics in S: the gstat
     package. Computers & Geosciences, 30: 683-691.

_S_e_e _A_l_s_o:

     gstat, predict.gstat

_E_x_a_m_p_l_e_s:

     data(meuse)
     data(meuse.grid)
     m <- vgm(.59, "Sph", 874, .04)
     # ordinary kriging:
     x <- krige(log(zinc)~1, ~x+y, model = m, data = meuse, newd = meuse.grid)
     levelplot(var1.pred~x+y, x, aspect = mapasp(x),
             main = "ordinary kriging predictions")
     levelplot(var1.var~x+y, x, aspect = mapasp(x),
             main = "ordinary kriging variance")
     # simple kriging:
     x <- krige(log(zinc)~1, ~x+y, model = m, data = meuse, newdata = meuse.grid, 
             beta=5.9)
     # residual variogram:
     m <- vgm(.4, "Sph", 954, .06)
     # universal block kriging:
     x <- krige(log(zinc)~x+y, ~x+y, model = m, data = meuse, newdata = 
             meuse.grid, block = c(40,40))
     levelplot(var1.pred~x+y, x, aspect = mapasp(x),
             main = "universal kriging predictions")
     levelplot(var1.var~x+y, x, aspect = mapasp(x),
             main = "universal kriging variance")

