Thanks for your answer! I am using a variation on Levenshtein’s distance, so I’m not sure this is implementable in Stan, or that it would sample in reasonable time.
This won’t work, distance is defined implicitly in C++ for each covariance function.
I don’t quite understand why I can’t pass the x[i] - x[j] precomputed as data to the model? This is the bit I compute outside.