Skip to content
40 Reps

Stock forecasts against 'tomorrow equals today'

Do the 2022 price models beat the simplest possible forecast once the test days come after the training days?

Short answer

On a time-ordered split the Apple LSTM misses the close by 38.7% on average, against 1.7% for 'tomorrow equals today'. The linear model in notebook 05 also loses to 'no change' (0.50% versus 0.36%).

Five forecasts, one question

Every price model in the log was judged in 2022 by a score that never asked the obvious question: would “tomorrow's price equals today's price” have done just as well? That flat forecast costs nothing and is famously hard to beat for prices. Here each model is tested the way a forecast is used, on days after the ones it learnt from.

Mean absolute percentage error on time-ordered test periods
NotebookModel MAPEFlat MAPEBeats flat?
01 LSTM, Apple38.69%1.67%No
09 LSTM, Netflix14.57%2.17%No
05 Linear, five days ahead0.50%0.36%No
28 AutoTS, Tata Motors4.87%2.70%No
32 AutoTS, Apple3.01%2.18%No

MAPE is the average absolute error as a percentage of the true price. The flat forecast repeats the last known close. For 28 and 32 the numbers are averages over four five-day windows, so treat them as indicative.

01 and 09: the LSTMs

In 2022 both notebooks fed the same day's open, high, low and volume into the network and asked for that day's close, after shuffling the days. That set-up has two problems. The high and low already bracket the close, so it is not a forecast at all. And shuffling lets the network learn from days on both sides of each test day. The test rows were never scored, so I scored them now, then repeated the training with the last 20% of days held out in order.

The re-run reproduces the 2022 training closely: Apple's loss ends at 3.31 against 3.62 in 2022.

01 AAPL, 3,447 trading days

As run in 2022: shuffled split (MAPE, lower is better)
LSTM
1.00%
Yesterday's close
1.29%
(High + low) / 2same inputs, no training
0.59%
Time-ordered split: train on the past, test on the future
LSTM
38.69%
Yesterday's close
1.67%
(High + low) / 2
0.80%

AAPL: absolute error as a share of the close, 20-day rolling mean

Test period 2020-02-05 to 2022-10-28. The network never saw a close above $81.09 during training, and 89% of the test days were above that.

  • LSTM (time-ordered)
  • Yesterday's close
