Home | Trees | Indices | Help |
---|
|
object --+ | PiecewisePowerlaw
A piecewise powerlaw function.
You can specify the intervals and power indices, and this class will figure out the coefficients needed to make the function continuous and normalized to unit integral.
Intervals are defined by an array l
Powerlaw indicies by and array p
a_n are the coefficients.
f(x) = a_n x^{p_n} for l_{n-1} <= x < l_n
Recursion relation for continuity:
a_n = a_{n-1} l_n^{p_{n-1} - p_n}
Integral of a piece:
I_n = a_n p_n (l_{n+1}^{p_n - 1} - l_n^{p_n - 1})
Total integral:
I_tot = Sum_0^N I_n
Instance Methods | |||
|
|||
|
|||
|
|||
Inherited from |
Properties | |
Inherited from |
Method Details |
Defined a piecewise powerlaw. If coefficients is None then the coefficients are determined by requiring the function to be continuous and normalized to an integral of one. The function is composed of N powerlaws, where N = len(powers). len(limits) must be one greated than len(powers) Parameters
The resulting function takes a single, one-dimensional array of values on which to operate.
|
Integrate the function from low to high. Optionally weight the integral by x^weight_power. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Mar 27 20:49:15 2012 | http://epydoc.sourceforge.net |