Program to calculate the nonlinear measure (NLM) from time series data

Isao Tokuda, Institute for Theoretical Biology, Humboldt University of Berlin, Germany


(pdf version) (word version)


Description

The program (nlm.c) computes the nonlinear measure from time series data composed of a single dynamical variable. The data set and the parameters have to be provided in two files and the results of the program, namely, deterministic-versus-stochastic (DVS) plot and the nonlinear measure (NLM) are written into two other files (see below).

The algorithm for obtaining the DVS plot has been proposed by M. Casdagli [1] and the nonlinear measure has been calculated from the DVS plot by Tokuda et. al [2]. The present program (nlm.c) is the one used in [2].

The input files are:

The output files are:

The file parameters.txt has to contain the following parameters given as plain numbers (ascii), arranged as shown below:

The linked file parameters.txt sets the parameters as length = 2000 and dim = 3 just to show as an example. Please rewrite the parameter file for your own use.

The file data.txt has to contain a series of dynamical data given as real numbers. The linked file data.txt gives a time series data generated from the Lorenz equation to show a sample data file. To apply the program to your own data, please substitute your data file by naming it as data.txt .

When the program is done, two output files are produced.

The above linked output files have been generated by applying the program to the lorenz data (data.txt) with (length, dim) = (2000, 3) to show as an example.

References:

  1. M. Casdagli: Chaos and deterministic versus stochastic nonlinear modelling J. R. Stat. Soc. B. 54: 303-328 (1992).
  2. I. Tokuda, T. Riede, J. Neubauer, M.J. Owren, H. Herzel: Nonlinear analysis of irregular animal vocalizations, Journal of the Acoustical Society of America 111: 2908-2919 (2002).

Usage

  1. Compile the program (nlm.c) with a normal gcc compiler as

    % gcc nlm.c -lm

    The object file can be a.out or any other name like nlm.out as you prefer.

  2. Execute the program with

    % a.out

    where the input data file data.txt and the parameter file parameters.txt should be provided as explained in the Description .

  3. The program computes the nonlinear measure of the input data and provides the results as

    % Nonlinear Measure = 10.682033 [dB]

    The program also produces an output file dvs_plot.txt , which can be used to display deterministic-versus-stochastic (DVS) plot. Via gnuplot, this can be simply done by

    gnuplot> plot "dvs_plot.txt" w linesp


Examples

Examples of applying the program to dog barks are shown here.


The program

This part is only important for users who want to modify or understand the code.

Variables (most important ones):

Functions (detailed descriptions in function header):


Note

The author is not responsible for any problems or difficulties encountered in implementing or applying this software. Please report problems to Isao Tokuda ( i.tokuda@biologie.hu-berlin.de).


This page has been maintained by I. Tokuda

updated on 9 Dec., 2004