Initialize a coregionalization kernel from the data
Source:R/kernel-coregionalization.R
initialize_coregionalization.RdBuilds a coregionalization_kernel() whose \(B\) is the empirical
covariance between the outputs, a starting point from which optimization
can move \(W\).
Arguments
- output
Output index of each observation, from 1 to
n_outputs.- y
Numeric response of each observation.
- x
Optional inputs of each observation, a vector or matrix without the output-index column. Covariances between two outputs are estimated from the inputs at which both are observed; without
x, or with fewer than three shared inputs, they start at zero.- rank
Rank \(R\) of \(W\).
- n_outputs
Number of outputs; by default the largest index in
output.
Details
The empirical covariance \(\hat B\) of the centred responses is made positive semidefinite by setting negative eigenvalues to zero. \(W\) is taken from its leading \(R\) eigenvectors, scaled by the square roots of their eigenvalues, and \(\kappa\) from what remains on the diagonal, with at least 5% of each output's variance. The empirical variances include the observation noise, so \(B\) starts too large on the diagonal; optimization corrects that.
Stability
Experimental: this interface may change in a minor release, and every change is listed in NEWS. See gaussianprocesses-package for the policy.
Examples
set.seed(1)
x <- seq(0, 5, length.out = 20)
y <- cbind(sin(x), 2 * sin(x) + 0.1) + rnorm(40, sd = 0.1)
stacked <- gp_stack_outputs(x, y)
kernel <- initialize_coregionalization(stacked$output, stacked$y,
x = stacked$x[, 1])
coregionalization_matrix(kernel)
#> [[1]]
#> [,1] [,2]
#> [1,] 0.5452383 1.029026
#> [2,] 1.0290260 2.209153
#>