(self,times)
mu must be less than 0. This process has absorption at L=0. It simulates the absorption at 0 at some random time, tao, and creates a bridge process.
mu must be less than 0. This process has absorption at L=0. It simulates the absorption at 0 at some random time, tao, and creates a bridge process.
mu must be less than 0 . This process has absorption at L = 0 . It simulates the absorption at 0 at some random time tao and creates a bridge process .
def generate_sample_FHT_bridge(self,times):
        "mu must be less than 0. This process has absorption at L=0. It simulates the absorption at 0 at some random time, tao, and creates a bridge process."
        if self.mu>0:
            print "mu must be less than 0. It is currently %f."%self.mu
        else:
            X=self.startPosition
            t=self.t_0
            path=[]
            FHT=self.startPosition/(2*self.Gamma.rvs(abs(self.mu)))
            for time in times:
                if time<FHT:
                    d=(FHT-t)*(time-t)
                    Y=self.Poi.rvs(X*(FHT-time)/(2*d))
                    X=self.Gamma.rvs(Y-self.mu+1)*d/(FHT-t)
                else:
                    X=0
                t=time
                path.append((t,X))
            return  [(p[0],self.rescalePath(p[1])) for p in path]
def generate_sample_FHT_bridge ( self , times ) : if self . mu > 0 : print "mu must be less than 0. It is currently %f." % self . mu else : X = self . startPosition t = self . t_0 path = [ ] FHT = self . startPosition / ( 2 * self . Gamma . rvs ( abs ( self . mu ) ) ) for time in times : if time < FHT : d = ( FHT - t ) * ( time - t ) Y = self . Poi . rvs ( X * ( FHT - time ) / ( 2 * d ) ) X = self . Gamma . rvs ( Y - self . mu + 1 ) * d / ( FHT - t ) else : X = 0 t = time path . append ( ( t , X ) ) return [ ( p [ 0 ] , self . rescalePath ( p [ 1 ] ) ) for p in path ]