Learn R Programming

FeedbackTS (version 1.2)

krige: Kriging function

Description

Variogram analysis and kriging prediction used to analyze feedback and change-in-feedback across space.

Usage

krige(coordinates, statistic, variog.param, grid, krige.param, plots = TRUE)

Arguments

coordinates
a 2-column matrix with latitudes and longitudes of observation sites.
statistic
a numeric vector specifying the values, at observation sites, of the statistic to be predicted.
variog.param
a list of arguments used to fit the semivariogram to data, some of these arguments being input of the function variofit in the geoR package: [object Object],[object Object],[object Object],[object Object],[object Object],[object

Value

  • a list of items characterizing the variogram analysis and the kriging prediction:
  • inputthe list of arguments in the call of the krige function except the argument plots.
  • MAPa list allowing to draw the border of the study region that can be made of several polygons. This is the output of the function map in the maps package.
  • grida 2-column matrix providing the coordinates (in degrees) of the nodes of the prediction locations.
  • in.regiona logical vector indicating, for each grid node whose coordinates are given in the 2-column matrix grid, if the node is in the study region or not. The study region is defined by MAP.
  • variofit.wlsa list providing the result of the weighted-least-square estimation of the semivariogram parameters. This is the output of the function variofit in the geoR package.
  • krigea list providing the result of the spatial prediction for fixed covariance parameters given by variofit.wls. This is the output of the function krige.conv in the geoR package.

item

  • grid
  • krige.param
  • plots

describe

  • type.krige:a character string specifying the type of kriging to be performed. Options are "SK" and "OK" corresponding to simple or ordinary kriging. Kriging with external trend and universal kriging can be defined setting type.krige = "OK" and specifying the trend model using the arguments trend.d.
  • trend.d:a character string specifying the trend (covariate) values at the data locations.

code

plots = FALSE

Details

If plots = TRUE, six plots are produced. Plot 1: Estimation of the semivariogram of the statistic using the weighted least squares method (dots: sample semivariogram; curve: theoretical semivariogram -- exponential covariance function with nugget effect). Plot 2: Assessment of the existence of a spatial structure based on a Monte-Carlo test. Plot 3: Assessment of the confidence envelopes of the semivariogram. Plot 4: Boxplots of kriging prediction (left) and kriging standard error (right). Plot 5: Kriging prediction. Plot 6: Kriging standard error.

References

Soubeyrand, S., Morris, C. E. and Bigg, E. K. (in press). Analysis of fragmented time directionality in time series to elucidate feedbacks in climate data. Environmental Modelling and Software.

See Also

rain.feedback.stats, map in the maps package, variofit.wls and krige.conv in the geoR package

Examples

Run this code
#### load data of feedback and change-in-feedback indices in 88 sites across Australia
data(rain.feedback.stats)

#### spatial coordinates of the 88 sites
coord=rain.feedback.stats[,3:4]

#### feedback index
stat1=rain.feedback.stats[["Feedback.whole.period"]]

#### variogram analysis and kriging of feedback index
par(mfrow=c(2,3), mar=c(5.1,4.1,4.1,4.1))
kr1=krige(coordinates=coord, statistic=stat1,
   grid=list(x=seq(110,155,0.25),y=seq(-45,-11,0.25),border="Australia", 
      proj="+proj=lcc +lat_1=-18 +lat_2=-36 +lat0=-25 +lon_0=140",degrees=TRUE),
   variog.param=list(keep.distance=2/3,nb.bin=15,cov.pars=c(0.0008,10^6),
      nugget=0.0001,fix.nugget=FALSE,coordinates.scaling=10^5,statistic.scaling=0.01),
   krige.param=list(type.krige="ok",trend.d="1st"),plots=TRUE)

Run the code above in your browser using DataLab