Package Biskit :: Package Statistics :: Module Density :: Class Density
[hide private]
[frames] | no frames]

Class Density

source code

Analyze a density distribution of values. Can be created from a list of samples or from a discrete distribution:
 Density( values = [ float ] )
   or
 Density( p = array(2xN,'f') )


Instance Methods [hide private]
  __init__(self, p=None, values=None, bins=20)
  store(self, val)
Analyze distribution data.
  get(self)
  __getslice__(self, *args, **kw)
  __getitem__(self, *args, **kw)
float, float confidenceInterval(self, level)
Returns start and end of the confidence interval containing |level|*100 % of the probability
float, (float,float) findConfidenceInterval(self, x)
Find the smallest possible density interval that still includes x.
  median(self)
Median of distribution.
  average(self)
Average of distribution.
  max(self)
Max height of distribution.
  __find_intervals(self, l)

Method Details [hide private]

__init__(self, p=None, values=None, bins=20)
(Constructor)

source code 
Parameters:
  • p (array) - discrete distribution, array (2 x len(data) ) with start of bin and witdh of bin (default: None)
  • values ([float]) - list of samples (default: None)
  • bins (int) - number of bins (default: 20)

store(self, val)

source code 

Analyze distribution data.
Parameters:
  • val (array) - array (2 x len(data) ) with start of bin and witdh of bin (default: None)

get(self)

source code 

__getslice__(self, *args, **kw)
(Slicling operator)

source code 

__getitem__(self, *args, **kw)
(Indexing operator)

source code 

confidenceInterval(self, level)

source code 
Parameters:
  • level (float) - confidence level (e.g. 0.68 for stdev interval)
Returns: float, float
start and end of the confidence interval containing |level|*100 % of the probability

findConfidenceInterval(self, x)

source code 

Find the smallest possible density interval that still includes x.
Parameters:
  • x (float) - value
Returns: float, (float,float)
convidence level, interval start and end

median(self)

source code 

Median of distribution.

average(self)

source code 

Average of distribution.

max(self)

source code 

Max height of distribution.

__find_intervals(self, l)

source code