Navigation

Operators and Keywords

Function List:

C++ API

Function File: output = lzo_gm (S)
Function File: output = lzo_gm (S, paramName, paramValue, …)

This program makes a local linear ansatz and estimates the one step prediction error of the model. The difference to lfo-test is that it does it as a function of the neighborhood size. The name "lzo_ar" means ’local first order -> AR-model’.

Input

S

This function always assumes that each time series is along the longer dimension of matrix S. It also assumes that every dimension (counting along the shorter dimension) of S is considered a component of the time series.

Parameters

m

The embedding dimension used. It is synonymous to the second part of flag ’-m’ from TISEAN. The first part of the TISEAN flag is omitted as all of the available components of S are analyzed [default = 1].

d

Delay used for the embedding [default = 1].

i

For how many points should the error be calculated [default = length (S)].

rlow

The neighborhood size to start with [default = 1e-3].

rhigh

The neighborhood size to end with [default = 1].

f

Factor to increase neighborhood size if not enough neighbors were found [default = 1.2].

s

Steps to be forecast x(n+s) = f(x(n)) [default = 1].

c

Width of causality window [default = value of parameter s]

Output

The output is alligned with the input. If the components of the input(S) were column vectors then the number of columns of the output is 4 + number of components of S. In this case the output will have the following values in each row:

  • Neighborhood size (units of data)
  • Relative forecast error ((forecast error)/(variance of data))
  • Relative forecast error for the individual components of the input, this will take as many columns as the input has
  • Fraction of points for which neighbors were found for this neighborhood size
  • Average number of neighbors found per point

See also: demo lfo_ar, lfo_test, lfo_run.

Algorithms

The algorithms for this functions have been taken from the TISEAN package.

Demonstration 1

The following code

 verbose = yes_or_no ("Would you like this to be run verbose? (it may take\
  a while to complete)\n");

 ar4 = arma_rnd([0.3,0.3,-0.3,0.3],[],0.1,1000,100);
 if (verbose)
   res_hen     = lfo_ar (henon(5000)(:,1),'m',4,'d',6,'verbose');
   res_ikeda   = lfo_ar (ikeda(5000)(:,1), 'm',4, 'd', 3, 'verbose');
   res_ar      = lfo_ar(ar4,'m',4,'d',1,'verbose');
 else
   res_hen     = lfo_ar (henon(5000)(:,1),'m',4,'d',6);
   res_ikeda   = lfo_ar (ikeda(5000)(:,1), 'm',4, 'd', 3);
   res_ar      = lfo_ar(ar4,'m',3,'d',1);
 endif

 semilogx (res_hen(:,1), res_hen(:,2),'-g',...
           res_ikeda(:,1), res_ikeda(:,2),'-b',...
           res_ar(:,1), res_ar(:,2),'-r')
 ylim([0 1]);
 legend ('Henon', 'Ikeda','AR(4)')
 xlabel ("Neighborhood Radius (size)")
 ylabel ("Normalized error")

Produces the following figure

Figure 1

Package: tisean