title: ValueError: Domain error in arguments scipy rv_continuous
body: <p>I was trying to sample random variables subject to a given probability density function (pdf) with scipy.stats.rv_continuous:</p>
  
  <pre><code>class Distribution(stats.rv_continuous):
      def _pdf(self,x, _a, _c):
          return first_hitting_time(x, _a, _c)
  </code></pre>
  
  <p>where the function <em>first_hitting_time</em> is</p>
  
  <pre><code>#pdf of first hitting time of W_t + c*t on a. 
  def first_hitting_time(_t, _a, _c=0.0):
      return _a/_t*np.exp(-0.5/_t*(_a-_c*_t)**2)/np.sqrt(2.0*np.pi*_t)
  </code></pre>
  
  <p>then I continue with</p>
  
  <pre><code>myrv= Distribution(name='hittingtime', a=0.002,b=30.0)
  data3= myrv.rvs(size=10000, _a=1.0, _c=0.0)
  </code></pre>
  
  <p>and interpreter starts to complain-</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-246-71f67047462b&gt;", line 1, in &lt;module&gt;
      data3= myrv.rvs(size=10000, _a=1.0, _c=0.0)
  
    File "C:\Users\ME\AppData\Local\Continuum\Anaconda2\lib\site-packages\scipy\stats\_distn_infrastructure.py", line 856, in rvs
      raise ValueError("Domain error in arguments.")
  
  ValueError: Domain error in arguments.
  </code></pre>
  
  <p>it seems if I set <code>_c</code> to be some number larger than 0.0, it works fine, but not for <code>_c</code> less than 0. </p>
  
  <p>I am a bit confused about this. Any help would be appreciated. </p>