0%10%20%30%40%50%60%2020-02-052020-12-312021-12-012022-10-28
Show the numbers as a table
DateLSTM (time-ordered)Yesterday's close
2020-02-050.6%0.8%
2020-02-101.0%1.0%
2020-02-121.0%1.2%
2020-02-181.0%1.1%
2020-02-211.0%1.2%
2020-02-251.2%1.6%
2020-02-281.4%1.9%
2020-03-041.5%2.4%
2020-03-061.6%2.5%
2020-03-111.9%3.3%
2020-03-162.4%5.0%
2020-03-182.6%5.2%
2020-03-233.3%5.2%
2020-03-263.2%5.4%
2020-03-303.5%5.3%
2020-04-023.8%5.1%
2020-04-074.1%4.8%
2020-04-093.8%4.2%
2020-04-153.6%3.1%
2020-04-203.2%2.9%
2020-04-223.4%2.6%
2020-04-273.1%2.3%
2020-04-302.8%2.2%
2020-05-042.6%2.2%
2020-05-072.3%1.8%
2020-05-122.1%1.6%
2020-05-142.0%1.6%
2020-05-191.5%1.5%
2020-05-211.2%1.5%
2020-05-270.9%1.3%
2020-06-010.7%1.0%
2020-06-030.7%0.9%
2020-06-080.9%1.0%
2020-06-111.4%1.3%
2020-06-151.7%1.3%
2020-06-182.4%1.2%
2020-06-233.3%1.4%
2020-06-254.0%1.5%
2020-06-304.9%1.7%
2020-07-065.9%1.7%
2020-07-086.5%1.6%
2020-07-137.6%1.3%
2020-07-168.7%1.2%
2020-07-209.4%1.3%
2020-07-2310.0%1.3%
2020-07-2810.3%1.2%
2020-07-3010.7%1.3%
2020-08-0413.2%1.8%
2020-08-0716.0%1.9%
2020-08-1117.8%2.1%
2020-08-1420.8%2.2%
2020-08-1923.9%2.1%
2020-08-2126.7%2.2%
2020-08-2631.2%2.1%
2020-08-3134.1%1.6%
2020-09-0235.7%1.9%
2020-09-0836.3%2.3%
2020-09-1136.6%2.3%
2020-09-1536.7%2.5%
2020-09-1835.8%2.7%
2020-09-2334.0%2.8%
2020-09-2532.8%2.9%
2020-09-3031.5%2.8%
2020-10-0530.7%2.6%
2020-10-0730.6%2.3%
2020-10-1231.2%2.3%
2020-10-1532.1%2.2%
2020-10-1933.0%2.1%
2020-10-2234.1%1.9%
2020-10-2734.3%1.7%
2020-10-2934.1%2.0%
2020-11-0333.4%1.9%
2020-11-0633.6%2.1%
2020-11-1033.2%1.8%
2020-11-1333.1%1.8%
2020-11-1833.3%1.7%
2020-11-2033.5%1.7%
2020-11-2533.6%1.7%
2020-11-3034.1%1.3%
2020-12-0335.5%1.2%
2020-12-0836.0%1.1%
2020-12-1036.3%1.1%
2020-12-1536.7%1.3%
2020-12-1837.4%1.3%
2020-12-2238.3%1.3%
2020-12-2839.7%1.4%
2020-12-3140.7%1.3%
2021-01-0541.1%1.5%
2021-01-0841.6%1.6%
2021-01-1342.1%1.7%
2021-01-1542.1%1.6%
2021-01-2142.5%1.8%
2021-01-2643.1%1.8%
2021-01-2843.3%1.8%
2021-02-0243.4%1.9%
2021-02-0543.9%1.7%
2021-02-0944.2%1.6%
2021-02-1244.6%1.4%
2021-02-1844.7%1.4%
2021-02-2244.3%1.3%
2021-02-2543.0%1.3%
2021-03-0242.2%1.3%
2021-03-0441.5%1.4%
2021-03-0940.2%1.7%
2021-03-1239.1%1.8%
2021-03-1638.6%1.9%
2021-03-1937.9%2.0%
2021-03-2437.6%2.1%
2021-03-2637.6%1.9%
2021-03-3137.3%1.6%
2021-04-0637.8%1.4%
2021-04-0838.3%1.3%
2021-04-1339.1%1.4%
2021-04-1639.9%1.3%
2021-04-2040.5%1.2%
2021-04-2341.5%1.2%
2021-04-2842.5%1.2%
2021-04-3043.0%1.2%
2021-05-0543.2%1.2%
2021-05-1043.1%1.2%
2021-05-1242.6%1.1%
2021-05-1742.0%1.2%
2021-05-2041.5%1.2%
2021-05-2441.1%1.3%
2021-05-2740.5%1.3%
2021-06-0240.1%1.1%
2021-06-0439.9%1.2%
2021-06-0939.8%1.0%
2021-06-1440.0%0.9%
2021-06-1640.2%0.9%
2021-06-2140.7%0.9%
2021-06-2341.0%0.9%
2021-06-2841.6%0.8%
2021-07-0142.5%0.8%
2021-07-0643.2%0.9%
2021-07-0944.4%1.0%
2021-07-1445.5%1.0%
2021-07-1646.2%1.0%
2021-07-2147.0%1.1%
2021-07-2647.9%1.2%
2021-07-2848.3%1.2%
2021-08-0248.8%1.1%
2021-08-0549.0%1.0%
2021-08-0949.0%1.0%
2021-08-1249.0%0.9%
2021-08-1749.3%0.7%
2021-08-1949.3%0.7%
2021-08-2449.3%0.7%
2021-08-2749.5%0.7%
2021-08-3149.7%0.8%
2021-09-0350.0%0.9%
2021-09-0950.5%1.0%
2021-09-1350.5%1.1%
2021-09-1650.5%0.9%
2021-09-2150.2%1.0%
2021-09-2350.1%1.1%
2021-09-2849.9%1.1%
2021-10-0149.3%1.1%
2021-10-0548.8%1.2%
2021-10-0848.3%1.0%
2021-10-1347.9%1.0%
2021-10-1547.8%1.0%
2021-10-2048.0%1.0%
2021-10-2548.1%0.9%
2021-10-2748.4%0.8%
2021-11-0148.9%0.8%
2021-11-0449.4%0.8%
2021-11-0849.7%0.8%
2021-11-1150.0%0.8%
2021-11-1650.2%0.7%
2021-11-1850.4%0.9%
2021-11-2351.0%0.9%
2021-11-2951.4%1.0%
2021-12-0151.8%1.1%
2021-12-0652.4%1.2%
2021-12-0953.4%1.4%
2021-12-1354.2%1.6%
2021-12-1655.1%1.8%
2021-12-2155.6%1.8%
2021-12-2356.0%1.8%
2021-12-2956.7%1.5%
2022-01-0357.3%1.6%
2022-01-0557.5%1.5%
2022-01-1057.4%1.4%
2022-01-1257.4%1.3%
2022-01-1857.3%1.1%
2022-01-2157.0%1.2%
2022-01-2556.5%1.1%
2022-01-2855.9%1.4%
2022-02-0255.7%1.4%
2022-02-0455.7%1.2%
2022-02-0955.8%1.3%
2022-02-1455.6%1.4%
2022-02-1655.7%1.3%
2022-02-2255.9%1.4%
2022-02-2556.0%1.6%
2022-03-0155.8%1.2%
2022-03-0455.5%1.3%
2022-03-0954.9%1.5%
2022-03-1154.5%1.6%
2022-03-1653.8%1.8%
2022-03-2153.6%1.9%
2022-03-2353.8%1.8%
2022-03-2854.2%1.8%
2022-03-3154.6%1.8%
2022-04-0455.0%1.7%
2022-04-0755.6%1.6%
2022-04-1256.2%1.4%
2022-04-1456.4%1.5%
2022-04-2056.4%1.3%
2022-04-2556.1%1.3%
2022-04-2755.5%1.4%
2022-05-0254.9%1.7%
2022-05-0554.3%1.9%
2022-05-0953.8%2.0%
2022-05-1252.9%2.3%
2022-05-1752.0%2.4%
2022-05-1951.1%2.8%
2022-05-2450.1%2.7%
2022-05-2749.3%2.6%
2022-06-0149.0%2.6%
2022-06-0648.5%2.4%
2022-06-0948.2%2.1%
2022-06-1347.8%2.3%
2022-06-1647.0%2.1%
2022-06-2246.7%2.0%
2022-06-2446.7%2.1%
2022-06-2946.3%2.0%
2022-07-0545.7%2.0%
2022-07-0745.6%2.1%
2022-07-1245.8%1.8%
2022-07-1546.7%1.6%
2022-07-1947.5%1.6%
2022-07-2248.5%1.5%
2022-07-2648.9%1.4%
2022-07-2950.0%1.5%
2022-08-0351.0%1.5%
2022-08-0551.6%1.4%
2022-08-1052.6%1.4%
2022-08-1553.6%1.3%
2022-08-1754.2%1.2%
2022-08-2254.9%1.2%
2022-08-2555.5%1.1%
2022-08-2955.5%1.2%
2022-09-0155.2%1.1%
2022-09-0754.8%1.2%
2022-09-0954.4%1.2%
2022-09-1453.8%1.6%
2022-09-1952.9%1.7%
2022-09-2152.6%1.8%
2022-09-2651.9%1.6%
2022-09-2951.3%1.8%
2022-10-0350.8%2.0%
2022-10-0650.3%2.0%
2022-10-1149.4%1.7%
2022-10-1348.9%1.7%
2022-10-1848.2%1.8%
2022-10-2147.8%1.8%
2022-10-2547.8%1.9%
2022-10-2848.2%2.0%

