Commit bca1fe0c authored by panos's avatar panos Committed by Jérome Perrin

put min and max limit in Normal distribution output

parent daff1f25
...@@ -44,7 +44,7 @@ class Distributions: ...@@ -44,7 +44,7 @@ class Distributions:
self.Normal= rFitDistr(data,'Normal') #It fits the normal distribution to the given data sample self.Normal= rFitDistr(data,'Normal') #It fits the normal distribution to the given data sample
except RRuntimeError: except RRuntimeError:
return None #If it doesn't fit Return None return None #If it doesn't fit Return None
myDict = {'distributionType':'Normal','aParameter':'mean','bParameter':'stdev','aParameterValue':self.Normal[0][0],'bParameterValue': self.Normal[0][1]} #Create a dictionary with keys distribution's and distribution's parameters names and the parameters' values myDict = {'distributionType':'Normal','aParameter':'mean','bParameter':'stdev','aParameterValue':self.Normal[0][0],'bParameterValue': self.Normal[0][1],'min':0, 'max':(self.Normal[0][0]+3*self.Normal[0][1])} #Create a dictionary with keys distribution's and distribution's parameters names and the parameters' values
return myDict #If there is no Error return the dictionary with the Normal distribution parameters for the given data sample return myDict #If there is no Error return the dictionary with the Normal distribution parameters for the given data sample
def Lognormal_distrfit(self,data): def Lognormal_distrfit(self,data):
...@@ -329,7 +329,7 @@ class DistFittest: ...@@ -329,7 +329,7 @@ class DistFittest:
#Set of if...elif syntax in order to get a Python dictionary with the best fitting statistical distribution and its parameters #Set of if...elif syntax in order to get a Python dictionary with the best fitting statistical distribution and its parameters
if list1[b]=='Normal': #Check if in list's b position is the Normal distribution if list1[b]=='Normal': #Check if in list's b position is the Normal distribution
self.Normal_distrfit(data) self.Normal_distrfit(data)
myDict = {'distributionType':list1[b],'aParameter':'mean','bParameter':'stdev','aParameterValue':self.Normal[0][0],'bParameterValue': self.Normal[0][1]} #Create a dictionary with distribution's and distribution parameters' names and distribution parameters' values myDict = {'distributionType':list1[b],'aParameter':'mean','bParameter':'stdev','aParameterValue':self.Normal[0][0],'bParameterValue': self.Normal[0][1],'min':0, 'max':(self.Normal[0][0]+3*self.Normal[0][1])} #Create a dictionary with distribution's and distribution parameters' names and distribution parameters' values
return myDict return myDict
elif list1[b]=='Lognormal': elif list1[b]=='Lognormal':
self.Lognormal_distrfit(data) self.Lognormal_distrfit(data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment