mutualInformation: Average Mutual Information (AMI)

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

View source: R/mutualInformation.R

Description

Functions for estimating the Average Mutual Information (AMI) of a time series.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
mutualInformation(time.series, lag.max = NULL, n.partitions = NULL,
  units = c("Nats", "Bits", "Bans"), do.plot = TRUE, ...)

## S3 method for class 'mutualInf'
plot(x, main = "Average Mutual Information (AMI)",
  xlab = "Time lag", ylab = NULL, type = "h", ...)

## S3 method for class 'mutualInf'
as.numeric(x, ...)

## S3 method for class 'mutualInf'
x[i]

## S3 method for class 'mutualInf'
x[[i]]

Arguments

time.series

The observed time series.

lag.max

Largest lag at which to calculate the AMI.

n.partitions

Number of bins used to compute the probability distribution of the time series.

units

The units for the mutual information. Allowed units are "Nats", "Bits" or "Bans" (somethings called Hartleys). Default is "Nats".

do.plot

Logical value. If TRUE, the AMI is plotted

...

Further arguments for the plotting function.

x

A mutualInf object.

main

Title for the plot.

xlab

Title for the x axis.

ylab

Title for the y axis.

type

Type of plot to be drawn.

i

Indices specifying elements to extract.

Details

The Average Mutual Information (AMI) measures how much one random variable tells us about another. In the context of time series analysis, AMI helps to quantify the amount of knowledge gained about the value of x(t+tau) when observing x(t).

To measure the AMI iof a time series, we create a histogram of the data using bins. Let Pi the probability that the signal has a value inside the ith bin, and let Pij(tau) be the probability that x(t) is in bin i ans x(t+tau) is in bin j. Then, AMI for time delay tau is defined as

AMI(tau) = sum( Pij log( Pij / (Pi*Pj) ) )

Depending on the base of the logarithm used to define AMI, the AMI is measured in bits (base 2, also called shannons), nats (base e) or bans (base 10, also called hartleys).

Value

A mutualInf object that consist of a list containing all the relevant information of the AMI computation: time.lag, mutual.information, units and n.partitions.

Author(s)

Constantino A. Garcia

References

H. Kantz and T. Schreiber: Nonlinear Time series Analysis (Cambridge university press) H. Abarbanel: Analysis of observed chaotic data (Springer, 1996).

See Also

timeLag

Examples

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

Example output

Loading required package: Matrix
Loading required package: rgl
Loading required package: tseries
Loading required package: TSA
Loading required package: leaps
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-17. For overview type 'help("mgcv-package")'.

Attaching package: 'TSA'

The following objects are masked from 'package:stats':

    acf, arima

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

    tar

Loading required package: Rcpp

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 

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