(self, maxOrder=None, assumption="paths")
return int(dof)
Calculates the degrees of freedom of the model based on
        different assumptions, and taking into account layers up to
        a maximum order.

        @param: maxOrder: the maximum order up to which model layers shall be
            taken into account

        @param assumption: if set to 'paths', for the degree of freedom calculation
            only paths in the first-order network topology will be considered. This is
            needed whenever we model paths in a *given* network topology.
            If set to 'ngrams' all possible n-grams will be considered, independent of whether they
            are valid paths in the first-order network or not. The 'ngrams' and the 'paths' assumption
            coincide if the first-order network is fully connected, i.e. if all possible paths actually occur.
Calculates the degrees of freedom of the model based on
        different assumptions, and taking into account layers up to
        a maximum order.
Calculates the degrees of freedom of the model based on different assumptions and taking into account layers up to a maximum order .
def getDegreesOfFreedom(self, maxOrder=None, assumption="paths"):
        """
        Calculates the degrees of freedom of the model based on
        different assumptions, and taking into account layers up to
        a maximum order.

        @param: maxOrder: the maximum order up to which model layers shall be
            taken into account

        @param assumption: if set to 'paths', for the degree of freedom calculation
            only paths in the first-order network topology will be considered. This is
            needed whenever we model paths in a *given* network topology.
            If set to 'ngrams' all possible n-grams will be considered, independent of whether they
            are valid paths in the first-order network or not. The 'ngrams' and the 'paths' assumption
            coincide if the first-order network is fully connected, i.e. if all possible paths actually occur.
        """
        if maxOrder == None:
            maxOrder = self.maxOrder
        assert maxOrder <= self.maxOrder, 'Error: maxOrder cannot be larger than maximum order of multi-order network'

        dof = 0

        # Sum degrees of freedom of all model layers up to maxOrder
        for i in range(0, maxOrder+1):
           dof += self.layers[i].getDoF(assumption)

        return int(dof)
def getDegreesOfFreedom ( self , maxOrder = None , assumption = "paths" ) : if maxOrder == None : maxOrder = self . maxOrder assert maxOrder <= self . maxOrder , 'Error: maxOrder cannot be larger than maximum order of multi-order network' dof = 0 # Sum degrees of freedom of all model layers up to maxOrder for i in range ( 0 , maxOrder + 1 ) : dof += self . layers [ i ] . getDoF ( assumption ) return int ( dof )