dhsic.test returning different p-values? I am using dhsic.test in R, and I have this doubt:
For this example of clearly uncorrelated data I get different p-values:
ug=matrix(nrow=N,c(0.5,0,0,0.5))
r=mvrnorm(n=500,rep(0,N),ug)
dhsic.test(split(r,col(r)))$p.value

if I rerun just the last line (only the test) I get different values like .44, .37 ,.36
Shouldn't I get always the same p-value?
 A: Your code does not run - you are missing the packages and the value of N - but the underlying reason is that the test (at least using the permutation or bootstrap methods and possibly eigenvalue, where permutation is the default) takes a Monte-Carlo approach.  So if you want identical results from repeated tests of the same data using the same method then you need to use an explicit seed each time.
Here is some R code to illustrate your point and mine. The arbitrary seed of 2020 should make your machine produce the same numbers as mine, while the arbitrary but repeated seeds of 1 produce the same answers for repeated use of the same method:
set.seed(2020)
library(dHSIC)
library(MASS)
N = 2
ug = matrix(nrow=N, c(0.5,0,0,0.5))
r = mvrnorm(n=500, rep(0,N), ug)
dhsic.test(split(r,col(r)))$p.value
# 0.1208791
dhsic.test(split(r,col(r)))$p.value
# 0.1348651
dhsic.test(split(r,col(r)), method="gamma")$p.value
# 0.1352237
dhsic.test(split(r,col(r)), method="gamma")$p.value
# 0.1352237
dhsic.test(split(r,col(r)), method="permutation")$p.value
# 0.1348651
dhsic.test(split(r,col(r)), method="permutation")$p.value
# 0.1298701
dhsic.test(split(r,col(r)), method="bootstrap")$p.value
# 0.1128871
dhsic.test(split(r,col(r)), method="bootstrap")$p.value
# 0.1398601
dhsic.test(split(r,col(r)), method="eigenvalue")$p.value
# 0.1214
dhsic.test(split(r,col(r)), method="eigenvalue")$p.value
# 0.1244
set.seed(1)
dhsic.test(split(r,col(r)))$p.value
# 0.1258741
set.seed(1)
dhsic.test(split(r,col(r)))$p.value
# 0.1258741
set.seed(1)
dhsic.test(split(r,col(r)), method="gamma")$p.value
# 0.1352237
set.seed(1)
dhsic.test(split(r,col(r)), method="gamma")$p.value
# 0.1352237
set.seed(1)
dhsic.test(split(r,col(r)), method="permutation")$p.value
# 0.1258741
set.seed(1)
dhsic.test(split(r,col(r)), method="permutation")$p.value
# 0.1258741
set.seed(1)
dhsic.test(split(r,col(r)), method="bootstrap")$p.value
# 0.1178821
set.seed(1)
dhsic.test(split(r,col(r)), method="bootstrap")$p.value
# 0.1178821
set.seed(1)
dhsic.test(split(r,col(r)), method="eigenvalue")$p.value
# 0.1268
set.seed(1)
dhsic.test(split(r,col(r)), method="eigenvalue")$p.value
# 0.1268

