Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- SAS Communities Library
- /
- How to understand Chaos Theory using Logistic Map Equation

Options

- RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content

- Article History
- RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content

Views
448

In data analysis, we frequently deal with a variety of seemingly unpredictable processes. Although we normally presume that data was generated randomly, chaos theory indicates that some sequences that appear random are actually the result of predictable principles. Originally rooted in math and physics, Chaos Theory is useful for unraveling the complexity of chaotic systems through seemingly stochastic sequences.

We will use a logistic map equation to help demonstrate the complexity of chaos theory. A logistic map is a polynomial mapping of degree 2 that uses relatively simple logistic equations to demonstrate how complicated chaotic behavior might emerge. The mapping was popularized in the late 1970's as a discrete-time demographic model analogous to the logistic equation developed by Pierre Francois Verhulst. Mathematically the equation was written as:

, where x_{n} is a number between zero and one, which represents the ratio of existing population to the maximum possible population and "r" represents the growth rate of change. Where the population level at any given time is a function of the growth rate parameter and the previous time step's population level. This nonlinear difference equation is meant to describe the effect of reproduction, which causes the population to grow at a rate proportionate to the current population when the population is small. The usual values of interest for the parameter r are in the range [0, 4], hence x_{n} remains confined on [0, 1]. The logistic map (r = 4) is a nonlinear transformation of the bit-shift map and the tent map (μ = 2). If r is more than 4, the population sizes will be fluctuate erratically producing negative chaotic values, but if r >= 4, the iterates of x_{n}'s are no longer limited to [0,1], and the majority of initial values diverge.

In this first step, we create a dataset "chaotic_data" to store our simulated data. First, we need to call the DATA step function and create our initial conditions. We set the initial conditions x=0.1 & r=3.2 and simulate 100 data points using a logistic map equation for the chaos theory demonstrations. In this first example, we decided not to display the plot of x_{0} = 0.1 as it's understood to be our initial r-value. We will show different values of 'r' between 3.2 and 4.0 to help better understand how chaotic data can arise and from the visualization what we may learn.

```
data chaotic_data;
/* Set initial conditions */;
x=0.1;
r=3.2;
/* Simulate 100 time points */;
do i=1 to 100;
/* Logistic map equation for chaos */;
x=r * x * (1 - x);
output;
end;
run;
proc print data=Chaotic_data (obs=10);
run;
```

In the figure above, we are able to observe the initial start point as the iterations approaches the 20th point of iterations we see that the chaotic values converge approximately around 0.70 reaching a steady state between 20 and 100 . We are able to see the coupling effect taken showing the iteration data points between 20 and 100.

```
data chaotic_data_3;
/* Set initial conditions */;
x=0.1;
r=3.5;
/* Simulate 1000 time points */;
do i=1 to 100;
/* Logistic map equation for chaos */;
x=r * x * (1 - x);
output;
end;
run;
proc print data=chaotic_data_3 (obs=10);
run;
/***********Visualizations*******************/;
title "Chaotic Plot 3 (λ=3.5)";
proc sgplot data=chaotic_data_3;
series x=i y=x / markers;
xaxis label="Iterations (0-100)";
yaxis label="Chaotic Values";
run;
title;
```

In the above demonstration, we set r = 3.5 we see the onset of chaos, with the data beginning to change frequently in the first 20 iterations and towards the end of the period-doubling cascade. Almost all initial conditions no longer produce finite period oscillations. Slight differences in the beginning population produce significantly diverse effects over time, a key feature of onset chaos.

```
data chaotic_data_2;
/* Set initial conditions */;
x=0.1;
r=3.7;
/* Simulate 1000 time points */;
do i=1 to 100;
/* Logistic map equation for chaos */;
x=r * x * (1 - x);
output;
end;
run;
proc print data=chaotic_data_2 (obs=10);
run;
/***********Visualizations*******************/;
title "Chaotic Data Plot 2 (λ=3.7)";
proc sgplot data=chaotic_data_2;
series x=i y=x / markers;
xaxis label="Iterations (0-100)";
yaxis label="Chaotic Values";
run;
title;
```

In this demonstration we increased the r value to 3.7, we are able to observe the 2^{nd} x-value as 0.33, it increases to 0.82 where we are able to notice the data diverges and chaos in the visualization. We notice that in the first few observations in the visualization that iteration fluctuates erratically throughout the data.

```
data chaotic_data_4;
/* Set initial conditions */;
x=0.1;
r=4.0;
/* Simulate 1000 time points */;
do i=1 to 100;
/* Logistic map equation for chaos */;
x=r * x * (1 - x);
output;
end;
run;
proc print data=chaotic_data_4 (obs=10);
run;
/***********Visualizations*******************/;
title
"Chaotic Plot 4 (λ=4.0)";
proc sgplot data=chaotic_data_4;
series x=i y=x / markers;
xaxis label="Iterations (0-100)";
yaxis label="Chaotic Values";
run;
title;
```

In the above demonstration, we set r = 4.0 where we are able to observe a case of nonlinear transformation of both the shift between the chaotic values interval from 0 to 1. When r=4.0 there two possible outcomes in the results, either the iterates will exhibit chaotic dynamics or the iterates will diverge dependent on the initial r-value that may be used (in our case 0.1).

The logistic map equation has proven to be an effective tool for demonstrating how slight changes in initial conditions or parameters can result in radically different outcomes, exemplifying chaotic systems' sensitive dependence on initial conditions. The logistic map's relative simplicity makes it a popular starting point for discussing the concept of chaos. A simple explanation of chaos is that chaotic systems are extremely sensitive to initial conditions, which is a feature of the logistic map for the majority of values. In the next post of this series we discuss using these chaotic values collected to form a bifurcation diagram and visualize the succession of period-doubling produced as the r-values increase. For more information regarding this topic see the links below.

Find more articles from SAS Global Enablement and Learning here.

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

Data Literacy is for **all**, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.

Article Labels

Article Tags

- Find more articles tagged with:
- GEL