Ejemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     # parse parameters correctly
     param = parseParameters(args, kwargs)
     # set default parameters
     self.name = 'NakaRushton Distribution'
     self.param = {
         'sigma': 1.0,
         'kappa': 2.0,
         's': 1.0,
         'n': 2.0,
         'p': 2.0,
         'gamma': 2.0,
         'delta': 0.0
     }
     if param != None:
         for k in param.keys():
             self.param[k] = float(param[k])
     if param is None or 's' not in param.keys():
         self.param['s'] = .5 * (gammafunc(1.0 / self.param['p']) /
                                 gammafunc(3.0 / self.param['p']))**(
                                     self.param['p'] / 2.0)
     if self.param['delta'] == 0.0:
         self.primary = [
             'sigma'
         ]  # gamma would also be possible here, but stays out for backwards compatibility reasons
     else:
         self.primary = ['sigma', 'kappa', 'gamma', 'delta']
Ejemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     # parse parameters correctly
     self.param = {'f': None, 'finv': None, 'dfinvdy': None, 'q': None}
     param = parseParameters(args, kwargs)
     for k, v in param.items():
         self.param[k] = v
     # set default parameters
     self.name = 'Transformed %s Distribution' % (self.param['q'].name, )
     self.primary = []
Ejemplo n.º 3
0
 def __init__(self, *args,**kwargs):
     # parse parameters correctly
     self.param = {'f':None,'finv':None,'dfinvdy':None,'q':None}
     param = parseParameters(args,kwargs)
     for k,v in param.items():
         self.param[k] = v
     # set default parameters
     self.name = 'Transformed %s Distribution' % (self.param['q'].name,)
     self.primary = []
Ejemplo n.º 4
0
 def __init__(self, *args,**kwargs):
             # parse parameters correctly
     param = parseParameters(args,kwargs)
     
     # set default parameters
     self.name = 'Truncated Exponential Power Distribution'
     self.param = {'p':1.0,'s':1.0,'a':0.0,'b':1.0}
     if param != None:
         for k in param.keys():
             self.param[k] = float(param[k])
     self.primary = ['p','s']
Ejemplo n.º 5
0
    def __init__(self, *args, **kwargs):
        # parse parameters correctly
        param = parseParameters(args, kwargs)

        # set default parameters
        self.name = 'TModelRadial Distribution'
        self.param = {'beta': 1.0, 'alpha': 1.0, 'n': 2}
        if param != None:
            for k in param.keys():
                self.param[k] = float(param[k])
        self.primary = ['alpha', 'beta']
Ejemplo n.º 6
0
 def __init__(self, *args,**kwargs):
     # parse parameters correctly
     param = parseParameters(args,kwargs)
     
     # set default parameters
     self.name = 'SkewedGaussian Distribution'
     self.param = {'mu':1.0,'sigma':1.0,'alpha':1.0}
     if param != None:
         for k in param.keys():
             self.param[k] = float(param[k])
     self.primary = ['mu','sigma','alpha']
Ejemplo n.º 7
0
    def __init__(self, *args, **kwargs):
        # parse parameters correctly
        param = parseParameters(args, kwargs)

        # set default parameters
        self.name = 'Kumaraswamy Distribution'
        self.param = {'a': 1.0, 'b': 1.0, 'B': 1.0}
        if param != None:
            for k in param.keys():
                self.param[k] = float(param[k])
        self.primary = ['a', 'b']
Ejemplo n.º 8
0
 def __init__(self, *args,**kwargs):
     # parse parameters correctly
     param = parseParameters(args,kwargs)
     
     # set default parameters
     self.name = 'TModelRadial Distribution'
     self.param = {'beta':1.0,'alpha':1.0,'n':2} 
     if param != None:
         for k in param.keys():
             self.param[k] = float(param[k])
     self.primary = ['alpha','beta']
Ejemplo n.º 9
0
 def __init__(self, *args,**kwargs):
     # parse parameters correctly
     param = parseParameters(args,kwargs)
     
     # set default parameters
     self.name = 'Kumaraswamy Distribution'
     self.param = {'a':1.0,'b':1.0,'B':1.0}
     if param != None:
         for k in param.keys():
             self.param[k] = float(param[k])
     self.primary = ['a','b']
Ejemplo n.º 10
0
    def __init__(self, *args, **kwargs):
        # parse parameters correctly
        param = parseParameters(args, kwargs)

        # set default parameters
        self.name = 'Truncated Exponential Power Distribution'
        self.param = {'p': 1.0, 's': 1.0, 'a': 0.0, 'b': 1.0}
        if param != None:
            for k in param.keys():
                self.param[k] = float(param[k])
        self.primary = ['p', 's']
Ejemplo n.º 11
0
        def __init__(self, *args, **kwargs):
            param = parseParameters(args,kwargs)
        
            # set default parameters
            self.name = 'Beta Distribution'
            self.param = {'alpha':1.0,'beta':1.0}

            if param is not None:
                for k in param.keys():
                    self.param[k] = float(param[k])
            self.primary = ['alpha','beta']
