title: Custom likelihood in pymc3
body: <p>How can I define a custom likelihood in PyMC3? In PyMC2, I could use <code>@pymc.potential</code>. I tried to use <code>pymc.Potential</code> in PyMC3, however, it seems that boolean operations cannot be applied to the parameters (I get an error like <a href="https://github.com/Theano/Theano/issues/1581" rel="noreferrer">this</a> when I do that). For example, following code does not work:</p>
  
  <pre><code>from pymc import *
  
  with Model() as model:
      x = Normal('x', 1, 1)
  
      def z(u):
          if u &gt; 0: #comparisons like this are not supported
          # if theano.tensor.lt(0,u): this is how comparison should be done
              return u ** 2
          return -u**3
  
      x2 = Potential('x2', z(x))
  
      start = model.test_point
      h = find_hessian(start)
      step = Metropolis(model.vars, h)
      sample(100, step, start)
  </code></pre>
  
  <p>It's not possible for me to change all the comparisons inside the likelihood to the Theano syntax (i.e., theano.tensor.{lt,le,eq,neq,gt,ge}). Is there anyway to use define a likelihood function similar to PyMC2?</p>