Revision da8174e204c4b3c8aff0fa179a0b53656129ef8e authored by Martin Schlather on 01 March 2004, 00:00:00 UTC, committed by Gabor Csardi on 01 March 2004, 00:00:00 UTC
1 parent 3e1677b
Kriging.Rd
\name{Kriging}
\alias{Kriging}
\title{Kriging methods}
\description{
The function allows for different methods of kriging.
}
\usage{
Kriging(krige.method, x, y=NULL, z=NULL, T=NULL, grid,
gridtriple=FALSE, model, param, given, data, trend, pch=".")
}
%- maybe also usage' for other objects documented here.
\arguments{
\item{krige.method}{kriging method; currently only 'S' (simple
kriging) and 'O' (ordinary kriging) implemented.}
\item{x}{\eqn{(n \times d)}{(n x d)} matrix or vector of \code{x}
coordinates; coordinates of \eqn{n} points to be kriged}
\item{y}{vector of \code{y} coordinates.}
\item{z}{vector of \code{z} coordinates.}
\item{T}{vector in grid triple form for the time coordinates.}
\item{grid}{logical; determines whether the vectors \code{x},
\code{y}, and \code{z} should be
interpreted as a grid definition, see Details.}
\item{gridtriple}{logical.  Only relevant if \code{grid==TRUE}.
If \code{gridtriple==TRUE}
then \code{x}, \code{y}, and \code{z} are of the
form \code{c(start,end,step)}; if
\code{gridtriple==FALSE} then \code{x}, \code{y}, and \code{z}
must be vectors of ascending values.
}
\item{model}{string; covariance model, see \code{\link{CovarianceFct}}, or
type \code{\link{PrintModelList}()} to get all options.}
\item{param}{parameter vector:
\code{param=c(mean, variance, nugget, scale,...)};
the parameters must be given
in this order.  Further parameters are to be added in case of a
parametrised class of covariance functions, see
The value of \code{mean} must be finite
in the case of simple kriging, and is ignored otherwise.}
\item{given}{matrix or vector of points where data are available.}
\item{data}{the data values given at \code{given}; it might be a
vector or a matrix. If a matrix is given multivariate data are
assumed which are kriged \emph{separately}.}
\item{trend}{not programmed yet (will be used in case of universal kriging)}
\item{pch}{Kriging procedures are quite time consuming in general.
The character \code{pch} is printed after roughly
each 80th part of calculation.}
}
\details{
\itemize{
\item \code{grid==FALSE} : the vectors \code{x}, \code{y},
and \code{z} are interpreted as vectors of coordinates
\item \code{(grid==TRUE) && (gridtriple==FALSE)} : the vectors
\code{x}, \code{y}, and \code{z}
are increasing sequences with identical lags for each sequence.
A corresponding
grid is created (as given by \code{expand.grid}).
\item \code{(grid==TRUE) && (gridtriple==FALSE)} : the vectors
\code{x}, \code{y}, and \code{z}
are triples of the form (start,end,step) defining a grid
(as given by \code{expand.grid(seq(x$start,x$end,x$step), seq(y$start,y$end,y$step),
seq(z$start,z$end,z\$step))})
}
}
\value{
\code{Kriging} returns a vector or matrix
of kriged values corresponding to the
specification of \code{x}, \code{y}, \code{z}, and
\code{grid}, and \code{data}.\cr

\code{data}: a vector or matrix with \emph{one} column\cr
* \code{grid==FALSE}.  A vector of simulated values is
returned (independent of the dimension of the random field)\cr
* \code{grid==TRUE}.  An array of the dimension of the
random field is returned (according to the specification
of \code{x}, \code{y}, and \code{z}).\cr

\code{data}: a matrix with \emph{at least two} columns\cr
* \code{grid==FALSE}.  A matrix with the \code{ncol(data)} columns
is returned.\cr
* \code{grid==TRUE}.  An array of dimension
\eqn{d+1}{d+1}, where \eqn{d}{d} is the dimension of
the random field, is returned (according to the specification
of \code{x}, \code{y}, and \code{z}).  The last
dimension contains the repetitions.
%}
}
\references{
Chiles, J.-P. and Delfiner, P. (1999)
\emph{Geostatistics. Modeling Spatial Uncertainty.}
New York: Wiley.

Cressie, N.A.C. (1993)
\emph{Statistics for Spatial Data.}
New York: Wiley.

Goovaerts, P. (1997) \emph{Geostatistics for Natural Resources
Evaluation.} New York: Oxford University Press.

Wackernagel, H. (1998) \emph{Multivariate Geostatistics.} Berlin:
Springer, 2nd edition.
}
\author{Martin Schlather, \email{martin.schlather@cu.lu}
\url{http://www.cu.lu/~schlathe}}
%\note{}

\seealso{
}

\examples{

## creating random variables first
## here, a grid is chosen, but does not matter
step <- 0.25
x <-  seq(0,7,step)
param <- c(0,1,0,1)
model <- "exponential"
RFparameters(PracticalRange=FALSE)
p <- 1:7
points <- as.matrix(expand.grid(p,p))
data <- GaussRF(points, grid=FALSE, model=model, param=param)

## visualise generated spatial data
zlim <- c(-2.6,2.6)
colour <- rainbow(100)
image(p, p, xlim=range(x), ylim=range(x),
matrix(data,ncol=length(p)),
col=colour,zlim=zlim)

## now: kriging
krige.method <- "O" ## ordinary kriging
z <-  Kriging(krige.method=krige.method,
x=x, y=x, grid=TRUE,
model=model, param=param,
given=points, data=data)
image(x,x,z,col=colour,zlim=zlim)
}
\keyword{spatial}%-- one or more ...

` Computing file changes ...
{"ft_lang_label":"__label__en","ft_lang_prob":0.5435355,"math_prob":0.99220395,"size":5124,"snap":"2023-40-2023-50","text_gpt3_token_len":1620,"char_repetition_ratio":0.13984375,"word_repetition_ratio":0.07704655,"special_character_ratio":0.2905933,"punctuation_ratio":0.18963832,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99929744,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-10-04T14:12:17Z\",\"WARC-Record-ID\":\"<urn:uuid:ae2c1743-7d12-4e0a-92d0-6fbc940d5718>\",\"Content-Length\":\"35656\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:68fa3ba9-74e3-46c0-85bd-e85bdbb63f6c>\",\"WARC-Concurrent-To\":\"<urn:uuid:692e7836-956c-489e-aae0-65e1d685055b>\",\"WARC-IP-Address\":\"128.93.166.15\",\"WARC-Target-URI\":\"https://archive.softwareheritage.org/browse/revision/da8174e204c4b3c8aff0fa179a0b53656129ef8e/?path=man/Kriging.Rd\",\"WARC-Payload-Digest\":\"sha1:XZJ2Q4CO4QWWDZI3ZSRJY6FEP2F3E4AH\",\"WARC-Block-Digest\":\"sha1:6Z2HKTCAD7EGEZWMBYNIZHYTGSSJWKXK\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233511369.62_warc_CC-MAIN-20231004120203-20231004150203-00044.warc.gz\"}"}