1
$\begingroup$

I am starting to learn machine learning and I would like advice of how to model that random measure Y will increase within n minutes if random measure X increases.

X and Y have different units (GBP and USD) so I am using returns (percentage change) to make them the same unit.

My data looks like this

Time, X, Y
00:00, 1%, 0%
00:01, 0%, 1%
00:02, 2%, 0%
00:03, 0%, 2%

Just from observing this data you can see that Y increases after one second after X increases but not sure the best way how to model this!

$\endgroup$
1
  • 1
    $\begingroup$ With only this few observations, nothing very general can be drawn. If you can tell that $Y(t) = X(t-1)$ just by having a quick look at your data, this is probably not a machine learning problem. $\endgroup$ – Romain Reboulleau Oct 12 '18 at 20:43
1
$\begingroup$

You need to look for lag effects - the easiest thing is to try a number of lag time windows and look at how they correlate with target. If you think there is a distinctive lag impact, then at some point the correlation strength should increase.

$\endgroup$
0
$\begingroup$

Try to add a "previousX" field. That will certainly help. The only way i know to do this is to iterate through the whole dataset. If someone has an idea how to do this in a quicker way using numpy/pandas methods, please share.

$\endgroup$
2
  • $\begingroup$ I was thinking of doing that but that would only work if the lag was just 1 second. The lags could be longer than one second so would need to shift by n seconds. $\endgroup$ – Jamsia Jul 15 '18 at 15:50
  • $\begingroup$ I see. Then you can copy the whole dataset, then change the index field "Time" by as many seconds as you need, and then join them by Time field. $\endgroup$ – Timur Jul 16 '18 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.