Forecasting Correlated Time Series


I’m working on something where I have one time series (A) that has a time lagged correlation to another (B).
I want to automate something whereby:

  • if A is given then an attempt to forecast B is made
  • the system then figures out how accurate it’s B forecasts are depending on previous attempts

Is this something HTM can help me with or am I barking up the wrong tree?




Hi Colin, welcome to the forum. :smiley:

Since HTM works with SDRs and is a unsupervised learning algorithm. Forecasting B’s value base on A is impossible in HTM. However performing anomaly detection via A’s value and forecasting B’s SDR representation base on A is possible via non-standard HTM - by abusing the SpatialPooler’s learning algorithm. Is that what you are looking for?

This answered my question perfectly.
I don’t think HTM will suit my needs (I suspected it didn’t) but you saved me a lot of research time.

Wait a minute, this is not true. You can make temporal predictions in HTM based upon multiple inputs. The Hot Gym prediction tutorial is an example of this.

Given one or many temporal inputs, which can be semantically encoded into binary streams (like datetimes & scalars), HTM can generate predictions of future values of one of those inputs. It can also give you an overall anomaly indication of the system you can use to flag anomalous states.


And often times with NuPIC it turns out that B is best forecasted by its own history alone, without using A at all.

This question, of which input field(s) is(are) optimal for a model to forecast field X, is addressed by swarming as well. It goes through different combinations of hyper parameters (including input field subsets), keeping track of which models do best in terms of %error on the ‘predictedField’.

In your case though since there are just 2 possible input fields including the predictedField, you could skip the swarming and do your own sort of grid search. I would test across ranges of:

  1. Input field subset (‘B’ or ‘A’ & ‘B’)
  2. Encoding parameters (for instance different min/max values for scalar encoders)
  3. Time aggregation levels (for instance sampling changes over 5, 10, 30 and 60-minute spans) – to my knowledge swarming doesn’t check this

If the system(s) generating your predictedField can be expected to have any temporal structure then HTM should certainly be worth trying IMO.

1 Like

By temporal structure do you mean periodicity?

1 Like

Yes essentially, that there are patterns of a sequential nature so the transitions from input to input are not random.