(self, times,delta=0.001)
return path
times is an array of floats.
        The process needs the methods drift() and diffusion() defined.
times is an array of floats.
        The process needs the methods drift() and diffusion() defined.
times is an array of floats . The process needs the methods drift () and diffusion () defined .
def Euler_scheme(self, times,delta=0.001):
        """
        times is an array of floats.
        The process needs the methods drift() and diffusion() defined.
        """
        warnings.warn("Attn: starting an Euler scheme to approxmiate process.")
        
        Nor = stats.norm()
        finalTime = times[-1]
        steps = int(finalTime/delta)
        t = self.startTime
        x=self.startPosition
        path=[]
        j=0
        time = times[j]
        for i in xrange(steps):
            if t+delta>time>t:
                delta = time-t
                x += drift(x,t)*delta + np.sqrt(delta)*diffusion(x,t)*Nor.rvs()
                path.append((x,time))
                delta=0.001
                j+=1
                time = times[j]
            else:
                x += drift(x,t)*delta + np.sqrt(delta)*diffusion(x,t)*Nor.rvs()
                t += delta
            
        return path
def Euler_scheme ( self , times , delta = 0.001 ) : warnings . warn ( "Attn: starting an Euler scheme to approxmiate process." ) Nor = stats . norm ( ) finalTime = times [ - 1 ] steps = int ( finalTime / delta ) t = self . startTime x = self . startPosition path = [ ] j = 0 time = times [ j ] for i in xrange ( steps ) : if t + delta > time > t : delta = time - t x += drift ( x , t ) * delta + np . sqrt ( delta ) * diffusion ( x , t ) * Nor . rvs ( ) path . append ( ( x , time ) ) delta = 0.001 j += 1 time = times [ j ] else : x += drift ( x , t ) * delta + np . sqrt ( delta ) * diffusion ( x , t ) * Nor . rvs ( ) t += delta return path