swh:1:snp:d1587d616651317fdcebcbb237dce82c32266449
Raw File
Tip revision: dfe6577bb164f53feaedf2da9530457197edfb1a authored by Georgi N. Boshnakov on 20 October 2022, 11:25:10 UTC
version 4021.93
Tip revision: dfe6577
stats-interpKrige.Rd
\name{krigeInterp}
\title{Bivariate Krige Interpolation}
\alias{krigeInterp}
\description{
    Bivariate Krige Interpolation.
}
\usage{
krigeInterp(x, y = NULL, z = NULL, gridPoints = 21,
    xo = seq(min(x), max(x), length = gridPoints),
    yo = seq(min(y), max(y), length = gridPoints),
    extrap = FALSE, polDegree = 6)
}

\arguments{
    \item{x, y, z}{
        the arguments \code{x} and \code{y} are
        two numeric vectors of grid pounts, and \code{z} is a numeric
        matrix or any other rectangular object which can be transformed
        by the function \code{as.matrix} into a matrix object.
        }
    \item{gridPoints}{
        an integer value specifying the number of grid points in \code{x}
        and \code{y} direction.
        }
    \item{xo, yo}{
        two numeric vectors of data points spanning the grid.
        }
    \item{extrap}{
        a logical, if \code{TRUE} then the data points are extrapolated.
        }
    \item{polDegree}{
        the polynomial krige degree, an integer ranging between 1 and 6.
        }
}
\note{
    The function \code{krigeInterp()} requires the \R package
    \pkg{spatial}.
}
\value{
    \code{krigeInterp}
    returns a list with at least three entries, \code{x}, \code{y}
    and \code{z}. Note, that the returned values, can be directly
    used by the  \code{\link{persp}} and \code{\link{contour}} 3D
    plotting methods.
}
\seealso{
    \code{\link{akimaInterp}},
    \code{\link{linearInterp}}.
}
\examples{\donttest{
## The akima library is not auto-installed because of a different licence.
## krigeInterp -  Kriging:
set.seed(1953)
x = runif(999) - 0.5
y = runif(999) - 0.5
z = cos(2*pi*(x^2+y^2))
ans = krigeInterp(x, y, z, extrap = FALSE)
persp(ans, theta = -40, phi = 30, col = "steelblue",
    xlab = "x", ylab = "y", zlab = "z")
contour(ans)
}
}
\keyword{programming}

back to top