Learn R Programming

RandomFields (version 3.1.36)

RFlinearpart: Linear part of RMmodel

Description

RFlinearpart returns the linear part of a model

Usage

RFlinearpart(model, x, y = NULL, z = NULL, T = NULL, grid, data, distances, dim, set=0, ...)

Arguments

model
object of class RMmodel; the covariance or variogram model, which is to be evaluated
x
vector or $(n x \code{dim})$-matrix, where $n$ is the number of points at which the covariance function is to be evaluated; in particular, if the model is isotropic or dim=1 then x is a vector. x
y
second vector or matrix for non-stationary covariance functions
z
z-component of point if xyzT-specification of points is used
T
T-component of point if xyzT-specification of points is used
grid
boolean; whether xyzT specify a grid
data
vector or matrix of values measured at coord; If a matrix is given then the columns are interpreted as independent realisations. If also a time component is given, then in the data the indices for the spatial components run the fastest. If an m-variate model is used, then each realisation is given as m consecutive columns of data.
distances
vector; the lower triangular part of the distance matrix column-wise; equivalently the upper triangular part of the distance matrix row-wise; either x or distances must be missing
dim
dimension of the coordinate space in which the model is applied; only necesary for given distances
set
integer. See section Value for details.
...
for advanced further options and control arguments for the simulation that are passed to and processed by RFoptions

Value

RFlinearpart returns a list of three components, Y, X, vdim returning the deterministic trend, the design matrix, and the multivariability, respectively. If set is positive, Y and X contain the values for the set-th set of coordinates. Else, Y and X are both lists containing the values for all the sets.

See Also

Bayesian, RMmodel, RFsimulate, RFlikelihood.

Examples

Run this code
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again


x <- seq(0, pi, len=10)
trend <- 2 * sin(R.p(new="isotropic")) + 3
model <- RMexp(var=2, scale=1) + trend
print(RFlinearpart(model, x=x))  ## only a deterministic part

trend <- NA * sin(R.p(new="isotropic")) + NA + R.p(new="isotropic") / pi
model <- RMexp(var=NA, scale=NA) + trend
print(RFlinearpart(model, x=x))




Run the code above in your browser using DataLab