I've uni-variate demand data (Weekly data for 2 years), and wish to do a directional forecast based on the data. Magnitude of the forecast is not important here, but directional accuracy is of foremost importance. Please suggest what robust methods can be chosen?
-
I’ve heard claims like this before and have yet to figure out when direction would matter but magnitude would not. Even for stock data, an argument might be that you would sell if the predicted direction is down and buy if the predicted direction is up. Still, you need to have some idea about magnitude to keep your earnings from being washed out by trading fees and capital gains taxes. // I’m slowly but surely putting together a question about this to post on Quant.SE. – Dave Oct 06 '22 at 03:27
-
Hi Dave: A lot of times a directional bet is taken using leverage ( macro hedge funds do this ) so the magnitude matters a lot less than direction. You win a lot when you win and lose a lot when you lose. So, direction is what matters. – mlofton Jun 15 '23 at 11:05
-
@mlofton Leverage seems to make the situation even worse: a few misses (no one gets perfect accuracy) when the magnitudes are large could leave you not only having lost money but having lost more than 100% of the initial investor money. – Dave Jun 15 '23 at 21:01
-
that's true but, particularly in macro, the owner is so wealthy that it's often mostly his-her own money. or the majority of it is his-her own money. let's face it, once it's your money involved, the best excuse is : "we lost a lot also so don't feel bad". – mlofton Jun 16 '23 at 14:30
2 Answers
In terms of algorithms, I cannot suggest any without a sense of the data i.e. does it decompose well into trend, seasonality and remainder effects or how it is affected by other variables etc.
But since the question has an r tag, I would recommend the prophet package (documentation). It performs better than packages like forecast and other standard algorithms when it comes to time series with a lot of variation (eg. finance data). It also gives good directional accuracy as demonstrated in this blog.
- 373
- 2
- 7
This is a binary outcome: either up or down. So many models can be used to do this, ranging from logistic regressions to random forests to neural networks. Perhaps consult the classification and binary-data tags, though the former is somewhat of a misnomer because many so-called "classification" models like logistic regressions do not do classification. (Logistic regression in particular predicts on a continuum. If you want to apply a threshold to bin those continuous predictions into discrete categories, that is a second stage of a two-stage classification pipeline, with the logistic regression being the first stage.)
You also have a time component to your predictions. We have multiple questions about predicting binary time series. Modern approaches to predicting binary or categorical time series data might involve recurrent neural networks and their refinements (e.g., long short-term memory (LSTM)).
I have my doubts that you should only predict up/down, however. Some of my argument is discussed here and here. This and this apply, too. It is not a guarantee that high accuracy in predicting direction leads to profits. For instance, you can bet the right way nine out of ten times ($90\%$ accuracy) or $99$ out of $100$ times ($99\%$ accuracy), yet if that one wrong bet costs you dearly, you have lost money despite the high accuracy in predicting the sign.
As an example of this, Long-Term Capital Management got their predictions right almost every time (basically predicting that bond prices would get closer to each other and being correct about that almost every time). Nonetheless, when their predictions were not correct, they lost a huge amount of money and had to close.
(Predicting on a continuum doesn't necessarily solve this, and I have started to think of a lot of predictions in terms of reinforcement learning where the prediction is not of interest so much as the action to take ("policy" in reinforcement learning lingo) to get the best outcome.)
- 62,186