示例#1
0
 def __init__(self, choices, coefficients, logsumparameter=None):
     Specification.__init__(self, choices, coefficients)
     if self.number_choices > 1:
         raise SpecificationError, """not a valid inout - more than 1 """\
             """equations specified for the branch in the tree; only one """\
             """ choice expected"""
     if logsumparameter is not None:
         if logsumparameter > 1 or logsumparameter < 0:
             raise SpecificationError, """not a valid input - logsumparameter """\
                 """out of range; valid range [0-1]"""
     self.logsumparameter = logsumparameter
    def __init__(self, choices, coefficients, thresholds, distribution=None):
        self.thresholds = thresholds
        Specification.__init__(self, choices, coefficients)

        if distribution is None:
            self.distribution = "logit"
        else:
            self.distribution = distribution
            checkVal, checkText = self.check_text_only([self.distribution])
            if not checkVal:
                raise SpecificationError, """the distribution specification is not """ """a valid string"""
            if self.distribution not in ["logit", "probit"]:
                raise SpecificationError, """the ordered model formulations """ """supported are probit and logit specification"""
示例#3
0
    def __init__(self, choices, coefficients, distribution=None):
        Specification.__init__(self, choices, coefficients)

        if distribution is None:
            self.distribution = 'poisson'
        else:
            self.distribution = distribution
            checkVal, checkText = self.check_text_only([self.distribution])
            if not checkVal:
                raise SpecificationError, """the distribution specification is not """\
                    """a valid string"""
            if self.distribution not in ['poisson', 'negativebinomial']:
                raise SpecificationError, """the ordered model formulations """\
                    """ supported are poisson and negativebinomial specification"""
    def __init__(self, choices, coefficients, distribution=None):
        Specification.__init__(self, choices, coefficients)

        if distribution is None:
            self.distribution = 'poisson'
        else:
            self.distribution = distribution
            checkVal, checkText = self.check_text_only([self.distribution])
            if not checkVal:
                raise SpecificationError, """the distribution specification is not """\
                    """a valid string"""
            if self.distribution not in ['poisson', 'negativebinomial']:
                raise SpecificationError, """the ordered model formulations """\
                    """ supported are poisson and negativebinomial specification"""
    def __init__(self, choices, coefficients, thresholds, distribution=None):
        self.thresholds = thresholds
        Specification.__init__(self, choices, coefficients)

        if distribution is None:
            self.distribution = 'logit'
        else:
            self.distribution = distribution
            checkVal, checkText = self.check_text_only([self.distribution])
            if not checkVal:
                raise SpecificationError, """the distribution specification is not """\
                    """a valid string"""
            if self.distribution not in ['logit', 'probit']:
                raise SpecificationError, """the ordered model formulations """\
                    """supported are probit and logit specification"""