Skip to content

TE for sequences with different lags #49

@dmattek

Description

@dmattek

I have trouble understanding parameters lx and ly (the number of lagged values affecting the current value of x/y) and results of the calculation for time series with different lags.

Suppose I have two identical time series v1 and v2 (a sine wave) but v2 is lagged by a single time point:

require(RTransferEntropy)

n.shift = 1 # the number of points by which v2 is delayed with respect to v1
vt = seq(0, 10*pi, 0.1)
v1 = sin(vt)
v2 = vecShift(v1, in.n = n.shift, in.circle = T)

The vecShift function is available here. It shifts a vector by a user-defined number of points. Here, I'm using periodic boundary conditions.

The TE calculation gives me:

RTransferEntropy::transfer_entropy(v1, v2, lx = n.shift, ly = n.shift)

Direction        TE   Eff. TE  Std.Err.   p-value    sig
-----------------------------------------------------------
     X->Y    0.3217    0.3080    0.0067    0.0000    ***
     Y->X    0.0234    0.0092    0.0073    0.1000     

Now, the same sine wave is lagged by 10 points:

n.shift = 10
v2 = vecShift(v1, in.n = n.shift, in.circle = T)

RTransferEntropy::transfer_entropy(v1, v2, lx = n.shift, ly = n.shift)

Direction        TE   Eff. TE  Std.Err.   p-value    sig
-----------------------------------------------------------
     X->Y    0.2415    0.1129    0.0292    0.0000    ***
     Y->X    0.0355    0.0000    0.0285    1.0000       

What I don't get is why TE is smaller than in the first calculation. I'm still comparing the same time series. The lag is larger but from what I understand I'm also calculating TE at a longer lag (by setting lx and ly parameters).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions