协调多层级预测并分析差异
对齐不同层级的预测口径,解释总量差异,输出逐级加总一致的预测表、调整记录与实现代码。
完整提示词
<context>
Forecasts made at different levels rarely add up. Totals are smoother and easier to forecast; low-level series are noisy but carry local knowledge. When the bottom-up sum and the top-down total disagree, the gap is usually a difference in assumptions (sales teams sandbag or inflate, finance applies a growth target, a statistical model misses a new store), not arithmetic, and reconciling it blindly hides the argument the business needs to have. The mechanical options are bottom-up (sum the lowest level), top-down (split the total by historical or forecast proportions, which breaks when the mix is changing), middle-out, and optimal reconciliation such as MinT, which combines forecasts from all levels using their error covariance and usually beats any single level. After reconciliation, integer quantities and non-negative values may need fixing.
Tool: {{tool}}
{{#hierarchy}}Hierarchy: {{hierarchy}}{{/hierarchy}}
</context>
<task>
<forecasts>
{{forecasts}}
</forecasts>
1. Line the forecasts up by level and period in the same units; state the gap between the top-down total and the bottom-up sum, in absolute and percentage terms, per period.
2. Explain where the gap comes from: break it down by child series (which regions or products account for most of it) and by likely cause (different growth assumptions, a missing new item, a target embedded in the total, timing differences, definitions). Separate what the numbers show from what you infer.
3. Choose a reconciliation method and say why: bottom-up when low-level forecasts are good and the mix is shifting, top-down when low-level series are too noisy, middle-out when one level is most reliable, MinT or similar when history allows. If the gap is a business disagreement, say the method cannot settle it and list the decision needed.
4. Produce the reconciled forecast at every level, adding up exactly, and show how much each series moved from its original forecast.
5. Write {{tool}} code. Python: hierarchicalforecast (with statsforecast) for BottomUp, TopDown and MinTrace. R: fable with aggregate_key and reconcile(). Spreadsheet: proportional allocation formulas with a check row, saying what is lost.
6. Open decisions: the assumptions owners must agree on, and how to measure which level was more accurate after the fact.
</task>
<constraints>
- Compute only from the figures supplied; label any hand calculation as approximate.
- Never silently force the bottom-up numbers to a target total; if the total is a target, say so and show the forecast and the target separately.
- Flag negative or fractional allocations and say how they are handled.
- Keep units and periods identical across levels before comparing.
{{> output/uncertainty}}
</constraints>
<output_format>
## Summary
The gap, its main cause, the method chosen and the reconciled total.
## The gap
Table: period | top-down | bottom-up sum | gap | gap %.
## Where it comes from
Table: child series | share of gap | likely cause | evidence or inference.
## Reconciliation method
Bullets with the reason.
## Reconciled forecast
Table by level and period, with original versus reconciled.
## Code
One code block in {{tool}}.
## Open decisions
Numbered.
</output_format>可替换内容
- {{tool}}
- {{#hierarchy}}
- {{hierarchy}}
- {{/hierarchy}}
- {{forecasts}}
- {{> output/uncertainty}}
分类与标签
办公效率、层级预测、预测差异分析、业务报表、数据协调