View source: R/GrangerCausalityIndeces.R
PMIME | R Documentation |
computes the measure R_{X->Y|Z}
for all combinations of X
and Y
time
series from the multivariate time series given in matrix 'allM', of size
N x K
, where Z
contains the rest K-2
time series.
The components of X,Y, and Z, are found from a mixed embedding aiming at
explaining Y
. The mixed embedding is formed by using the progressive
embedding algorithm based on conditional mutual information (CMI).
CMI is estimated by the method of nearest neighbors (Kraskov's method).
The function is the same as PMIMEsig.m but defines the stopping criterion
differently, using a fixed rather than adjusted threshold. Specifically,
the algorithm terminates if the contribution of the selected lagged
variable in explaining the future response state is small enough, as
compared to a threshold 'A'. Concretely, the algorithm terminates if
I(x^F; w| wemb) / I(x^F; w,wemb) <= A
where I(x^F; w| wemb)
is the CMI of the selected lagged variable w and
the future response state x^F given the current mixed embedding vector,
and I(x^F; w,wemb)
is the MI between x^F
and the augmented mixed
embedding vector wemb, w
.
We experienced that in rare cases the termination condition is not
satisfied and the algorithm does not terminate. Therefore we included a
second condition for termination of the algorithm when the ratio
I(x^F; w| wemb) / I(x^F; w,wemb)
increases in the last two embedding
cycles.
The derived R
measure indicates the information flow of time series X
to
time series Y
conditioned on the rest time series in Z
. The measure
values are stored in a K x K
matrix 'RM' and given to the output, where
the value at position (i,j)
indicates the effect from i
to j
(row to
col), and the (i,i)
components are zero. The library RANN was used
for the nearest neighbor estimation of the mutual information
PMIME(allM, Lmax = 5, Tl = 1, nnei = 5, A = 0.03, showtxt = 1)
allM |
the N x K matrix of the K time series of length N. |
Lmax |
the maximum delay to search for X and Y components for the mixed embedding vector ,default is 5. |
Tl |
Tl steps ahead that the mixed embedding vector has to explain. Note that if T>1 the future vector is of length T and contains the samples at times t+1,..,t+T ,dafault is 1. |
nnei |
number of nearest neighbors for density estimation ,default is 5 |
A |
the threshold for the ratio of CMI over MI of the lagged variables for the termination criterion. |
showtxt |
: if 0 or negative do not print out anything, if 1 print out the response variable index at each run, if 2 or larger print also info for each embedding cycle ,default is 1. |
RM: A K x K matrix containing the R values computed by PMIME using the surrogates for setting the stopping criterion. ecC: cell array of K components, where each component is a matrix of size E x 5, and E is the number of embedding cycles. For each embedding cycle the following 5 results are stored: 1. variable index, 2. lag index, 3. CMI of the selected lagged variable w and the future response state x^F given the current mixed embedding vector, I(x^F; w| wemb). 4. MI between x^F and the augmented mixed embedding vector wemb w, I(x^F; w,wemb). 5. The ration of 3. and 4.: I(x^F; w| wemb)/I(x^F; w,wemb)
Kugiumtzis, D. "Direct-Coupling Information Measure from Nonuniform Embedding." Physical Review E 87, no. 6 (June 25, 2013): 062918. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1103/PhysRevE.87.062918")}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.