logisticMap#

peccary.examples.logisticMap(n, r=4.0)[source]#

Generate timeseries from logistic map with growth rate parameter \(r\)

Parameters:
nint

Number of timesteps to generate

rfloat, optional

Growth rate parameter, by default 4.

Returns:
peccary.timeseries.Timeseries

Timeseries for logisitic map with parameter r, stored in x attribute of Timeseries class

References

[1] For more information on the logistic map, see Wolfram Mathworld’s entry.

Examples

To create a timeseries of 10 points using the logistic map, e.g.,

>>> import peccary.examples as ex
>>> logis = ex.logisticMap(10)

The data can be called as follows:

>>> logis.x
array([0.1       , 0.36      , 0.9216    , 0.28901376, 0.82193923,
       0.58542054, 0.97081333, 0.11333925, 0.40197385, 0.9615635 ])

The parameter \(r=4\) is used to produce chaotic timeseries, but other values may be used for different behavior.