Examples of random() in custom distribution?

The logp function must be defined with Pytensor operations instead of calls to Numpy or Scipy

You can use pm.logp(pm.StudentT.dist(...), value) and pm.logcdf to obtain PyTensor expressions of the logp and logcdf for use in your logp function.