Skip to contents

Positive semidefiniteness is closed under the operations used here: sums, products and any input warping k(u(x), u(x')). That closure is the whole reason a grammar over kernels is well posed, so the smallest eigenvalue of every returned Gram matrix is reported and the tests check it is non-negative.

Usage

Gpkern(X, Y = NULL, kernel_spec = NULL)

Arguments

X

Input matrix, one row per point.

Y

Optional second input matrix; X by default.

kernel_spec

List with op ("sum" or "prod") and parts, a list of lists with type ("rbf" or "warp"), lengthscale and variance.

Value

List with estimate, K, diagonal, min_eigenvalue, is_psd, n, method.

Details

Formula: k_sum = sum_i k_i; k_prod = prod_i k_i; k_warp = k(u(x), u(x')) with u(x) = (sin x, cos x).

References

Duvenaud, Lloyd, Grosse, Tenenbaum and Ghahramani (2013), Structure discovery in nonparametric regression through compositional kernel search, ICML 2013, PMLR 28(3):1166-1174, arXiv:1302.4922; Rasmussen and Williams (2006), Gaussian Processes for Machine Learning, MIT Press, sect. 4.2.4.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Gpkern(V)
#> $estimate
#> [1] 1
#> 
#> $K
#>              [,1]         [,2]         [,3]         [,4]         [,5]
#> [1,] 1.000000e+00 6.065307e-01 1.353353e-01 0.0111089965 0.0003354626
#> [2,] 6.065307e-01 1.000000e+00 6.065307e-01 0.1353352832 0.0111089965
#> [3,] 1.353353e-01 6.065307e-01 1.000000e+00 0.6065306597 0.1353352832
#> [4,] 1.110900e-02 1.353353e-01 6.065307e-01 1.0000000000 0.6065306597
#> [5,] 3.354626e-04 1.110900e-02 1.353353e-01 0.6065306597 1.0000000000
#> [6,] 3.726653e-06 3.354626e-04 1.110900e-02 0.1353352832 0.6065306597
#> [7,] 1.522998e-08 3.726653e-06 3.354626e-04 0.0111089965 0.1353352832
#> [8,] 2.289735e-11 1.522998e-08 3.726653e-06 0.0003354626 0.0111089965
#>              [,6]         [,7]         [,8]
#> [1,] 3.726653e-06 1.522998e-08 2.289735e-11
#> [2,] 3.354626e-04 3.726653e-06 1.522998e-08
#> [3,] 1.110900e-02 3.354626e-04 3.726653e-06
#> [4,] 1.353353e-01 1.110900e-02 3.354626e-04
#> [5,] 6.065307e-01 1.353353e-01 1.110900e-02
#> [6,] 1.000000e+00 6.065307e-01 1.353353e-01
#> [7,] 6.065307e-01 1.000000e+00 6.065307e-01
#> [8,] 1.353353e-01 6.065307e-01 1.000000e+00
#> 
#> $diagonal
#> [1] 1 1 1 1 1 1 1 1
#> 
#> $min_eigenvalue
#> [1] 0.06042086
#> 
#> $is_psd
#> [1] 1
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "sum/product/warp composition of RBF kernels, Duvenaud et al. (2013); Rasmussen & Williams (2006) sect. 4.2.4"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"