timeLag: Estimate an appropiate time lag for the Takens' vectors

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/basicNonLinearFunctions.R

Description

Given a time series (time.series), an embedding dimension (m) and a time lag (timeLag), the n^{th} Takens' vector is defined as

T[n]=\{time.series[n], time.series[n+ timeLag],...time.series[n+m*timeLag]\}.

This function estimates an appropiate time lag by using the autocorrelation function or the average mutual information .

Usage

1
2
3
4
timeLag(time.series, technique = c("acf", "ami"),
  selection.method = c("first.e.decay", "first.zero", "first.minimum",
  "first.value"), value = 1/exp(1), lag.max = NULL, do.plot = TRUE,
  main = NULL, ...)

Arguments

time.series

The original time series.

technique

The technique that we shall use to estimate the time lag (see the Details section). Allowed values are "acf" and "ami".

selection.method

Method used for selecting a concrete time lag. Available methods are "first.zero", "first.e.decay" (default), "first.minimum" and "first.value".

value

Numeric value indicating the value that the autocorrelation/AMI function must cross in order to select the time lag. It is used only with the "first.value" selection method.

lag.max

Maximum lag at which to calculate the acf/AMI.

do.plot

Logical value. If TRUE (default value), a plot of the autocorrelation/AMI function is shown.

main

A title for the plot.

...

Additional parameters for the acf or the mutualInformation.

Details

A basic criteria for estimating a proper time lag is based on the following reasoning: if the time lag used to build the Takens' vectors is too small, the coordinates will be too highly temporally correlated and the embedding will tend to cluster around the diagonal in the phase space. If the time lag is chosen too large, the resulting coordinates may be almost uncorrelated and the resulting embedding will be very complicated. Thus, the autocorrelation function can be used for estimating an appropiate time lag of a time series. However, it must be noted that the autocorrelation is a linear statistic, and thus it does not take into account nonlinear dynamical correlations. To take into account nonlinear correlations the average mutual information (AMI) can be used. Independently of the technique used to compute the correlation, the time lag can be selected in a variety of ways:

Value

The estimated time lag.

Note

If the autocorrelation/AMI function does not cross the specifiged value, an error is thrown. This may be solved by increasing the lag.max or selecting a higher value to which the autocorrelation/AMI function may decay.

Author(s)

Constantino A. Garcia

References

H. Kantz and T. Schreiber: Nonlinear Time series Analysis (Cambridge university press)

See Also

mutualInformation

Examples

1
2
3
4
5
6
## Not run: 
sx = sinaiMap(a=0.3,n.sample=5000,start=c(0.23489,0.8923),do.plot=FALSE)$x
timeLag(sx, technique="ami",  
        n.partitions = 20, units = "Bits")
timeLag(sx, technique="acf") 
## End(Not run)

Example output

Attaching package: 'nonlinearTseries'

The following object is masked from 'package:grDevices':

    contourLines

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 
[1] 1
[1] 1

nonlinearTseries documentation built on May 2, 2019, 5:47 p.m.