ValueError: Domain error in arguments scipy rv_continuous
问题 I was trying to sample random variables subject to a given probability density function (pdf) with scipy.stats.rv_continuous: class Distribution(stats.rv_continuous): def _pdf(self,x, _a, _c): return first_hitting_time(x, _a, _c) where the function first_hitting_time is #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) then I continue with myrv= Distribution(name='hittingtime', a=0.002,b=30.0)