mcpField
I
inventory-forecasting

inventory-forecasting

github.com/w95データ・データベース28544 回インストール35 週間前に更新
リポジトリ

inventory-forecasting について

商品供給と保管・発注コストのバランスを取るチーム向けの在庫予測スキルです。需要予測の手法、安全在庫、発注点、発注量、予測精度の指標を解説します。

主な機能

  1. 01移動平均とトレンド予測
  2. 02季節調整と回帰分析
  3. 03需要要因の評価
  4. 04安全在庫と発注点の計算式
  5. 05経済的発注量の分析
  6. 06予測精度の指標

活用シーン

  1. 01過去データに基づく需要推定
  2. 02需要変動に備える在庫バッファの設定
  3. 03発注点と発注量の決定
  4. 04予測誤差と偏りの確認

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/w95/awesome-claude-corporate-skills --skill inventory-forecasting

インストール後、Claude Code で/inventory-forecastingを入力して読み込まれたか確認します。

詳細

在庫予測

概要

需要を正確に予測し、最適な在庫レベルを計算して、欠品を避けながら在庫保有コストを削減することで、在庫の最適化を実現します。効果的な予測では、供給可能性と保管コストのバランスを取ります。

需要予測手法

1. 過去の傾向分析

単純移動平均(需要が安定している場合に最適):

Month | Actual Demand | 3-Month MA | 6-Month MA
-------|---------------|-----------|----------
Jan | 1,000 | - | -
Feb | 1,100 | - | -
Mar | 950 | 1,017 | -
Apr | 1,200 | 1,083 | -
May | 1,150 | 1,100 | 1,067
Jun | 1,300 | 1,217 | 1,117
Jul | 1,250 | 1,233 | 1,150
Aug | 1,100 | 1,217 | 1,183
Sep | 1,400 | 1,250 | 1,250
Oct | 1,300 | 1,267 | 1,267
Nov | 1,500 | 1,400 | 1,308
Dec | 1,450 | 1,417 | 1,350

Average Annual Demand: 1,250 units/month
Forecast for Jan Year 2: 1,417 (3-month MA)

加重移動平均(直近のデータをより重視):

Recent months get higher weights:
- 3 months ago: 20% weight
- 2 months ago: 35% weight
- Last month: 45% weight

Forecast = (Sep × 0.20) + (Oct × 0.35) + (Nov × 0.45)
         = (1,400 × 0.20) + (1,300 × 0.35) + (1,500 × 0.45)
         = 280 + 455 + 675
         = 1,410 units
2. 季節調整

季節性の特定:

Month | Actual | Annual Avg | Seasonal Index
-------|--------|-----------|----------------
Jan | 800 | 1,200 | 0.67 (slower)
Feb | 900 | 1,200 | 0.75
Mar | 1,100 | 1,200 | 0.92
Apr | 1,400 | 1,200 | 1.17 (faster)
May | 1,600 | 1,200 | 1.33 (peak)
Jun | 1,500 | 1,200 | 1.25
Jul | 1,400 | 1,200 | 1.17
Aug | 1,300 | 1,200 | 1.08
Sep | 1,100 | 1,200 | 0.92
Oct | 1,000 | 1,200 | 0.83
Nov | 1,200 | 1,200 | 1.00
Dec | 2,000 | 1,200 | 1.67 (holiday peak)

Average index: 12.07 / 12 = 1.00 (verification)

季節予測(季節指数を使用):

Base forecast (trend): 1,250 units
Seasonal forecast for May: 1,250 × 1.33 = 1,663 units (peak season)
Seasonal forecast for Jan: 1,250 × 0.67 = 838 units (slow season)
Seasonal forecast for Dec: 1,250 × 1.67 = 2,088 units (holiday)
3. 回帰分析

需要要因を用いた線形トレンド:

Regression: Demand = Base + (Growth Rate × Month) + (Seasonal Factor)

Data analysis:
- Base demand: 1,200 units
- Growth rate: +25 units/month (+2% monthly growth)
- Seasonal adjustments: (as above)

Forecast for Month 25 (13 months forward):
= 1,200 + (25 × 25) + (seasonal index for that month)
= 1,200 + 625 + seasonal
= 1,825 + seasonal (if month has 1.1 seasonal index: 1,825 × 1.1 = 2,008 units)
4. 需要要因分析

需要を左右する要因の特定:

Demand Driver | Correlation | Lead Time | Action
--------------|-------------|-----------|-------
Marketing spend | 0.85 (strong) | 2 weeks | Forecast up 30% if large campaign planned
Sales pipeline | 0.92 (strong) | 1 month | Request deals closing in next 30 days
Competitor actions | 0.60 (moderate) | 1 month | Monitor competitor price cuts
Seasonal events | 0.75 (strong) | 3 months | Plan for holidays, back-to-school, etc.
Economic indicators | 0.40 (weak) | 2 months | Monitor consumer confidence index
Industry growth | 0.70 (moderate) | Continuous | Factor in industry growth rate

FORECAST ADJUSTMENT:
If large marketing campaign planned in 2 weeks (30% demand lift expected):
- Normal forecast for weeks 3-6: 1,250 units/week
- Adjusted forecast: 1,250 × 1.30 = 1,625 units/week (4-week impact)