09 NFLX, 3,449 trading days

As run in 2022: shuffled split (MAPE, lower is better)
LSTM
4.09%
Yesterday's close
2.04%
(High + low) / 2same inputs, no training
0.99%
Time-ordered split: train on the past, test on the future
LSTM
14.57%
Yesterday's close
2.17%
(High + low) / 2
1.02%

NFLX: absolute error as a share of the close, 20-day rolling mean

Test period 2020-02-07 to 2022-11-01. The network never saw a close above $418.97 during training, and 64% of the test days were above that.

  • LSTM (time-ordered)
  • Yesterday's close
0%10%20%30%40%2020-02-072021-01-052021-12-032022-11-01
Show the numbers as a table
DateLSTM (time-ordered)Yesterday's close
2020-02-070.2%0.0%
2020-02-121.1%0.9%
2020-02-141.3%0.7%
2020-02-201.8%0.7%
2020-02-251.6%1.1%
2020-02-271.6%1.5%
2020-03-031.7%1.6%
2020-03-061.7%1.8%
2020-03-101.8%2.3%
2020-03-132.0%3.2%
2020-03-182.3%4.1%
2020-03-202.3%4.3%
2020-03-252.3%4.4%
2020-03-302.3%4.7%
2020-04-012.2%4.5%
2020-04-062.4%4.4%
2020-04-092.3%3.6%
2020-04-142.5%3.2%
2020-04-172.9%3.0%
2020-04-223.8%2.9%
2020-04-244.3%2.5%
2020-04-294.9%2.5%
2020-05-045.8%2.5%
2020-05-066.3%2.3%
2020-05-117.1%2.0%
2020-05-147.2%1.7%
2020-05-187.5%1.5%
2020-05-217.9%1.5%
2020-05-267.8%1.7%
2020-05-297.9%1.5%
2020-06-038.0%1.4%
2020-06-057.8%1.4%
2020-06-107.8%1.4%
2020-06-157.3%1.4%
2020-06-177.2%1.7%
2020-06-227.6%1.6%
2020-06-258.5%1.5%
2020-06-298.8%1.7%
2020-07-029.9%2.0%
2020-07-0811.4%2.0%
2020-07-1012.9%2.3%
2020-07-1515.1%2.3%
2020-07-2016.5%2.6%
2020-07-2216.8%2.5%
2020-07-2717.5%2.4%
2020-07-3018.0%2.1%
2020-08-0318.1%1.9%
2020-08-0618.3%2.0%
2020-08-1117.0%1.9%
2020-08-1316.3%2.0%
2020-08-1816.0%1.5%
2020-08-2116.2%1.6%
2020-08-2516.2%1.5%
2020-08-2817.3%2.1%
2020-09-0218.3%2.2%
2020-09-0418.6%2.3%
2020-09-1019.1%2.3%
2020-09-1519.2%2.5%
2020-09-1719.0%2.6%
2020-09-2218.8%2.6%
2020-09-2517.7%2.2%
2020-09-2917.1%2.2%
2020-10-0216.4%2.2%
2020-10-0716.6%2.6%
2020-10-0917.5%2.5%
2020-10-1418.9%2.3%
2020-10-1920.3%2.1%
2020-10-2120.7%2.3%
2020-10-2620.8%2.1%
2020-10-2920.5%2.0%
2020-11-0220.0%2.0%
2020-11-0519.4%1.8%
2020-11-1018.1%2.2%
2020-11-1217.3%2.2%
2020-11-1716.1%2.2%
2020-11-2016.0%1.8%
2020-11-2415.9%2.0%
2020-11-3015.9%1.6%
2020-12-0216.2%1.6%
2020-12-0716.1%1.6%
2020-12-1016.6%1.2%
2020-12-1417.0%1.3%
2020-12-1718.2%1.4%
2020-12-2219.3%1.3%
2020-12-2419.8%1.3%
2020-12-3020.5%1.3%
2021-01-0521.2%1.6%
2021-01-0721.0%1.7%
2021-01-1221.1%1.6%
2021-01-1520.6%1.5%
2021-01-2020.7%2.2%
2021-01-2521.6%2.3%
2021-01-2822.1%2.7%
2021-02-0122.1%2.6%
2021-02-0422.8%2.5%
2021-02-0923.9%2.4%
2021-02-1124.8%2.3%
2021-02-1726.0%2.2%
2021-02-2225.3%1.5%
2021-02-2425.1%1.6%
2021-03-0125.4%1.2%
2021-03-0425.1%1.4%
2021-03-0824.4%1.5%
2021-03-1123.4%1.7%
2021-03-1622.6%1.7%
2021-03-1822.1%1.8%
2021-03-2321.7%1.9%
2021-03-2620.9%2.1%
2021-03-3020.4%2.0%
2021-04-0520.7%1.8%
2021-04-0821.8%1.6%
2021-04-1222.3%1.4%
2021-04-1522.8%1.5%
2021-04-2023.7%1.3%
2021-04-2223.4%1.5%
2021-04-2723.3%1.3%
2021-04-3023.0%1.1%
2021-05-0422.4%1.2%
2021-05-0721.2%1.2%
2021-05-1219.8%1.4%
2021-05-1418.9%1.4%
2021-05-1917.8%1.0%
2021-05-2417.6%1.1%
2021-05-2617.5%1.1%
2021-06-0117.3%1.1%
2021-06-0417.2%1.1%
2021-06-0817.1%0.9%
2021-06-1117.1%0.7%
2021-06-1617.2%0.8%
2021-06-1817.3%0.7%
2021-06-2317.4%0.8%
2021-06-2517.8%0.9%
2021-06-3018.5%1.0%
2021-07-0619.5%1.0%
2021-07-0820.2%1.0%
2021-07-1321.3%0.9%
2021-07-1622.4%1.0%
2021-07-2022.9%1.0%
2021-07-2322.9%1.0%
2021-07-2822.6%0.9%
2021-07-3022.4%0.9%
2021-08-0421.9%0.9%
2021-08-0921.6%0.9%
2021-08-1121.2%0.9%
2021-08-1620.7%0.8%
2021-08-1920.9%0.8%
2021-08-2321.4%0.8%
2021-08-2622.1%0.8%
2021-08-3123.2%0.9%
2021-09-0224.1%0.9%
2021-09-0825.7%1.0%
2021-09-1327.3%1.1%
2021-09-1528.2%1.2%
2021-09-2029.1%1.1%
2021-09-2329.8%1.2%
2021-09-2730.3%1.1%
2021-09-3030.6%1.2%
2021-10-0530.8%1.3%
2021-10-0730.9%1.3%
2021-10-1231.3%1.2%
2021-10-1531.7%1.2%
2021-10-1932.2%1.2%
2021-10-2232.6%1.4%
2021-10-2733.2%1.3%
2021-10-2933.6%1.4%
2021-11-0334.0%1.2%
2021-11-0834.2%1.5%
2021-11-1034.3%1.5%
2021-11-1534.6%1.7%
2021-11-1835.0%1.5%
2021-11-2234.9%1.5%
2021-11-2634.8%1.5%
2021-12-0134.4%1.7%
2021-12-0334.0%1.6%
2021-12-0833.8%1.5%
2021-12-1333.4%1.4%
2021-12-1533.0%1.4%
2021-12-2032.3%1.5%
2021-12-2332.0%1.5%
2021-12-2831.8%1.4%
2021-12-3131.8%1.2%
2022-01-0531.5%1.1%
2022-01-0730.8%1.2%
2022-01-1229.7%1.2%
2022-01-1428.7%1.2%
2022-01-2027.0%1.3%
2022-01-2522.8%3.0%
2022-01-2719.7%3.4%
2022-02-0116.3%4.2%
2022-02-0412.9%4.5%
2022-02-0810.9%4.4%
2022-02-118.2%4.6%
2022-02-165.7%4.7%
2022-02-184.7%3.4%
2022-02-244.7%3.5%
2022-03-014.5%2.8%
2022-03-033.6%2.4%
2022-03-083.0%2.3%
2022-03-112.3%2.6%
2022-03-152.1%2.7%
2022-03-182.0%2.8%
2022-03-232.1%2.7%
2022-03-251.7%2.5%
2022-03-301.6%2.6%
2022-04-041.9%2.5%
2022-04-061.9%2.5%
2022-04-111.9%2.3%
2022-04-141.7%2.0%
2022-04-191.7%2.0%
2022-04-221.5%4.8%
2022-04-271.4%5.2%
2022-04-291.6%5.5%
2022-05-041.6%5.4%
2022-05-091.8%5.9%
2022-05-112.0%6.2%
2022-05-162.3%6.6%
2022-05-192.2%4.2%
2022-05-232.2%4.1%
2022-05-262.0%3.8%
2022-06-011.9%3.6%
2022-06-031.8%3.5%
2022-06-081.7%3.1%
2022-06-131.5%3.1%
2022-06-151.4%3.4%
2022-06-211.5%3.2%
2022-06-241.4%3.3%
2022-06-281.5%3.4%
2022-07-011.3%3.2%
2022-07-071.4%3.3%
2022-07-111.4%3.3%
2022-07-141.4%2.7%
2022-07-191.6%2.8%
2022-07-211.8%3.0%
2022-07-262.0%2.8%
2022-07-281.9%2.8%
2022-08-022.1%2.6%
2022-08-052.3%2.6%
2022-08-092.3%2.5%
2022-08-122.7%2.4%
2022-08-173.0%2.0%
2022-08-193.1%1.9%
2022-08-243.3%1.9%
2022-08-293.6%2.2%
2022-08-313.7%2.1%
2022-09-063.7%2.3%
2022-09-093.4%2.3%
2022-09-133.3%2.6%
2022-09-162.8%2.8%
2022-09-213.0%2.6%
2022-09-233.1%2.6%
2022-09-282.9%2.8%
2022-10-033.1%2.7%
2022-10-053.2%2.5%
2022-10-103.3%2.8%
2022-10-133.4%2.7%
2022-10-173.6%2.9%
2022-10-203.4%3.5%
2022-10-253.2%3.9%
2022-10-273.0%3.5%
2022-11-012.5%3.5%

