Percentile confidence interval for the median of a sample x and unknown distribution.
Input
- x - [1D numpy array] sample
- nboot - [integer] (>1) number of resamples
- alpha - [float] confidence level is 100*(1-2*alpha) (0.0<alpha<1.0)
- rseed - [integer] random seed
Output
- ci - (cimin, cimax) confidence interval
Example:
>>> from numpy import *
>>> from mlpy import *
>>> x = array([1,2,4,3,2,2,1,1,2,3,4,3,2])
>>> percentile_ci_median(x, nboot = 100)
(1.8461538461538463, 2.8461538461538463)
span peaks detection.
Input
- x - [1D numpy array float] data
- span - [odd int] span
Output
- idx - [1D numpy array integer] peaks indexes
New in version 2.0.7.
Gamma Function.
Input
- x - [float] data
Output
- gx - [float] gamma(x)
Factorial x!. The factorial is related to the gamma function by x! = gamma(x+1)
Input
- x - [int] data
Output
- fx - [float] factorial x!
Quantile value of sorted data. The elements of the array must be in ascending numerical order. The quantile is determined by the f, a fraction between 0 and 1. The quantile is found by interpolation, using the formula: quantile = (1 - delta) x_i + delta x_{i+1} where i is floor((n - 1)f) and delta is (n-1)f - i.
Input
- x - [1D numpy array float] sorted data
- f - [float] fraction between 0 and 1
Output
- q - [float] quantile
Cumulative Distribution Functions (CDF) P(x) for the Gaussian distribution.
Input
- x - [float] data
- sigma - [float] standard deviation
Output
- p - [float]
New in version 2.0.2.
Given numpy 1D array a and numpy 1D array b compute c = { bi : | bi - aj | > d for each i, j}
Input
- a - [1D numpy array float]
- b - [1D numpy array float]
- d - [double]
Output
- c - [1D numpy array float]
New in version 2.0.3.
Return True if ‘n’ is power of ‘b’, False otherwise.
New in version 2.0.6.
Returns the smallest integer, greater than or equal to ‘n’ which can be obtained as power of ‘b’.
New in version 2.0.6.