Related to this question, but adding a nugget isn't helping. Possibly I'm just making a silly coding mistake:
x <- cbind(runif(5),runif(5))
d <- dist(x)
k <- exp(-d^2)
chol(k)
# Error in chol.default(k) :
# the leading minor of order 1 is not positive definite
Adding a nugget doesn't help:
k <- as.matrix(k)
diag(k) <- diag(k) + 0.1
chol(k)
# Error in chol.default(k) :
# the leading minor of order 1 is not positive definite
What am I doing wrong here with my squared exponential kernel so that it isn't positive definite?
k <- exp(-as.matrix(d)^2)
might help $\endgroup$