On the shuffled split the Apple LSTM looks respectable, but simply averaging the day's high and low beats it with no training at all, and with four other seeds it does not even beat yesterday's close (see the seed table). On the time-ordered split it falls apart: prices in the test years sat far above anything in the training years, and a network trained on raw prices cannot extrapolate. Netflix shows the same pattern, and with this seed its LSTM loses to yesterday's close even on the shuffled split.

Apple: training loss by epoch, 2022 against the re-run (shuffled split)

Epoch 1 is left off so the rest is readable (229.6 in 2022, 237.9 now).

  • 2022 run
  • Re-run
051015Epoch 2Epoch 11Epoch 21Epoch 30
Show the numbers as a table
Epoch2022 runRe-run
210.4114.76
310.5111.62
48.778.30
57.8010.56
69.1711.08
77.177.27
85.987.86
95.676.75
106.848.45
117.095.19
126.245.39
134.545.26
144.675.74
154.735.66
165.555.05
175.515.07
186.294.82
195.045.37
204.425.03
215.384.45
224.995.29
235.384.43
244.233.73
254.313.94
265.403.81
274.064.21
284.433.22
294.163.84
303.623.31

05: a straight line, five days ahead

Notebook 05 scaled the closing price and fitted a line from today's value to the value five rows later, on shuffled rows. The script reproduces its R² of 0.6391 exactly. On those same shuffled rows the flat forecast scores 0.608, so the line was only slightly ahead.

