Skip to contents

Returns \(B = W W^\top + \operatorname{diag}(\kappa)\) for every coregionalization kernel in a kernel, such as the fitted kernel of a multi-output model.

Usage

coregionalization_matrix(kernel)

Arguments

kernel

A kernel specification.

Value

A named list with one \(P \times P\) matrix per coregionalization kernel, named by its parameter path ("" for a coregionalization kernel itself).

Details

\(B\) is identified, while \(W\) is not: \(W Q\) gives the same \(B\) for any orthogonal \(Q\). In an ICM term \(B \otimes k\), the scale of \(B\) also trades off with the variance of the input kernel \(k\); the correlations stats::cov2cor(B) do not.

Stability

Experimental: this interface may change in a minor release, and every change is listed in NEWS. See gaussianprocesses-package for the policy.

Examples

kernel <- sum_kernel(
  product_kernel(
    select_dimensions(rbf_kernel(), 1),
    select_dimensions(coregionalization_kernel(2, W = c(1, 1)), 2)
  ),
  select_dimensions(coregionalization_kernel(2, kappa = c(0.5, 2)), 2)
)
coregionalization_matrix(kernel)
#> $kernel1.kernel2
#>      [,1] [,2]
#> [1,]    2    1
#> [2,]    1    2
#> 
#> $kernel2
#>      [,1] [,2]
#> [1,]  0.5    0
#> [2,]  0.0    2
#>