Kernel R6 class
Kernel R6 class
Format
R6Class object.
Value
Object of R6Class with methods for fitting GP model.
Super class
GauPro::GauPro_kernel -> GauPro_kernel_IgnoreInds
Public fields
DNumber of input dimensions of data
kernelKernel to use on indices that aren't ignored
ignoreindsIndices to ignore. For a matrix X, these are the columns to ignore. For example, when those dimensions will be given a different kernel, such as for factors.
Methods
Inherited methods
Examples
kg <- Gaussian$new(D=3)
kig <- GauPro::IgnoreIndsKernel$new(k = Gaussian$new(D=3), ignoreinds = 2)
Xtmp <- as.matrix(expand.grid(1:2, 1:2, 1:2))
cbind(Xtmp, kig$k(Xtmp))
#> Var1 Var2 Var3
#> [1,] 1 1 1 1.0000000 0.3678794 1.0000000 0.3678794 0.3678794 0.1353353
#> [2,] 2 1 1 0.3678794 1.0000000 0.3678794 1.0000000 0.1353353 0.3678794
#> [3,] 1 2 1 1.0000000 0.3678794 1.0000000 0.3678794 0.3678794 0.1353353
#> [4,] 2 2 1 0.3678794 1.0000000 0.3678794 1.0000000 0.1353353 0.3678794
#> [5,] 1 1 2 0.3678794 0.1353353 0.3678794 0.1353353 1.0000000 0.3678794
#> [6,] 2 1 2 0.1353353 0.3678794 0.1353353 0.3678794 0.3678794 1.0000000
#> [7,] 1 2 2 0.3678794 0.1353353 0.3678794 0.1353353 1.0000000 0.3678794
#> [8,] 2 2 2 0.1353353 0.3678794 0.1353353 0.3678794 0.3678794 1.0000000
#>
#> [1,] 0.3678794 0.1353353
#> [2,] 0.1353353 0.3678794
#> [3,] 0.3678794 0.1353353
#> [4,] 0.1353353 0.3678794
#> [5,] 1.0000000 0.3678794
#> [6,] 0.3678794 1.0000000
#> [7,] 1.0000000 0.3678794
#> [8,] 0.3678794 1.0000000
cbind(Xtmp, kg$k(Xtmp))
#> Var1 Var2 Var3
#> [1,] 1 1 1 1.00000000 0.36787944 0.36787944 0.13533528 0.36787944
#> [2,] 2 1 1 0.36787944 1.00000000 0.13533528 0.36787944 0.13533528
#> [3,] 1 2 1 0.36787944 0.13533528 1.00000000 0.36787944 0.13533528
#> [4,] 2 2 1 0.13533528 0.36787944 0.36787944 1.00000000 0.04978707
#> [5,] 1 1 2 0.36787944 0.13533528 0.13533528 0.04978707 1.00000000
#> [6,] 2 1 2 0.13533528 0.36787944 0.04978707 0.13533528 0.36787944
#> [7,] 1 2 2 0.13533528 0.04978707 0.36787944 0.13533528 0.36787944
#> [8,] 2 2 2 0.04978707 0.13533528 0.13533528 0.36787944 0.13533528
#>
#> [1,] 0.13533528 0.13533528 0.04978707
#> [2,] 0.36787944 0.04978707 0.13533528
#> [3,] 0.04978707 0.36787944 0.13533528
#> [4,] 0.13533528 0.13533528 0.36787944
#> [5,] 0.36787944 0.36787944 0.13533528
#> [6,] 1.00000000 0.13533528 0.36787944
#> [7,] 0.13533528 1.00000000 0.36787944
#> [8,] 0.36787944 0.36787944 1.00000000