pymdea.core¶
Diffusion entropy analysis core methods.
DeaEngine(loader, hist_bins='doane', windows=250, window_stop=0.25)
¶
Run diffusion entropy analysis.
Run diffusion entropy analysis.
| PARAMETER | DESCRIPTION |
|---|---|
loader
|
An instance of the DeaLoader class containing data to be analysed.
TYPE:
|
hist_bins
|
Number of bins, or method by which to calculate it, to use
for the histogram in the Shannon entropy calculation. Refer
to
TYPE:
|
window_stop
|
Proportion of data length at which to cap window length. For example, if set to 0.25, 0.25 * len(data) will be the maximum window length. Must be a float in (0, 1].
TYPE:
|
windows
|
Number of window lengths to use and fit over. Window lengths will be evenly spaced in log-scale.
TYPE:
|
Source code in src/pymdea/core.py
analyze_with_stripes(fit_start, fit_stop, fit_method='siegel', stripes=20)
¶
Run a modified diffusion entropy analysis.
| PARAMETER | DESCRIPTION |
|---|---|
fit_start
|
Fraction of maximum window length at which to start linear fit.
TYPE:
|
fit_stop
|
Fraction of maximum window length at which to stop linear fit.
TYPE:
|
fit_method
|
Linear fit method to use. By default "siegel"
TYPE:
|
stripes
|
Number of stripes to apply to input time-series during analysis.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
|
Object containing the results and inputs of the diffusion entropy analysis. |
| RAISES | DESCRIPTION |
|---|---|
|
If n_stripes < 2. At least two stripes must be applied for DEA to provide a meaningful result. |
Notes
Prefer the siegel or theilsen methods. Least squares linear fits can introduce bias when done over log-scale data, see Clauset, A., Shalizi, C.R. and Newman, M.E., 2009. Power-law distributions in empirical data. SIAM review, 51(4), pp.661-703. https://doi.org/10.1137/070710111. https://arxiv.org/pdf/0706.1062.pdf.
Source code in src/pymdea/core.py
analyze_without_stripes(fit_start, fit_stop, fit_method='siegel')
¶
Run a regular diffusion entropy analysis.
| PARAMETER | DESCRIPTION |
|---|---|
fit_start
|
Fraction of maximum window length at which to start linear fit.
TYPE:
|
fit_stop
|
Fraction of maximum window length at which to stop linear fit.
TYPE:
|
fit_method
|
Linear fit method to use. By default "siegel"
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
|
Object containing the results and inputs of the diffusion entropy analysis. |
Notes
Prefer the siegel or theilsen methods. Least squares linear fits can introduce bias when done over log-scale data, see Clauset, A., Shalizi, C.R. and Newman, M.E., 2009. Power-law distributions in empirical data. SIAM review, 51(4), pp.661-703. https://doi.org/10.1137/070710111. https://arxiv.org/pdf/0706.1062.pdf.
Source code in src/pymdea/core.py
print_result()
¶
Print out result of analysis.
Source code in src/pymdea/core.py
DeaLoader()
¶
Load data for a diffusion entropy analysis.
Load data for a diffusion entropy analysis.
Source code in src/pymdea/core.py
make_diffusion_process(kind='gn', length=10000, a=0)
¶
Generate diffusion process data.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
Type of diffusion noise to generate. If "cn", generate a
colored noise with spectral power
TYPE:
|
length
|
Length of time-series to generate.
TYPE:
|
a
|
Only used if
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
|
An instance of the Loader object. |
Source code in src/pymdea/core.py
make_sample_data(length=100000, seed=1)
¶
Generate an array of sample data.
| PARAMETER | DESCRIPTION |
|---|---|
length
|
Number of time-steps to produce in the sample data.
TYPE:
|
seed
|
Seed for random number generation.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
|
An instance of the Loader object. |
Source code in src/pymdea/core.py
read_data_file(filepath, column_name)
¶
Read input data from file.
| PARAMETER | DESCRIPTION |
|---|---|
filepath
|
System path to a file containing data. Must include the full file name, including the extension. Example: "/example/path/to/file.csv"
TYPE:
|
column_name
|
Name of the column in the data file which contains the time series data values.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
|
An instance of the Loader object. |
| RAISES | DESCRIPTION |
|---|---|
|
If filepath points to a file of type other than CSV. Support for more types of files is a work in progress. |