def set_coupl_old(self):
        """ Using the adjacency matrix, sample a coupling matrix.
        """
        if self.model == 'krumsiek11' or self.model == 'var':
            # we already built the coupling matrix in set_coupl20()
            return
        self.Coupl = np.zeros((self.dim,self.dim))
        for i in range(self.Adj.shape[0]):
            for j,a in enumerate(self.Adj[i]):
                # if there is a 1 in Adj, specify co and antiregulation
                # and strength of regulation
                if a != 0:
                    co_anti = np.random.randint(2)
                    # set a lower bound for the coupling parameters
                    # they ought not to be smaller than 0.1
                    # and not be larger than 0.4
                    self.Coupl[i,j] = 0.0*np.random.rand() + 0.1
                    # set sign for coupling
                    if co_anti == 1:
                        self.Coupl[i,j] *= -1
        # enforce certain requirements on models
        if self.model == 1:
            self.coupl_model1()
        elif self.model == 5:
            self.coupl_model5()
        elif self.model in [6,7]:
            self.coupl_model6()
        elif self.model in [8,9,10]:
            self.coupl_model8()
        # output
        if self.verbosity > 1:
           settings.m(0,self.Coupl)
def set_coupl_old ( self ) : if self . model == 'krumsiek11' or self . model == 'var' : return self . Coupl = np . zeros ( ( self . dim , self . dim ) ) for i in range ( self . Adj . shape [ 0 ] ) : for j , a in enumerate ( self . Adj [ i ] ) : if a != 0 : co_anti = np . random . randint ( 2 ) self . Coupl [ i , j ] = 0.0 * np . random . rand ( ) + 0.1 if co_anti == 1 : self . Coupl [ i , j ] *= - 1 if self . model == 1 : self . coupl_model1 ( ) elif self . model == 5 : self . coupl_model5 ( ) elif self . model in [ 6 , 7 ] : self . coupl_model6 ( ) elif self . model in [ 8 , 9 , 10 ] : self . coupl_model8 ( ) if self . verbosity > 1 : settings . m ( 0 , self . Coupl )
Using the adjacency matrix, sample a coupling matrix.