Trained on the first 205 days and tested on the last 52, the line's R² drops to -0.008 and the flat forecast wins clearly, with an R² of 0.412.

Absolute error as a share of the price, last 52 days

Test period 2020-11-09 to 2021-01-19. Mean 0.50% for the line, 0.36% for the flat forecast.

  • Linear regression
  • Price in five days = today
0.0%0.2%0.4%0.6%0.8%1.0%1.2%1.4%2020-11-092020-12-022020-12-252021-01-19
Show the numbers as a table
DateLinear regressionPrice in five days = today
2020-11-090.47%0.68%
2020-11-100.40%0.62%
2020-11-110.11%0.27%
2020-11-120.29%0.20%
2020-11-131.06%1.03%
2020-11-160.55%0.44%
2020-11-170.36%0.23%
2020-11-180.81%0.70%
2020-11-190.99%0.87%
2020-11-200.26%0.07%
2020-11-230.48%0.30%
2020-11-240.46%0.30%
2020-11-250.64%0.42%
2020-11-260.42%0.16%
2020-11-270.45%0.25%
2020-11-300.43%0.20%
2020-12-010.21%0.01%
2020-12-020.19%0.10%
2020-12-030.08%0.37%
2020-12-040.43%0.19%
2020-12-070.33%0.07%
2020-12-080.42%0.22%
2020-12-090.23%0.05%
2020-12-100.66%0.43%
2020-12-110.54%0.27%
2020-12-140.45%0.18%
2020-12-150.14%0.10%
2020-12-160.42%0.69%
2020-12-170.01%0.30%
2020-12-180.28%0.04%
2020-12-210.18%0.12%
2020-12-220.76%0.53%
2020-12-231.27%1.11%
2020-12-241.21%0.97%
2020-12-250.95%0.64%
2020-12-281.10%0.82%
2020-12-290.62%0.31%
2020-12-300.44%0.11%
2020-12-310.09%0.31%
2021-01-010.08%0.49%
2021-01-040.03%0.38%
2021-01-050.10%0.26%
2021-01-060.64%0.29%
2021-01-070.61%0.26%
2021-01-080.82%0.49%
2021-01-110.64%0.29%
2021-01-120.76%0.44%
2021-01-130.36%0.04%
2021-01-140.75%0.36%
2021-01-150.59%0.18%
2021-01-180.62%0.22%
2021-01-190.69%0.30%

