View source: R/informationDimension.R
infDim | R Documentation |
Functions for estimating the information dimension of a dynamical system from 1-dimensional time series using Takens' vectors
infDim(
time.series,
min.embedding.dim = 2,
max.embedding.dim = min.embedding.dim,
time.lag = 1,
min.fixed.mass,
max.fixed.mass,
number.fixed.mass.points = 10,
radius,
increasing.radius.factor = sqrt(2),
number.boxes = NULL,
number.reference.vectors = 5000,
theiler.window = 1,
kMax = 1000,
do.plot = TRUE,
...
)
## S3 method for class 'infDim'
fixedMass(x)
## S3 method for class 'infDim'
logRadius(x)
## S3 method for class 'infDim'
embeddingDims(x)
## S3 method for class 'infDim'
estimate(
x,
regression.range = NULL,
do.plot = TRUE,
use.embeddings = NULL,
col = NULL,
pch = NULL,
fit.col = NULL,
fit.lty = 2,
fit.lwd = 2,
add.legend = T,
lty = 1,
lwd = 1,
...
)
## S3 method for class 'infDim'
plot(
x,
main = "Information Dimension",
xlab = "fixed mass (p)",
ylab = "<log10(radius)>",
type = "b",
log = "x",
ylim = NULL,
col = NULL,
pch = NULL,
localScalingExp = T,
add.legend = T,
...
)
## S3 method for class 'infDim'
plotLocalScalingExp(
x,
main = "Local scaling exponents d1(p)",
xlab = "fixed mass p",
ylab = "1/d1(p)",
type = "b",
log = "x",
ylim = NULL,
col = NULL,
pch = NULL,
add.legend = T,
...
)
time.series |
The original time series from which the information dimension will be estimated. |
min.embedding.dim |
Integer denoting the minimum dimension in which we shall embed the time.series (see buildTakens). |
max.embedding.dim |
Integer denoting the maximum dimension in which we shall embed the time.series (see buildTakens).Thus, we shall estimate the information dimension between min.embedding.dim and max.embedding.dim. |
time.lag |
Integer denoting the number of time steps that will be use
to construct the Takens' vectors (see |
min.fixed.mass |
Minimum percentage of the total points that the algorithm shall use for the estimation. |
max.fixed.mass |
Maximum percentage of the total points that the algorithm shall use for the estimation. |
number.fixed.mass.points |
The number of different fixed mass fractions between min.fixed.mass and max.fixed.mass that the algorithm will use for estimation. |
radius |
Initial radius for searching neighbour points in the phase space. Ideally, it should be small enough so that the fixed mass contained in this radius is slightly greater than the min.fixed.mass. However, whereas the radius is not too large (so that the performance decreases) the choice is not critical. |
increasing.radius.factor |
Numeric value. If no enough neighbours are found within radius, the radius is increased by a factor increasing.radius.factor until succesful. Default: sqrt(2) = 1.414214. |
number.boxes |
Number of boxes that will be used in the box assisted algorithm (see neighbourSearch). |
number.reference.vectors |
Number of reference points that the routine will try to use, saving computation time. |
theiler.window |
Integer denoting the Theiler window: Two Takens' vectors must be separated by more than theiler.window time steps in order to be considered neighbours. By using a Theiler window, we exclude temporally correlated vectors from our estimations. |
kMax |
Maximum number of neighbours used for achieving p with all the points from the time series (see Details). |
do.plot |
Logical value. If TRUE (default value), a plot of the correlation sum is shown. |
... |
Additional graphical parameters. |
x |
A infDim object. |
regression.range |
Vector with 2 components denoting the range where the function will perform linear regression. |
use.embeddings |
A numeric vector specifying which embedding dimensions should be used to compute the information dimension. |
col |
Vector of colors for each of the dimensions of the plot. |
pch |
Vector of symbols for each of the dimensions of the plot. |
fit.col |
A vector of colors to plot the regression lines. |
fit.lty |
The type of line to plot the regression lines. |
fit.lwd |
The width of the line for the regression lines. |
add.legend |
add a legend to the plot? |
lty |
The line type of the <log10(radius)> functions. |
lwd |
The line width of the <log10(radius)> functions. |
main |
A title for the plot. |
xlab |
A title for the x axis. |
ylab |
A title for the y axis. |
type |
Type of plot (see |
log |
A character string which contains "x" if the x axis is to be logarithmic, "y" if the y axis is to be logarithmic and "xy" or "yx" if both axes are to be logarithmic. |
ylim |
Numeric vector of length 2, giving the y coordinates range. |
localScalingExp |
add a plot of the local information dimension scaling exponents? |
The information dimension is a particular case of the generalized
correlation dimension when setting the order q = 1. It is possible to
demonstrate that the information dimension D_1
may be defined as:
D_1=lim_{r \rightarrow 0} <\log p(r)>/\log(r)
.
Here, p(r)
is the probability of finding a neighbour in a
neighbourhood of size r
and <> is the mean value. Thus, the
information dimension specifies how the average Shannon information scales
with the radius r
. The user should compute the information dimension
for different embedding dimensions for checking if D_1
saturates.
In order to estimate D_1
, the algorithm looks for the scaling
behaviour of the the average radius that contains a given portion
(a "fixed-mass") of the total points in the phase space. By performing
a linear regression of \log(p)\;Vs.\;\log(<r>)
(being
p
the fixed-mass of the total points), an estimate of D_1
is
obtained.
The algorithm also introduces a variation of p
for achieving a better
performance: for small values of p
, all the points in the time
series (N
) are considered for obtaining p=n/N
. Above a maximum
number of neighbours kMax
, the algorithm obtains p
by decreasing
the number of points considerd from the time series M<N
.
Thus p = kMax/M
.
Even with these improvements, the calculations for the information dimension are heavier than those needed for the correlation dimension.
A infDim object that consist of a list with two components: log.radius and fixed.mass. log.radius contains the average log10(radius) in which the fixed.mass can be found.
The fixedMass function returns the fixed mass vector used in the information dimension algorithm.
The logRadius function returns the average log(radius) computed on the information dimension algorithm.
The embeddingDims function returns the embeddings in which the information dimension was computed
The 'estimate' function estimates the information dimension of the 'infDim' object by by averaging the slopes of the embedding dimensions specified in the use.embeddings parameter. The slopes are determined by performing a linear regression over the fixed mass' range specified in 'regression.range'. If do.plot is TRUE, a graphic of the regression over the data is shown.
The 'plot' function plots the computations performed for the information dimension estimate: a graphic of <log10(radius)> Vs fixed mass. Additionally, the inverse of the local scaling exponents can be plotted.
The plotLocalScalingExp function plots the inverse of the local scaling exponentes of the information dimension (for reasons of numerical stability).
Constantino A. Garcia
H. Kantz and T. Schreiber: Nonlinear Time series Analysis (Cambridge university press)
corrDim
.
## Not run:
x=henon(n.sample= 3000,n.transient= 100, a = 1.4, b = 0.3,
start = c(0.8253681, 0.6955566), do.plot = FALSE)$x
leps = infDim(x,min.embedding.dim=2,max.embedding.dim = 5,
time.lag=1, min.fixed.mass=0.04, max.fixed.mass=0.2,
number.fixed.mass.points=100, radius =0.001,
increasing.radius.factor = sqrt(2), number.boxes=100,
number.reference.vectors=100, theiler.window = 10,
kMax = 100,do.plot=FALSE)
plot(leps,type="l")
colors2=c("#999999", "#E69F00", "#56B4E9", "#009E73",
"#F0E442", "#0072B2", "#D55E00")
id.estimation = estimate(leps,do.plot=TRUE,use.embeddings = 3:5,
fit.lwd=2,fit.col=1,
col=colors2)
cat("Henon---> expected: 1.24 predicted: ", id.estimation ,"\n")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.