安全在庫の計算

目的:需要の変動や供給の遅延に備えるバッファー

基本的な安全在庫の計算式:

Safety Stock = Z × σ_L × √(L)

Where:
Z = Service level factor (95% = 1.65, 99% = 2.33)
σ_L = Standard deviation of demand
L = Lead time in periods

EXAMPLE:
Average monthly demand: 1,250 units
Demand std dev: 150 units (high variability)
Lead time: 2 months
Service level target: 95% (Z = 1.65)

Safety Stock = 1.65 × 150 × √2
             = 1.65 × 150 × 1.41
             = 350 units (safety buffer)

サービスレベルのトレードオフ:

Service Level | Z Factor | Safety Stock | Stockout Risk | Carrying Cost
--------------|----------|--------------|---------------|---------------
90% | 1.28 | 272 units | 10% | Lower
95% | 1.65 | 350 units | 5% | Moderate
99% | 2.33 | 495 units | 1% | Higher
99.9% | 3.09 | 656 units | 0.1% | Very High

TRADE-OFF: 95% service level is typical balance of stockout risk vs. cost

発注点(ROP)

再発注のタイミング(リードタイム中の需要と安全在庫を考慮):

ROP = (Average Daily Demand × Lead Time) + Safety Stock

EXAMPLE:
Monthly demand: 1,250 units
Daily demand: 1,250 / 30 = 41.67 units/day
Lead time: 14 days (2 weeks from supplier)
Safety stock: 350 units (calculated above)

ROP = (41.67 × 14) + 350
    = 583 + 350
    = 933 units

ACTION: When inventory hits 933 units, place new order

リードタイムが発注点に与える影響:

Lead Time | Demand During LT | Safety Stock | ROP | Comment
-----------|------------------|--------------|-----|--------
1 week | 292 units | 350 | 642 | Tight; need good forecast
2 weeks | 583 units | 350 | 933 | Standard lead time
4 weeks | 1,167 units | 350 | 1,517 | Long lead; high ROP
8 weeks | 2,333 units | 350 | 2,683 | Very long lead; expensive to carry

意味するところ:リードタイムが短いほど、発注点を低く抑えられ、在庫保有コストも削減できます。

経済的発注量(EOQ)

発注量(発注コストと在庫保有コストのバランスを取る):

EOQ = √(2 × D × S / H)

Where:
D = Annual demand (units)
S = Order cost per order ($)
H = Annual holding cost per unit ($)

EXAMPLE:
Annual demand: 15,000 units (1,250/month × 12)
Order cost: $50 per order (processing, shipping, receiving)
Holding cost: $10 per unit per year (20% of $50 unit cost)

EOQ = √(2 × 15,000 × 50 / 10)
    = √(150,000)
    = 387 units per order

Order frequency: 15,000 / 387 = 39 orders/year (weekly ordering)
Average inventory: 387 / 2 = 194 units (plus safety stock)

EOQ のトレードオフ分析:

Order Quantity | Order Freq | Order Cost/Yr | Carrying Cost/Yr | Total Cost | Note
--------------|-----------|---------------|------------------|-----------|------
100 units | 150 orders | $7,500 | $500 | $8,000 | Too frequent
387 units | 39 orders | $1,950 | $1,935 | $3,885 | OPTIMAL (EOQ)
500 units | 30 orders | $1,500 | $2,500 | $4,000 | Higher carrying
1,000 units | 15 orders | $750 | $5,000 | $5,750 | Bulk discount? Consider if available

在庫予測テンプレート

月次予測レポート:

INVENTORY FORECAST - Q2 2024

PRODUCT: Widget Classic

HISTORICAL DEMAND:
January: 1,200 units
February: 1,100 units
March: 1,350 units
Average: 1,217 units/month
Std Dev: 125 units (moderate variability)

FORECAST METHODOLOGY:
- Base: 3-month weighted moving average
- Adjustment: +15% seasonal factor for Q2 (spring season)
- Driver adjustment: +5% for planned marketing campaign in April
- Trend: +2% overall growth

DEMAND FORECAST:
April: 1,400 units (1,217 × 1.15 × 1.05 × 1.02 = 1,405)
May: 1,500 units (peak season)
June: 1,450 units (tail-end seasonal)

INVENTORY PLANNING:
Current stock: 800 units
Safety stock required: 350 units
ROP (reorder point): 933 units

PROCUREMENT PLAN:
April 1: Place order for 1,500 units (EOQ adjusted for demand)
Supplier lead time: 14 days
Expected delivery: April 15 (before peak demand)

INVENTORY PROJECTIONS:
April 1 inventory: 800 units (below ROP; trigger order immediately)
April 15 (delivery): 800 + 1,500 = 2,300 units
April 30 (end month): 2,300 - 1,400 = 900 units
May 31 (end month): 900 + 1,500 - 1,500 = 900 units
June 30: 900 + ? - 1,450 = target 350+ safety stock

