Forecasting bake-off

Don't guess which forecasting method to trust. Backtest all four (naive/drift, SES, Holt, Holt-Winters) on a real series, rank by out-of-sample RMSE, then forecast forward with the winner and its 95% prediction interval. Method selection without the hand-waving.

$0.014 per call · one payment for the whole workflow
POST /api/skill/forecasting-bake-off
Sample output + API docs →

7 tools run server-side in one request. You pay once, settle once, and get a single response - no orchestration, no per-step payments, and a partial-success envelope if any step fails. USDC over x402 on any supported chain.

When to use this pack

You need a forecast and you're not sure whether the series is stationary, trending, or seasonal. Instead of picking a method by gut and praying, the bake-off lets the data choose: every method runs the same holdout backtest, the lowest RMSE wins, and you forecast forward with that winner only. Pure-CPU and free over PoW - only the upstream data fetch is paid.

Tools in this pack

All 7 run inside the single $0.014 call above. Each is also callable on its own if you only need one part.

Bought one at a time, these 7 tools cost $0.015 together; the pack is that sum less a 10% bundle discount, rounded up to the $0.001 settlement floor, which is $0.014.

Workflow

  1. Fetch the equity series with stock-history (ticker, range=horizon-scaled - e.g. "2y" if you want to forecast ~6 months out). Pull `close` in chronological order; you want at least ~50 observations for the backtest to be meaningful, more if you suspect seasonality.
  2. If the user is asking about a macro indicator instead (unemployment, CPI, fed funds), fetch via fred-series with the series id. Monthly FRED data with 10+ years of history is the sweet spot for Holt-Winters with period=12.
  3. Run the bake-off. Call forecast-eval four times on the same values with testSize ≈ 20% of the series (capped at half): method="naive" or "drift", "ses", "holt", "holt-winters" (the last only if you have ≥ 2·period observations and suspect seasonality). Compare RMSE; lowest wins. Watch the `warnings` field - "insufficient data" or "could not detect seasonal period" means treat that method's score as suspect, not as a clean win/loss.
  4. If forecast-naive (or drift, the mean-reversion variant) won, the series is essentially random-walk and there's nothing to extrapolate - call forecast-naive with the full values + horizon. The point forecast is just the last value (or last + average drift); the interval widens with √h. This is the honest answer for noisy series; don't over-engineer.
  5. If forecast-ses won, the series has no trend but local level matters more than the long-run mean. Call forecast-ses with the full values + horizon; the alpha SES picked tells you how much weight goes on recent vs. older observations (high alpha = react fast, low alpha = smooth heavy). Report alpha alongside the forecast - it's diagnostic.
  6. If forecast-holt won, the series has a persistent trend worth extrapolating. Call forecast-holt with full values + horizon; it returns level + trend smoothing parameters (alpha, beta) and a forecast that walks forward at the fitted trend slope. The 95% interval grows faster than SES because trend uncertainty compounds.
  7. If forecast-holt-winters won, the series has seasonality you should respect (e.g. monthly macro with annual cycle, quarterly retail with year-end peak). Call forecast-holt-winters with the full values + horizon + period (12 for monthly-annual, 4 for quarterly-annual, 7 for daily-weekly) and seasonality="additive" or "multiplicative". The forecast carries the seasonal pattern forward; never report the point forecast without the interval - seasonal forecasts look confident but compound multiple sources of error.

Arguments

NameRequiredDescriptionExample
seriesyesWhat to forecast - a ticker (AAPL) or a FRED series id (UNRATE, CPIAUCSL)AAPL
horizonnoHow many periods to project forward - e.g. 30 (days for daily data, months for monthly)30

What one call returns

A JSON object with pack, args, steps, summary; steps holds one entry per tool (stock-history, fred-series, forecast-eval, forecast-naive, forecast-ses, forecast-holt, forecast-holt-winters), each with its own result or error. Full example on the API page.

Call it directly

Any x402 client pays the 402 and gets the whole workflow back in one response. With the agent402-client SDK (npm i agent402-client, an ES module):

import { Agent402 } from "agent402-client";
// payFetch: an x402-wrapped fetch your wallet signs (@x402/fetch).
// Tools on the free tier need no options: new Agent402() pays them by proof-of-work.
// an existing prepaid credits key also works: new Agent402({ creditsKey })
const client = new Agent402({ fetch: payFetch });
const result = await client.call("skill-forecasting-bake-off", {"series":"AAPL","horizon":"30"});

Run it in Claude

claude mcp add agent402 -s user -- npx -y agent402-mcp@latest

Then paste this prompt into Claude:

Run a forecasting bake-off on AAPL over the last 2y and project the next 30 trading days using Agent402. (1) Fetch the daily closes via stock-history (ticker=AAPL, range=2y). (2) Run forecast-eval four times on the closes with testSize=100: method="drift", "ses", "holt", and "holt-winters" with period=21 and seasonality="multiplicative" (try the seasonal one - equities usually don't have strong calendar seasonality but the backtest will tell you). (3) Rank by RMSE ascending; the lowest is the winner. Note any `warnings` returned. (4) Call the winning forecast tool (forecast-naive / forecast-ses / forecast-holt / forecast-holt-winters) with the full closes + horizon=30 to get the forward forecast and 95% interval. (5) Return a single JSON object: {rankings: [{method, rmse, mape, warnings}, ...], winner: "holt", forecast: {point: [...], lower95: [...], upper95: [...]}, oneLineConclusion}. All bake-off + forecast calls are free over PoW; only stock-history is paid.

← All skill packs