# lyapunov

##### Estimation of the Lyapunov exponent through several methods

This function estimates both the largest Lyapunov exponent through the Norma-2 method and the Lyapunov exponent spectrum through the QR decomposition method taking into account the full sample and three different methods of subsampling by blocks considering the argument set selected by the user.

##### Usage

```
lyapunov(x, lag = 1, timelapse = "FIXED", M0 = 3, M1 = 10,
H0 = 2, H1 = 10, I = 100, lyapmethod = c("LLE", "SLE", "ALL"),
blocking = c("FULL", "NOVER", "EQS", "BOOT", "ALL"),
pre.white = TRUE, B = 100, netplot = TRUE, doplot = TRUE)
```

##### Arguments

- x
a numeric vector, time serie, data frame or matrix depending on the method selected in

`timelapse`

.- lag
a non-negative integer denoting the reconstruction delay (Default 1).

- timelapse
a character denoting if you consider that the observations are sampled at uniform time intervals

`FIXED`

or with a variable time-lapse between each observation`VARIABLE`

(Default`FIXED`

).- M0
a non-negative integer denoting a lower bound for the embedding dimension (Default 3).

- M1
a non-negative integer denoting an upper bound for the embedding dimension (Default 10).

- H0
a non-negative integer denoting a lower bound for the number of neurones in the hidden layer (Default 2).

- H1
a non-negative integer denoting an upper bound for the number of neurones in the hidden layer (Default 10).

- I
a non-negative integer denoting a number of neural networks iterations (Default 100).

- lyapmethod
a character denoting if you want to estimate the largest Lyapunov exponent

`LLE`

, the Lyapunov exponent spectrum`SLE`

or both`ALL`

(Default`LLE`

).- blocking
a character denoting if you consider the full sample

`FULL`

, the non-overlapping sample`NOVER`

, the equally spaced sample`EQS`

, the bootstrap sample`BOOT`

or all of them`ALL`

(Default`FULL`

).- pre.white
a character denoting if you want to use as points to evaluate the partial derivatives the delayed vectors filtered by the neural network

`TRUE`

or not`FALSE`

(Default`TRUE`

).- B
a non-negative integer denoting the number of bootstrap iterations (Default 100).

- netplot
a logical value denoting if you want to draw a plot

`TRUE`

or not`FALSE`

. If it is`TRUE`

shows as many graphs as networks have been considered. Each of them represents the network structure by drawing the weights with positive values in black and the weights with negative values in grey. The thickness of the lines represents a greater or lesser value (Default`TRUE`

).- doplot
a logical value denoting if you want to draw a plot

`TRUE`

or not`FALSE`

. If it is`TRUE`

the evolution of the Lyapunov exponent values are represented for the whole period considering the lyapunov methods and the blocking methods selected by the user (Default`TRUE`

).

##### Details

If `FIXED`

has been selected `x`

must be a numeric vector or time serie. Otherwise `VARIABLE`

has to be specified. In this case `x`

must be a data frame or matrix with two columns. First, the date with the following format `YMD H:M:OS3`

considering milliseconds e.g., 20190407 00:00:03.347. If you don't consider milliseconds you must put .000 after the seconds. It should be an object of class `Factor`

. Second, the univariate time serie as a sequence of numerical values.

##### Value

A list containing the largest Lyapunov exponent, the Lyapunov exponent spectrum or both for each neural network structure considered by keeping to `Lyapunov.net`

. The dataset saved by each blocking method are the estimated Lyapunov exponent value, the standard error, the z-test value and the p-value. If the user chooses the non-overlapping sample, the equally spaced sample or the bootstrap sample the mean and median values of the Lyapunov exponent are showed. Also some details about the embedding dimension, the sample size, the block length and the block number are recorded.

##### References

Ellner, S., Gallant, A., McCaffrey, D., Nychka, D. 1991 Convergence rates and data requirements for jacobian-based estimates of lyapunov exponents from data. Physics Letters A 153(6):357-363.

McCaffrey, D.F., Ellner, S., Gallant, A.R., Nychka, D.W. 1992 Estimating the lyapunov exponent of a chaotic system with nonparametric regression. Journal of the American Statistical Association 87(419):682-695.

Nychka, D., Ellner, S., Gallant, A.R., McCaffrey, D. 1992 Finding chaos in noisy systems. Journal of the Royal Statistical Society 54(2):399-426.

Whang, Y.J., Linton, O. 1999 The asymptotic distribution of nonparametric estimates of the lyapunov exponent for stochastic time series. Journal of Econometrics 91(1):1-42.

Shintani, M., Linton, O. 2004 Nonparametric neural network estimation of Lyapunov exponents and a direct test for chaos. Journal of Econometrics 120(1):1-33.

##### See Also

##### Examples

```
# NOT RUN {
## We show below an example considering time series from the
## logistic equation. We have estimated the Lyapunov exponent
## spectrum by each blocking method for an embedding dimension (m=4).
data<-logistic.ts(u.min=4,u.max=4,B=100,doplot=FALSE)
ts<-data$`Logistic 100`$time.serie
lyapu<-lyapunov(ts,lag=1,timelapse="FIXED",M0=4,M1=4,H0=2,H1=7,I=10,
lyapmethod="SLE",blocking="ALL",pre.white=TRUE,B=30,netplot=FALSE,
doplot=FALSE)
show(lyapu$Lyapunov.net$Spectrum.full$Exponent)
show(lyapu$Lyapunov.net$Spectrum.nonoverlap$Exponent)
show(lyapu$Lyapunov.net$Spectrum.equally$Exponent)
show(lyapu$Lyapunov.net$Spectrum.bootstrap$Exponent)
# }
```

*Documentation reproduced from package DChaos, version 0.1-1, License: GPL (>= 2)*