RISKS:
- High variability in demand; safety stock may be inadequate
- Supplier lead time 14 days; disruption = 2-week shortage risk
- Marketing campaign success uncertain; demand could exceed 1,405

MITIGATION:
- Increase safety stock to 400 units (add 1 week buffer)
- Dual-source supplier to reduce lead time risk
- Monitor campaign performance weekly; adjust forecast if needed

季節調整のフレームワーク

季節要因テーブルの作成:

SEASONAL ANALYSIS - Last 3 Years Average

Month | 2021 | 2022 | 2023 | 3-Yr Avg | Annual Avg | Index
-------|------|------|------|----------|-----------|-------
Jan | 800 | 850 | 900 | 850 | 1,200 | 0.71
Feb | 900 | 950 | 1,000 | 950 | 1,200 | 0.79
Mar | 1,100 | 1,150 | 1,200 | 1,150 | 1,200 | 0.96
Apr | 1,400 | 1,450 | 1,500 | 1,450 | 1,200 | 1.21
May | 1,600 | 1,650 | 1,700 | 1,650 | 1,200 | 1.38
Jun | 1,500 | 1,550 | 1,600 | 1,550 | 1,200 | 1.29
Jul | 1,400 | 1,450 | 1,500 | 1,450 | 1,200 | 1.21
Aug | 1,300 | 1,350 | 1,400 | 1,350 | 1,200 | 1.13
Sep | 1,100 | 1,150 | 1,200 | 1,150 | 1,200 | 0.96
Oct | 1,000 | 1,050 | 1,100 | 1,050 | 1,200 | 0.88
Nov | 1,200 | 1,250 | 1,300 | 1,250 | 1,200 | 1.04
Dec | 2,000 | 2,100 | 2,200 | 2,100 | 1,200 | 1.75

Base Annual Average: 14,400 / 12 = 1,200 units/month

SEASONAL PATTERN:
- Weak season: Jan-Mar (index < 1.0)
- Strong season: Apr-Aug (index > 1.0)
- Peak season: May & Dec (holiday/spring)

予測精度の指標

予測品質の追跡と改善:

Accuracy Metrics:
- MAE (Mean Absolute Error): Average forecast error (units)
- MAPE (Mean Absolute Percentage Error): Error as % of actual
- Bias: Are forecasts consistently high or low?

FORECAST ACCURACY REPORT - Q1 2024:

Month | Forecast | Actual | Error | % Error | Status
-------|-----------|--------|-------|---------|--------
Jan | 1,250 | 1,200 | -50 | -4% | Within 5%
Feb | 1,200 | 1,100 | -100 | -9% | Over-forecast
Mar | 1,350 | 1,350 | 0 | 0% | Accurate
Q1 Average MAPE: 4.3%

IMPROVEMENT ACTIONS:
- Feb forecast too high; analyze why (promotional campaign delayed?)
- Improve demand driver tracking
- Reduce seasonal index adjustment (was 1.15, should be 1.08)

在庫最適化の意思決定

在庫保有コストを考慮した内製・購入の判断:

SCENARIO: Reduce inventory to cut carrying costs

Current State:
- Average inventory: 900 units
- Carrying cost: $10/unit/year = $9,000/year
- Stockout incidents: 2-3/year (due to variability)
- Lost sales: ~$15,000/year (stockout costs)

OPTION 1: Reduce safety stock from 350 to 200 units
- New average inventory: 750 units
- New carrying cost: $7,500/year (save $1,500)
- Expected stockouts: Increase to 5-6/year
- Lost sales: Increase to ~$25,000/year (cost $10,000 more)
- NET IMPACT: LOSE $8,500/year (not recommended)

OPTION 2: Reduce order lead time from 14 to 7 days (faster supplier)
- New ROP: 583 units (down from 933)
- Average inventory: 400 units
- Carrying cost: $4,000/year (save $5,000)
- Stockout risk: Decrease (faster replenishment)
- Supplier cost increase: $3,000/year (for expedited shipping)
- NET IMPACT: SAVE $2,000/year (recommended)

OPTION 3: Implement demand-driven ordering
- Share sales forecast with supplier
- Supplier holds safety stock instead of us
- Our carrying cost: Minimal
- Supplier profit margin: Lower cost alternative
- Supplier cost: Neutral or pass through to us
- NET IMPACT: Evaluate supplier willingness

ベストプラクティス

  1. 毎月見直す:実際の需要データを反映して予測を更新します
  2. 協調的な計画:予測を営業・マーケティング部門と共有します(CPFR)
  3. シナリオ計画:楽観的なケースと悲観的なケースを想定して計画します
  4. サプライヤーとの連携:予測を共有し、サプライヤーの計画を可能にします
  5. 在庫監査:システムの精度を確認し、在庫減耗を考慮して調整します
  6. リードタイムの監視:サプライヤーが14日間の SLA を満たしているか追跡します
  7. 需要センシング:キャンペーンや競合他社など、市場の兆候を早期に監視します
  8. 定期的な差異分析:予測誤差を把握し、手法を改善します

このスキルの用途:在庫レベルを最適化し、在庫保有コストを削減し、欠品を防ぎ、サプライチェーンの効率を高めます。

コメント