28 and 32: AutoTS

AutoTS searches hundreds of model templates and returns the best ensemble, which sounds like it should win. I repeated the 2022 call on four rolling five-day windows at the end of each bundled year. Each fit took several minutes on a laptop, about 65 minutes for the ten fits in this section.

28 Tata Motors

TTM: AutoTS against a flat forecast on four five-day windows in 2022
Window, 2022AutoTS MAPEFlat MAPECloser
28 Oct – 3 Nov4.89%2.14%Flat
4 Nov – 10 Nov5.51%5.17%Flat
11 Nov – 17 Nov5.38%2.22%Flat
18 Nov – 25 Nov3.69%1.27%Flat
Mean of 44.87%2.70%Flat

AutoTS was closer in 0 of the 4 windows.

32 Apple

AAPL: AutoTS against a flat forecast on four five-day windows in 2022
Window, 2022AutoTS MAPEFlat MAPECloser
28 Oct – 3 Nov4.20%4.18%Flat
4 Nov – 10 Nov3.75%1.85%Flat
11 Nov – 17 Nov3.17%1.76%Flat
18 Nov – 25 Nov0.93%0.91%Flat
Mean of 43.01%2.18%Flat

AutoTS was closer in 0 of the 4 windows.

For scale: across every possible start date in the Tata Motors year, a flat forecast misses by 3.15% on average over five days, and Apple's by 2.85%.

Tata Motors: the 2022 forecast against the same call today (change from the last close)

Same data, same settings, AutoTS 0.6.21 instead of 0.5.1. The 2022 forecast can no longer be checked because the ADR was delisted in 2023.

  • 2022 forecast
  • Re-run today
-0.5%0.0%0.5%1.0%1.5%2.0%2.5%Day 1Day 2Day 3Day 4Day 5
Show the numbers as a table
Date2022 forecastRe-run today
Day 10.28%-0.07%
Day 20.53%0.92%
Day 30.77%1.14%
Day 40.99%2.33%
Day 51.20%2.36%

Notebook 32 never finished in 2022. Finishing it now and checking against the five trading days that followed (2022-11-28 to 2022-12-02), AutoTS missed by 1.94% on average against 1.60% for the flat forecast. One week proves nothing either way, which is the point of backtesting on several windows.

Apple, the week after the data ends: change from the last close

  • What happened
  • AutoTS
  • Flat forecast
-5%-4%-3%-2%-1%0%1%Day 1Day 2Day 3Day 4Day 5
Show the numbers as a table
DateWhat happenedAutoTSFlat forecast
Day 1-2.63%-0.28%0.00%
Day 2-4.69%-3.61%0.00%
Day 3-0.05%-2.10%0.00%
Day 40.14%-2.06%0.00%
Day 5-0.20%-2.13%0.00%

Is the gap bigger than the noise?

Two average errors can differ by chance, and the errors of nearby days move together. So each model is compared with the flat forecast day by day, on the same days, with the Diebold-Mariano test: a positive statistic means the model's errors are larger. The intervals come from resampling blocks of consecutive days, which keeps that day-to-day dependence.

