# covMat1Mat2

##### Cross covariance matrix

Computes the cross covariance matrix between two sets of locations for a spatial random process with a given covariance structure. Typically the two sets are a learning set and a test set.

- Keywords
- models

##### Usage

`covMat1Mat2(object, X1, X2, nugget.flag=FALSE)`

##### Arguments

- object
an object specifying the covariance structure.

- X1
a matrix whose rows represent the locations of a first set (for instance a set of learning points).

- X2
a matrix whose rows represent the locations of a second set (for instance a set of test points).

- nugget.flag
an optional boolean. If

`TRUE`

, the covariance between 2 equal locations takes into account the nugget effect (if any). Locations are considered equal if their euclidian distance is inferior to`1e-15`

. Default is`FALSE`

.

##### Value

a matrix of size `(nb of rows of X1 * nb of rows of X2)`

whose element `(i1,i2)`

is equal to the covariance between the locations specified by row `i1`

of `X1`

and row `i2`

of `X2`

.

##### See Also

*Documentation reproduced from package DiceKriging, version 1.5.6, License: GPL-2 | GPL-3*