I noticed that the
competence() method returns
Competence.INCOMPATIBLE for continous random variables, as in this snippet:
@staticmethod def competence(var): if var.dtype in pm.discrete_types: return Competence.COMPATIBLE return Competence.INCOMPATIBLE
slice step methods has:
@staticmethod def competence(var): if var.dtype in continuous_types: if not var.shape: return Competence.PREFERRED return Competence.COMPATIBLE return Competence.INCOMPATIBLE
INCOMPATIBLE unless the type is continuous, while the slice sampler is supposed to work with discrete random variables too.
Is it a problem if we use
metropolis to update continous random variables or
slice to update discrete random variables? I’d say no, as, e.g.,
metropolis has been suggested in many contexts (as in theano_op user defined random variables). But, how safe is that? Did I get something wrong?