Open main menu

Editing TISEAN package

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
== Porting TISEAN ==
 
== Porting TISEAN ==
  
This section which focuses on demonstrating how the package is to be ported and what is the current state of that process is located in [[TISEAN_package:Procedure]].
+
This section will focus on demonstrating the capabilities of the TISEAN package. The previous information about the porting procedure has been moved [[TISEAN_package:Procedure|here]].
 +
 
 +
Current ideas and future plans are available on a board loacated [https://trello.com/b/hJS1Q8wN here]
  
 
== Tutorials ==
 
== Tutorials ==
Line 47: Line 49:
 
       up{1}(:,1), up{1}(:,2),'cs;Period 6;','markersize',20,'linewidth',1);
 
       up{1}(:,1), up{1}(:,2),'cs;Period 6;','markersize',20,'linewidth',1);
 
</syntaxhighlight>}}
 
</syntaxhighlight>}}
[[File:Upo.png|400px|center]]
 
 
The plotting options are passed to make the orbits more visible.
 
The plotting options are passed to make the orbits more visible.
  
Line 117: Line 118:
 
[[File:tisean_nl_noisereduction_2.png|400px|center]]
 
[[File:tisean_nl_noisereduction_2.png|400px|center]]
  
=== Lyapunov Exponents ===
+
[[Category:Octave-Forge]]
Here I will demonstrate how to use the function {{Codeline|lyap_k}}. It estimates the maximal Lyapunov exponent from a time series (more information available from the TISEAN documentation located [http://www.mpipks-dresden.mpg.de/~tisean/Tisean_3.0.1/docs/chaospaper/node27.html here]). In this tutorial we will estimate the maximal Lyapunov exponent for various embedding dimensions and then plot them.
 
{{Code|Creating Lyapunov exponents|<syntaxhighlight lang="octave" style="font-size:13px">
 
# Create time series
 
in      = sin((1:2500).'./360) + cos((1:2500).'./180);
 
# Estimate Lyapunov exponents
 
mmax_val = 20
 
lyap_exp = lyap_k (in, 'mmin',2,'mmax',mmax_val,'d',6,'s',400,'t',500);
 
</syntaxhighlight>}}
 
In this function the output ({{Codeline|lyap_exp}} is a {{Codeline|5 x 20}} struct array. We will only use one row for the plot.
 
{{Code|Plotting Lyapunov exponents|<syntaxhighlight lang="octave" style="font-size:13px">
 
cla reset
 
hold on
 
for j=2:mmax_val
 
  plot (lyap_exp(1,j-1).exp(:,1),lyap_exp(1,j-1).exp(:,2),'r');
 
endfor
 
xlabel ("t [flow samples]");
 
ylabel ("S(eps, embed, t)");
 
hold off
 
</syntaxhighlight>}}
 
[[File:lyap_k.png|400px|center]]
 
 
 
=== Dimensions and Entropies ===
 
This section is discussed on the [http://www.mpipks-dresden.mpg.de/~tisean/Tisean_3.0.1/docs/chaospaper/node29.html#SECTION00080000000000000000 TISEAN documentation page]. One of the functions discussed is {{Codeline|d2}}. It is used to estimate the correlation sum, correlation dimension and correlation entropy of a time series. The time series used here will be the Henon map.
 
{{Code|Calculation correlation sum, dimension and entropy|<syntaxhighlight lang="octave" style="font-size:13px">
 
# Create maps
 
hen      = henon (10000);
 
# Calculate the correlation sum, dimension and entropy
 
vals = d2 (hen, 'd', 1, 'm', 5, 't',50);
 
# Plot correlation sum
 
subplot (2,3,1)
 
do_plot_corr  = @(x) loglog (x{1}(:,1),x{1}(:,2),'b');
 
hold on
 
arrayfun (do_plot_corr, {vals.c2});
 
hold off
 
xlabel ("Epsilon")
 
ylabel ("Correlation sums")
 
title ("c2");
 
# Plot correlation entropy
 
subplot (2,3,4)
 
do_plot_entrop  = @(x) semilogx (x{1}(:,1),x{1}(:,2),'g');
 
hold on
 
arrayfun (do_plot_entrop, {vals.h2});
 
hold off
 
xlabel ("Epsilon")
 
ylabel ("Correlation entropies");
 
title ("h2")
 
# Plot correlation dimension
 
subplot (2,3,[2 3 5 6])
 
do_plot_slope = @(x) semilogx (x{1}(:,1),x{1}(:,2),'r');
 
hold on
 
arrayfun (do_plot_slope, {vals.d2});
 
hold off
 
xlabel ("Epsilon")
 
ylabel ("Local slopes")
 
title ("d2");
 
</syntaxhighlight>}}
 
[[File:d2_out.png|400px|center]]
 
The output of {{Codeline|d2}} can be further processed using the following functions: {{Codeline|av_d2}}, {{Codeline|c2t}}, {{Codeline|c2g}}. This tutorial will show how to use {{Codeline|av_d2}} which smooths the output of {{Codeline|d2}} (usually used to smooth the "{{Codeline|d2}}" field of the output).
 
{{Code|Smooth output of d2|<syntaxhighlight lang="octave" style="font-size:13px">
 
# Smooth d2 output
 
figure 2
 
smooth = av_d2 (vals,'a',2);
 
# Plot the smoothed output
 
do_plot_slope = @(x) semilogx (x{1}(:,1),x{1}(:,2),'b');
 
hold on
 
arrayfun (do_plot_slope, {smooth.d2});
 
hold off
 
xlabel ("Epsilon")
 
ylabel ("Local slopes")
 
title ("Smooth");
 
</syntaxhighlight>}}
 
[[File:tisean_av_d2_out.png|400px|center]]
 
Optionally the line "{{Codeline|figure 2}}" can be omitted, which will cause the smoothed version to be superimposed on the "raw" version that came straight from {{Codeline|d2}}.
 
 
 
=== Testing for Nonlinearity ===
 
This section is discussed on the [http://www.mpipks-dresden.mpg.de/~tisean/Tisean_3.0.1/docs/chaospaper/node35.html#SECTION00090000000000000000 TISEAN documentation page]. The focus of this section will be the function {{Codeline|surrogates}}. It uses surrogate data to determine weather data is nonlinear. Let us first create the input data which will be a stationary Gaussian linear stochastic process. It is measured by {{Codeline|s(xn) &#61; xn^3}}. We then run it through {{Codeline|surrogates}} and plot the data.
 
{{Code|Creating data from Gaussian process|<syntaxhighlight lang="octave" style="font-size:13px">
 
# Create Gaussian process data
 
g = zeros (2000,1);
 
for i = 2:2000
 
  g(i) = 0.7 * g(i-1) +  (-6 + sum (rand ([size(1), 12]), 3));
 
endfor
 
# Create a measurement of it
 
spike = g.^3;
 
# Create the surrogate
 
sur  = surrogates (spike);
 
# Plot the data
 
subplot (2,1,1)
 
plot (spike,'g');
 
title ("spike")
 
subplot (2,1,2)
 
plot (sur,'b');
 
title ("surrogate")
 
</syntaxhighlight>}}
 
 
 
[[File:surrogate_tutorial.png|400px|center]]
 
It is crucial that the length of the input to surrogates is factorizable by only 2,3 and 5. Therefore, if it is not the excess of data is truncated accordingly. Padding with zeros is not allowed. To solve this problem one can use {{Codeline|endtoend}}, and choose the best subset of the input data to be used to generate a surrogate.
 
  
 
== External links ==
 
== External links ==
 
* [https://bitbucket.org/josiah425/tisean Bitbucket repository ] where the porting is taking place.
 
* [https://bitbucket.org/josiah425/tisean Bitbucket repository ] where the porting is taking place.
 
* [http://www.mpipks-dresden.mpg.de/~tisean/Tisean_3.0.1/ TISEAN package website] where the package is described along with references to literature, tutorials and manuals.
 
* [http://www.mpipks-dresden.mpg.de/~tisean/Tisean_3.0.1/ TISEAN package website] where the package is described along with references to literature, tutorials and manuals.
 
[[Category:Octave Forge]]
 

Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: