Прогноз потребительских расходов муниципалитетов и раннее обнаружение структурных сдвигов по данным СберИндекса
Forecasting municipal consumer spending and detecting structural breaks early with SberIndex data
У каждого муниципалитета в данных СберИндекса всего 24 месяца наблюдений, зато муниципалитетов около двух тысяч. Внутри одного ряда нельзя надёжно оценить ни сезонность, ни шум, ни точку разлома. Рабочий тезис: информацию надо занимать поперёк панели, а не вдоль ряда. Полный прогон на всех 2 016 МО его подтверждает — и уточняет, что почти весь выигрыш даёт сама панель, а не выбор модели.
Each municipality in the SberIndex data has only 24 monthly observations, but there are about two thousand municipalities. Within a single series one cannot reliably estimate seasonality, noise or a break point. The working thesis: borrow information across the panel rather than along the series. The full run on all 2,016 municipalities supports it — and shows that almost the entire gain comes from the panel itself, not from the choice of model.
Все даты в реестре событий сверены по первоисточникам: пресс-релизы Банка России, распоряжение Правительства о тарифах, сообщения о паводках в Оренбургской, Тюменской и Курганской областях. Работу прочитали четыре независимых рецензента; после разбора пересчитаны тесты значимости, добавлены контрольные модели и уровень случайных тревог для детекторов. Ход разбора и список правок — в журнале аудита. Код, отчёт и конфигурации депонированы: DOI 10.5281/zenodo.22827296.
Every date in the event registry is verified against primary sources: Bank of Russia press releases, the government tariff decree, and reports of the floods in the Orenburg, Tyumen and Kurgan regions. Four independent reviewers read the work; after their comments the significance tests were recomputed, control models were added and a random-alarm benchmark was introduced for the detectors. The review log is in the audit note. The code, report and configurations are deposited under DOI 10.5281/zenodo.22827296.
Основной ряд — «Потребительские безналичные расходы на уровне муниципальных образований» СберИндекса: 303 126 наблюдений, январь 2023 — декабрь 2024, шесть категорий (все категории, продовольствие, здоровье, общественное питание, транспорт, маркетплейсы), по 2 190 рядов в каждой. Файл выгрузки зафиксирован контрольной суммой sha256, чтобы результат воспроизводился на той же версии данных.
The core series is SberIndex's "Cashless consumer spending at the municipal level": 303,126 observations, January 2023 to December 2024, six categories (all categories, food, health, restaurants, transport, marketplaces), 2,190 series in each. The data file is pinned by a sha256 checksum so that results reproduce on the same data version.
Скользящий бэктест: прогноз строится из июня, июля, августа и сентября 2024 года на один, два и три месяца вперёд, все 2 016 МО с полной историей, 24 192 пары «МО — точка — горизонт». Каждая модель видит только данные до точки прогноза.
Rolling backtest: forecasts are made from June, July, August and September 2024, one to three months ahead, for all 2,016 municipalities with a full history — 24,192 municipality–origin–horizon pairs. Each model sees only data up to its forecast origin.
Сезонный наивный прогноз (MAE 4 206) не показан: он втрое хуже Prophet и сжал бы шкалу. Бустинг с признаками событий (1 338) не лучше бустинга без них (1 325): в окне прогноза все события федеральные и одинаковы для всех МО.
The seasonal naive forecast (MAE 4,206) is omitted: it is three times worse than Prophet and would compress the scale. Boosting with event features (1,338) is no better than without them (1,325): in the forecast window every event is federal and identical across municipalities.
| Модель | Model | Идея | Idea | MAE | R² прироста | R² growth |
|---|---|---|---|---|---|---|
| ens3_mean | среднее трёх моделей ниже: Chronos, ETS и наивной с поправкой | average of the three models below: Chronos, ETS and the corrected naive | 762 | 0,42 | ||
| chronos_base | Chronos-Bolt на отклонении МО от общей динамики, без обучения | Chronos-Bolt on the deviation from the common path, zero-shot | 886 | 0,31 | ||
| ets_relative | ETS на отклонении МО от медианного; сезонность — у панели | ETS on the deviation from the median municipality; seasonality from the panel | 926 | 0,21 | ||
| factor_only | контроль: отклонение заморожено, двигается только общая динамика | control: the deviation is frozen, only the common path moves | 939 | 0,17 | ||
| prophet_relative | тот же Prophet, но на отклонении от общей динамики | the same Prophet, but on the deviation from the common path | 959 | 0,08 | ||
| snaive_growth | прошлогодний уровень × годовой прирост за 3 месяца | last year's level × 3-month average annual growth | 995 | 0,12 | ||
| lgbm | глобальный бустинг, поправка к предыдущей модели | global boosting, a correction to the model above | 1 338 | −0,39 | ||
| prophet | Prophet на каждом ряду — базовая модель конкурса | Prophet per series — the contest baseline | 1 428 | −0,71 |
R² прироста — доля дисперсии годового прироста, объяснённая моделью. R² уровня здесь у всех моделей 0,97–0,99 и ничего не различает.
R² growth is the share of variance in annual growth explained by the model. R² on levels is 0.97–0.99 for every model and does not discriminate.
Сравните две строки таблицы: factor_only — модель без единого обученного параметра, а prophet_relative — та же базовая модель конкурса, но применённая к отклонению. Обе дают около трети выигрыша, и между собой все модели «поверх приёма» статистически неразличимы. Собственный вклад моделирования появляется только у ансамбля: он лучше factor_only на 177 руб. (p = 0,004).
Разрыв растёт с горизонтом: на месяц вперёд панельная модель точнее Prophet на 14 %, на три месяца ошибка Prophet почти вдвое больше. Prophet пытается оценить годовую сезонность по 24 точкам и не справляется — и это не вопрос настройки: из десяти конфигураций Prophet лучшая даёт 1 334 руб., что всё равно на 43 % хуже панельной модели.
О значимости честно: ячеек «точка — горизонт» двенадцать, но целевых месяцев всего шесть, и прогнозы из разных точек метят в один месяц. С поправкой на это перекрытие тест Диболда–Мариано даёт p = 0,18. Поэтому выводы опираются на две другие проверки: доля МО, где модель лучше (86–88 %), и блочный бутстрап по месяцам, интервалы которого не пересекают ноль.
Compare two rows: factor_only has no fitted parameters at all, while prophet_relative is the contest baseline applied to the deviation. Both capture about a third of the gain, and every model built on top of the trick is statistically indistinguishable from the others. Modelling adds something of its own only in the ensemble: it beats factor_only by 177 RUB (p = 0.004).
The gap widens with the horizon: one month ahead the panel model is 14 % more accurate than Prophet; three months ahead Prophet's error is almost twice as large. Prophet tries to estimate annual seasonality from 24 points and fails — and this is not a matter of tuning: across ten Prophet configurations the best gives 1,334 RUB, still 43 % worse than the panel model.
On significance, plainly: there are twelve origin–horizon cells but only six target months, and forecasts from different origins land on the same month. Corrected for that overlap, the Diebold–Mariano test gives p = 0.18. The conclusions therefore rest on two other checks: the share of municipalities where the model wins (86–88 %) and a block bootstrap over months, whose intervals exclude zero.
Все детекторы работают с одним рядом — годовым приростом МО за вычетом прироста медианного МО в том же месяце:
All detectors work on the same series — a municipality's annual growth minus the median municipality's growth in the same month:
Годовой прирост убирает сезонность, вычитание медианы — общероссийские движения. Декабрьский пик или рост ставки, задевший всех, для отдельного МО шоком не считается.
Annual growth removes seasonality; subtracting the median removes nationwide movements. A December peak or a rate hike that hit everyone is not a shock for any single municipality.
Настоящих дат шоков по МО нет, поэтому проверка полусинтетическая: в половину из 2 016 реальных рядов вносится ступенька уровня на ±5, ±10 или ±20 % в случайный месяц апреля–декабря 2024 года, три повтора.
There are no true shock dates for municipalities, so the test is semi-synthetic: half of 2,016 real series receive a level step of ±5, ±10 or ±20 % in a random month of April–December 2024, three repeats.
| Детектор | Detector | Точность | Precision | Полнота | Recall | Случайный | Random | Ложных на 100 | False per 100 |
|---|
«Ложных на 100» — тревоги на 100 ряд-месяцев в рядах без внесённого шока. В этих рядах есть и собственные настоящие шоки, поэтому точность занижена. «Случайный» — полнота детектора, который даёт тревоги с той же частотой, но наугад: без этого ориентира полнота не читается. Строка «+ новости» — тот же BOCPD, которому заранее сообщают о возможном событии (60 % шоков имеют новость, 5 % новостей ложные, дата известна с точностью до месяца).
"False per 100" counts alarms per 100 series-months in series with no injected shock. Those series contain genuine shocks of their own, so precision is understated. "Random" is the recall of a detector that fires at the same rate but at random: without that benchmark recall cannot be read. The "+ news" row is the same BOCPD told in advance about a possible event (60 % of shocks come with news, 5 % of news items are false, the date known to within a month).
Шоки от 10 % обнаруживаются в месяц появления. Панельный детектор находит 93–96 % шоков в 20 % и 51–65 % шоков в 10 %, но почти не видит сдвиги в 5 %: на коротком ряду они неотличимы от шума.
Пороги подбирались отдельно: каждый детектор прогнан по сетке своих настроек. При одинаковой доле ложных тревог около трёх на сто ряд-месяцев полнота панельного детектора 0,60, у PELT и BinSeg 0,48. У остальных на сетке вовсе нет настройки с такой долей. Панельный детектор превосходит их не в удачно выбранной точке, а на всей кривой.
Shocks of 10 % or more are detected in the month they occur. The panel detector finds 93–96 % of 20 % shocks and 51–65 % of 10 % shocks, but hardly sees 5 % shifts: on a short series they are indistinguishable from noise.
Thresholds were tuned separately: every detector was run across a grid of its own settings. At an equal false-alarm rate of about three per hundred series-months, the panel detector's recall is 0.60 against 0.48 for PELT and BinSeg; the rest have no setting on the grid that reaches that rate at all. The panel detector wins across the whole curve, not at one lucky point.
В апреле 2024 года паводок прошёл по Оренбургской, Тюменской и Курганской областям: прорыв дамбы в Орске 5 апреля, режим ЧС в двух других регионах с 8 апреля, эвакуации, выплаты пострадавшим. Все даты сверены по первоисточникам. Под события попадают 15 МО. Если бедствие такого масштаба видно в расходах, прирост затронутых МО относительно медианного должен заметно сдвинуться.
In April 2024 floods swept the Orenburg, Tyumen and Kurgan regions: a dam burst in Orsk on 5 April, states of emergency in the other two regions from 8 April, evacuations and payments to those affected. All dates are verified against primary sources. Fifteen municipalities fall under these events. If a disaster of that scale shows up in spending, the growth of affected municipalities relative to the median should shift visibly.
Не сдвинулся. Средний сдвиг затронутых МО за апрель–июнь против января–марта составил −1,1 п. п. против −0,3 п. п. у остальных при разбросе 5,6 п. п.; разность −0,8 п. п. с интервалом от −3,2 до +1,5. Внутри группы разброс огромен и разнонаправлен: Звериноголовский округ −9,8 п. п., Новотроицк −7,4, Ишим −5,0, а Сладковский район +3,8 и Макушинский +3,5.
Экономически это объяснимо: эвакуация и порча имущества расходы снижают, выплаты пострадавшим и восстановительные покупки поднимают, и в месячной сумме силы гасят друг друга. Методически вывод осторожный: эффект сильнее примерно трёх процентных пунктов исключён, меньший на пятнадцати МО не проверяется. Детекторы ловят часть затронутых рядов — z-score 47 %, панельный 13 %, — и порядок обратный полусинтетической проверке. Это не довод в пользу z-score: реальные шоки такого типа по величине сравнимы с обычным разбросом ряда, поэтому их находит только детектор с низким порогом, а вместе с ними и шум.
It did not. The average shift of affected municipalities over April–June versus January–March was −1.1 pp against −0.3 pp elsewhere, with a spread of 5.6 pp; the difference is −0.8 pp with an interval from −3.2 to +1.5. Within the group the spread is large and two-sided: Zverinogolovsky −9.8 pp, Novotroitsk −7.4, Ishim −5.0, while Sladkovsky is +3.8 and Makushinsky +3.5.
Economically this makes sense: evacuation and property damage push spending down, payments and rebuilding push it up, and in a monthly total the two cancel out. Methodologically the claim is cautious: effects larger than about three percentage points are ruled out, smaller ones cannot be tested on fifteen municipalities. Detectors catch part of the affected series — z-score 47 %, the panel detector 13 % — the reverse of the semi-synthetic ranking. That is not an argument for z-score: real shocks of this kind are comparable in size to a series' ordinary spread, so only a low-threshold detector finds them, along with the noise.
На рисунке показаны три МО Оренбургской области; полный перечень затронутых МО и расчёт — в репозитории.
The figure shows three municipalities of the Orenburg region; the full list of affected municipalities and the calculation are in the repository.
Источников два. Первый — реестр решений с ссылкой на первоисточник у каждой записи: восемь решений Банка России по ставке, окончание массовой льготной ипотеки, индексация платы за ЖКУ, пять эпизодов паводков. Второй — открытый поток GDELT: 731 дневной архив за 2023–2024 годы, 5,9 ГБ, контрольная сумма у каждого файла, разметка правилами без языковых моделей.
There are two sources. The first is a registry of decisions, each with a link to a primary source: eight Bank of Russia rate decisions, the end of the mass subsidised mortgage, the utility tariff indexation and five flood episodes. The second is the open GDELT stream: 731 daily archives for 2023–2024, 5.9 GB, a checksum for every file, labelled by rules without language models.
Поток проверку не прошёл. Из восьми решений по ставке он находит одно: денежно-кредитная политика в кодах событий GDELT не кодируется, а доля российских доменов в потоке 0,2 %. К муниципалитетам привязались 239 новостей, и 231 из них — апрель 2024 года. То есть за два года открытый геокодированный поток дал один локальный шок, и тот уже был в реестре. Это честный отрицательный результат: федеральные решения остаются за реестром первоисточников, а расширять охват нужно русскоязычными источниками.
The stream failed the test. Of eight rate decisions it finds one: monetary policy is not encoded in GDELT's event codes, and Russian domains make up 0.2 % of the stream. Only 239 news items map to municipalities, and 231 of those are April 2024. In two years the open geocoded stream produced a single local shock, one already in the registry. That is an honest negative result: federal decisions stay with the primary-source registry, and widening coverage requires Russian-language sources.
Все числа этой страницы получены конфигурацией configs/full.yaml: загрузка с проверкой sha256, прогнозы, объединение с моделями-основами, ансамбли, детекторы, кривые по порогам, рисунки. Параметры лежат в YAML, зерно фиксировано, версии пакетов закреплены, сырые данные СберИндекса в репозиторий не кладутся: их скачивает загрузчик. Код, методологический отчёт на русском и журнал аудита — в репозитории github.com/rav11l/sberindex-shocks.
Every figure on this page comes from the configs/full.yaml configuration: download with a sha256 check, forecasts, merging with foundation models, ensembles, detectors, threshold curves and charts. Parameters live in YAML, the seed is fixed, package versions are pinned, and raw SberIndex data is not stored in the repository but fetched by the loader. The code, the methodology report in Russian and the audit log are at github.com/rav11l/sberindex-shocks.
Digital Economy Lab · Равиль Ахтямов, к. э. н. · ORCID 0000-0002-0783-8573
Данные: СберИндекс, sberindex.ru. Код — MIT, текст — CC BY 4.0.
Digital Economy Lab · Ravil Akhtyamov, PhD in Economics · ORCID 0000-0002-0783-8573
Data: SberIndex, sberindex.ru. Code under MIT, text under CC BY 4.0.