Sorry for the super late reply. It looks like your example should work… if ls is super small and myVariable is equispaced, like np.linspace(0, 10, 100) or something, you’ll get the identity matrix.
This worked for me:
import pymc as pm
import numpy as np
with pm.Model() as model:
ls = pm.Gamma("ls", mu=10, sigma=1)
cov = pm.gp.cov.Exponential(1, ls=ls)
X = np.arange(100)[:, None]
K = pm.Deterministic("K", cov(X))
tr = pm.sample()