Mean absolute percentage error and the mean gap with 95% moving-block bootstrap intervals, and the Diebold-Mariano test of model against flat forecast on the same days. AutoTS rows show the range across its four windows and an exact sign test.
ForecastModel MAPE, 95%Flat MAPE, 95%Mean gap (pts), 95%Paired test, two-sided
01 LSTM, Apple, time-ordered690 days, h = 138.69%34.83% to 42.59%1.67%1.47% to 1.88%+37.03+33.06 to +41.00p < 0.0001DM +53.72
09 LSTM, Netflix, time-ordered690 days, h = 114.57%12.34% to 17.13%2.17%1.90% to 2.50%+12.39+9.98 to +15.12p < 0.0001DM +27.28
05 Linear, five days ahead52 days, h = 50.50%0.38% to 0.63%0.36%0.27% to 0.46%+0.14+0.06 to +0.22p = 0.008DM +2.77
28 AutoTS, Tata Motors4 windows of 5 days; ranges, not intervals4.87%3.69% to 5.51%2.70%1.27% to 5.17%+2.17+0.34 to +3.16p = 0.125sign test, 0 of 4 won
32 AutoTS, Apple4 windows of 5 days; ranges, not intervals3.01%0.93% to 4.20%2.18%0.91% to 4.18%+0.84+0.02 to +1.90p = 0.125sign test, 0 of 4 won
01 LSTM, Apple, shuffled (2022)689 days, h = 11.00%0.91% to 1.07%1.29%1.16% to 1.42%−0.29−0.41 to −0.18p < 0.0001DM −6.76
09 LSTM, Netflix, shuffled (2022)689 days, h = 14.09%2.83% to 5.27%2.04%1.85% to 2.24%+2.05+0.81 to +3.20p < 0.0001DM +8.75

Every time-ordered comparison but AutoTS is decisive. AutoTS lost in all four windows for both shares, but four windows are thin evidence: an exact sign test on four windows cannot go below p = 0.125. Its 20 days are four forecasts of one to five days ahead each, not 20 comparable days, so neither the Diebold-Mariano test nor a bootstrap interval is used there. The direction is consistent; the proof is not there. The one comparison a model wins, Apple's LSTM on shuffled days, is the one where it was given the same day's high and low, and it wins only with the seed the audit happened to use.

One run of an LSTM is not a result. Re-running the script with the same seed reproduced Apple to every digit but not Netflix, so every fit was repeated with four more seeds. On the time-ordered split the spread is wide and every seed loses to the flat forecast by a wide margin. On the shuffled split the verdict depends on the seed: Apple's LSTM beats yesterday's close with seed 42 and with no other, and Netflix's with seed 1 and no other. Bold marks a seed that beats the flat forecast.

Mean absolute percentage error of the LSTM for each training seed, against the flat forecast on the same days
LSTM MAPESeed 42Seed 1Seed 2Seed 3Seed 4Flat
01 Apple, time-ordered38.69%36.73%38.79%35.86%43.28%1.67%
09 Netflix, time-ordered14.57%10.95%16.42%14.11%15.35%2.17%
01 Apple, shuffled1.00%2.27%2.26%1.30%1.45%1.29%
09 Netflix, shuffled4.09%1.93%3.04%2.40%4.68%2.04%

Mean gap is model minus flat forecast, in percentage points of absolute error, with its 95% block-bootstrap interval. The Diebold-Mariano (DM) test uses the Harvey, Leybourne and Newbold correction, with h = 5 for the five-day forecast in 05; block-bootstrap intervals use blocks of 5 days or more, seed 2026, 10,000 resamples. AutoTS rows give the lowest and highest of the four windows instead of an interval. The LSTMs in the first table were trained with seed 42 and TensorFlow's deterministic ops; the seed table adds seeds 1, 2, 3, 4. The AutoTS windows need no seed. How each interval and test works is set out on the methods page.

What I take from it

None of the five price models earned its complexity. The ones that looked good were tested on shuffled days or used information from the day being predicted. When I test them on later days, the flat forecast is as good or better.

That is the normal result for daily prices, and it is why every forecasting exercise should start by writing down the naive baseline and the time-ordered split before any model is trained.