Re: [jidt-discuss] How does auto Embedding "Ragwitz" works?

54 views
Skip to first unread message

Joseph Lizier

unread,
Jan 31, 2022, 12:43:09 AM1/31/22
to JIDT Discussion list
Dear Aleksander,

It would be good if you could provide a minimal code example that reproduces this behaviour.

I've written up what you describe as the attached code - note very carefully the properties I've set here to make the results align with what you are describing. If you run in debug mode with a breakpoint at the call to computePredictionErrorsFromObservations() and then step through into partialComputePredictionErrorFromObservations() in the associated KSG estimator, you can then step through the loop that you are referring to. When I do that, all of the nearest neighbours (including the 4th nearest neighbour as X[2] = 7) are as you expect.
So, I'm not sure what you're referring to here. Again - if you can provide a similar minimal example to reproduce then we'll get there a lot faster.

--joe



On Mon, 31 Jan 2022 at 15:37, Aleksander Janczewski <janczew...@gmail.com> wrote:
Dear Professor Lizier, 

I have very carefully studied and followed step by step the code that performs auto-embedding of both source and destination variables using Ragwitz criterion, and I am still unable to decipher the exact logic behind the operations that take place. Following a very simplistic example below:

If we assume destination:  Y = [10, 18, 12, 14, 16, 20, 24, 22, 28, 26] 
and source:                          X  = [  5,   0,   7,    4,   3,   2,   6,   8,    1,  9 ]
(with kNN=4, say k_max=2, tau_max=2)

"Ragwitz" Autoembedding of destination: 
in the first step we will look at  k=1 and tau =1, hence we are looking at
Destination: Y_i+1=  [18, 12, 14, 16, 20, 24, 22, 28, 26]
Source:         X        = [  5,   0,   7,    4,   3,   2,   6,   8,    1] 

for t=0:
 destValuetoPredict = 18
which corresponds to source X[0] = 5

In my understanding, we now shall look for 4 nearest neighbours of X[0] = 5 
which are: X[3] = 4  --------corresponding to --->Y_i+1[3] = 16
                   X[4] = 3  --------corresponding to --->Y_i+1[4] = 20
                   X[6] = 6  --------corresponding to --->Y_i+1[6] = 22
                   X[2].= 7  --------corresponding to --->Y_i+1[2] = 14
now, all of these 4 Y_i+1 values (the neighbourDestValue) will be the predictors for destValuetoPredict. So we simply add them up and take the mean, which will be final prediction for this particular destValuetoPredict.

Now, my logic does not fully follow when I run this test in the code. For the above presented situation I am observing the following neighbourDestValue's:
                                   Y_i+1[3] = 16
                                   Y_i+1[4] = 20
                                   Y_i+1[2] = 14
                                   Y_i+1[1] = 12 

While the first 3 neighbourDestValues do make sense and follow my logic, the 4th one does not. I have observed that this in fact is the case for every single timepoint of destination, there are always 3 values that follow my understanding and one of them that does not. Could you please advise on this issue and help me understand how does the algorithm work exactly?

Thank you very much in advance.

With best regards,
Aleksander

--
JIDT homepage: https://github.com/jlizier/jidt
---
You received this message because you are subscribed to the Google Groups "Java Information Dynamics Toolkit (JIDT) discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jidt-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jidt-discuss/efe2c8bd-e0e4-487d-9cf0-33ff29de95e4n%40googlegroups.com.
RagwitzTester.java

Aleksander Janczewski

unread,
Feb 1, 2022, 12:37:17 PM2/1/22
to Java Information Dynamics Toolkit (JIDT) discussion
Dear Professor Lizier,

Thank you very much for your prompt response.

Your remark actually helped me resolve my problem. Now I see that I didn't mention the fact that I was considering auto embedding for Transfer Entropy, which requires one to also account for the past vector of the destination when searching for NNs (something I missed in my reasoning). Since you tried to reproduce my problem with auto embedding for Mutual information, not conditional mutual information, you were not able to reproduce my "problem". This actually made me realize that my reasoning was correct for the MI case, but not for conditional MI.

I apologize for this confusing thread, I will keep in mind to provide a minimal example to reproduce for future threads.

With Best Regards,
Aleksander
Reply all
Reply to author
Forward
0 new messages