# NOT RUN {
# }
# NOT RUN {
library(ggplot2)
library(boot)
# Test case : the non-monotonic Sobol g-function
# Only one kernel is provided with default hyperparameter value
n <- 100
X <- data.frame(matrix(runif(8 * n), nrow = n))
# HSIC-based GSA and asymptotic independence test
x <- sensiHSIC(model = sobol.fun, X, kernelX = "raquad", kernelY = "rbf",
nboot = 100, test.method = "Asymptotic")
print(x)
# HSIC-based GSA and permutation independence test
x <- sensiHSIC(model = sobol.fun, X, kernelX = "rbf", kernelY = "rbf",
estimator.type = "U-stat", test.method = "Permutation")
print(x)
# HSIC-based GSA and independence test with optimized number of permutations
x <- sensiHSIC(model = sobol.fun, X, kernelX = "raquad", kernelY = "rbf",
nboot = 100, test.method = "Seq_Permutation",
crit.option = list(stop.criterion = "ranking", alpha = 0.05, Bstart = 100, Bfinal = 3000,
Bbatch = 100, lo = 100))
print(x)
# HSIC-Target GSA in case of given model
x <- sensiHSIC(model = sobol.fun, X, target = list(c = 0.4, upper = TRUE, type = "indicTh",
param = 1), kernelX = "raquad", kernelY = "rbf",nboot = 100, test.method = "Permutation")
# HSIC-target GSA in case of given data
x <- sensiHSIC(model = NULL, X, target = list(c = 0.4, upper = TRUE, type = "indicTh", param = 1),
kernelX = "raquad", kernelY = "rbf",nboot = 100, test.method = "Permutation")
y <- sobol.fun(X)
tell(x,y)
# Test case : the Ishigami function
# A list of kernels is given with default hyperparameter value
n <- 100
X <- data.frame(matrix(-pi+2*pi*runif(3 * n), nrow = n))
x <- sensiHSIC(model = ishigami.fun, X, kernelX = c("rbf","matern3","dcov"),
kernelY = "rbf")
print(x)
ggplot(x)
# A combination of kernels is given and a dummy value is passed for
# the first hyperparameter
x <- sensiHSIC(model = ishigami.fun, X, kernelX = c("ssanova1","matern3","dcov"),
paramX = c(1,2,1), kernelY = "ssanova1")
print(x)
ggplot(x)
# Example in case of given data
n <- 100
X <- data.frame(matrix(-pi+2*pi*runif(3 * n), nrow = n))
Y <- ishigami.fun(X)
x <- sensiHSIC(model = NULL, X)
tell(x,Y)
print(x)
ggplot(x)
# }
Run the code above in your browser using DataLab