Ejemplo n.º 12
0
    def __init__(self, *args,**kwargs):
        # parse parameters correctly
        # (special.gamma(1.0/p)/special.gamma(3.0/p))**(p/2.0)
        param = parseParameters(args,kwargs)

        # set default parameters
        self.param = {'n':2, 'p':2.0}
        self.name = 'PCauchy Distribution'
        if param != None:
            for k in param.keys():
                self.param[k] = float(param[k])
        self.primary = ['p']
Ejemplo n.º 13
0
    def __init__(self, *args, **kwargs):
        # parse parameters correctly
        # (special.gamma(1.0/p)/special.gamma(3.0/p))**(p/2.0)
        param = parseParameters(args, kwargs)

        # set default parameters
        self.param = {'n': 2, 'p': 2.0}
        self.name = 'PCauchy Distribution'
        if param != None:
            for k in param.keys():
                self.param[k] = float(param[k])
        self.primary = ['p']
Ejemplo n.º 14
0
 def __init__(self, *args,**kwargs):
     self.numericalSigmaBoundary = 6.0
     # parse parameters correctly
     param = parseParameters(args,kwargs)
     
     # set default parameters
     self.name = 'TruncatedGaussian Distribution'
     self.param = {'a':0.0,'b':1.0,'mu':1.0,'sigma':1.0}
     if param != None:
         for k,v in param.items():
             self[k] = float(v)
     self.primary = ['mu','sigma']
Ejemplo n.º 15
0
    def __init__(self, *args, **kwargs):
        # parse parameters correctly
        param = parseParameters(args, kwargs)

        # set default parameters
        self.name = 'Histogram Distribution'
        self.param = {'p': None, 'b': None}
        if param != None:
            for k in param.keys():
                self.param[k] = param[k]

        self.primary = ['p', 'b']
Ejemplo n.º 16
0
    def __init__(self, *args,**kwargs):
        # parse parameters correctly
        param = parseParameters(args,kwargs)

        # set default parameters
        self.name = 'Histogram Distribution'
        self.param = {'p':None,'b':None}
        if param != None: 
            for k in param.keys():
                self.param[k] = param[k]

        self.primary = ['p','b']
Ejemplo n.º 17
0
    def __init__(self, *args,**kwargs):
        # parse parameters correctly
        # (special.gamma(1.0/p)/special.gamma(3.0/p))**(p/2.0)
        param = parseParameters(args,kwargs)

        # set default parameters
        self.param = {'n':2, 'p':2.0}
        self.name = 'ChiP Distribution'
        if param != None:
            for k in param.keys():
                self.param[k] = float(param[k])
        if not self.param.has_key('s'):
            self.param['s'] =  (special.gamma(1.0/self.param['p'])/special.gamma(3.0/self.param['p']))**(self.param['p']/2.0)
        self.primary = ['s']
        self.baseDist = GammaP({'u':(self.param['n']/float(self.param['p'])),'s':self.param['s'],'p':self.param['p']})
Ejemplo n.º 18
0
 def __init__(self, *args,**kwargs):
     # parse parameters correctly
     param = parseParameters(args,kwargs)
     # set default parameters
     self.name = 'NakaRushton Distribution'
     self.param = {'sigma':1.0,'kappa':2.0,'s':1.0,'n':2.0,'p':2.0,'gamma':2.0,'delta':0.0}
     if param != None:
         for k in param.keys():
             self.param[k] = float(param[k])
     if param is None or 's' not in param.keys():
         self.param['s'] = .5*(gammafunc(1.0/self.param['p'])/gammafunc(3.0/self.param['p']))**(self.param['p']/2.0)
     if self.param['delta'] == 0.0:
         self.primary = ['sigma'] # gamma would also be possible here, but stays out for backwards compatibility reasons
     else:
         self.primary = ['sigma','kappa','gamma','delta']
Ejemplo n.º 19
0
    def __init__(self,*args, **kwargs):
        # set initial parameters
        param = parseParameters(args,kwargs)
        self.param = {}

        if param is not None:
            for k,v in param.items():
                self[k] = v
        
        if not self.param.has_key('P'):
            self.param['P'] = [Gaussian(n=1,mu=randn(1)*3.0) for dummy in xrange(3)]

        
        K = len(self.param['P'])
        if not self.param.has_key('alpha'):
            self['alpha'] = ones(K)/K
        self.name = "Finite mixture of %s distributions" % (", ".join(unique(array([p.name for p in self['P']],dtype=object))),)
        self.primary = ['alpha','P']
Ejemplo n.º 20
0
    def __init__(self, *args, **kwargs):
        # parse parameters correctly
        # (special.gamma(1.0/p)/special.gamma(3.0/p))**(p/2.0)
        param = parseParameters(args, kwargs)

        # set default parameters
        self.param = {'n': 2, 'p': 2.0}
        self.name = 'ChiP Distribution'
        if param != None:
            for k in param.keys():
                self.param[k] = float(param[k])
        if not self.param.has_key('s'):
            self.param['s'] = (special.gamma(1.0 / self.param['p']) /
                               special.gamma(3.0 / self.param['p']))**(
                                   self.param['p'] / 2.0)
        self.primary = ['s']
        self.baseDist = GammaP({
            'u': (self.param['n'] / float(self.param['p'])),
            's': self.param['s'],
            'p': self.param['p']
        })