npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@neural-trader/example-energy-forecasting

v1.0.1

Published

Hourly energy forecasting in TypeScript (solar, wind, demand, temperature): ARIMA/Prophet/LSTM/Transformer ensemble with conformal prediction intervals from @neural-trader/predictor.

Readme

@neural-trader/example-energy-forecasting

Short-horizon forecasts for hourly energy series (solar, wind, electricity demand, temperature) with conformal prediction intervals. Pure TypeScript on top of @neural-trader/predictor, Node.js 18+.

Hourly history goes into an ARIMA and Prophet ensemble; the forecaster returns point forecasts with conformal intervals

What it does

  • EnergyForecaster: trains an ensemble on { timestamp, value } points and returns multi-step forecasts, each with a point value and an interval at 1 - alpha coverage.
  • Models: compact TypeScript implementations of ARIMA, Prophet-style seasonal decomposition, LSTM and Transformer, for demonstration rather than production accuracy.
  • EnsembleSwarm: tries a few hyperparameter settings per model and weights models by validation error.
  • EnergyConformalPredictor: wraps the split and adaptive conformal predictors from @neural-trader/predictor.

Quickstart

npm install @neural-trader/example-energy-forecasting

Save as quickstart.js and run node quickstart.js:

const { EnergyForecaster, EnergyDomain, ModelType } = require('@neural-trader/example-energy-forecasting');

// Four weeks of hourly electricity demand (MW): a daily cycle around 1000 MW
const start = Date.UTC(2026, 5, 1);
const history = Array.from({ length: 24 * 28 }, (_, h) => ({
  timestamp: start + h * 3600e3,
  value: 1000 + 200 * Math.sin((2 * Math.PI * (h % 24)) / 24),
}));

(async () => {
  const forecaster = new EnergyForecaster(EnergyDomain.DEMAND, {
    alpha: 0.1, // 90% prediction intervals
    horizon: 6,
    seasonalPeriod: 24,
    ensembleConfig: { models: [ModelType.ARIMA, ModelType.PROPHET] },
  });
  await forecaster.train(history);
  const { forecasts } = await forecaster.forecast(6);
  forecasts.forEach((f, i) =>
    console.log(`t+${i + 1}h`, f.pointForecast.toFixed(0), `[${f.interval.lower.toFixed(0)}, ${f.interval.upper.toFixed(0)}]`));
})();

Expected output (training progress, then the forecasts; the true values for these six hours are 1052, 1100, 1141, 1173, 1193, 1200):

Training ensemble with 537 samples...
Exploring arima hyperparameters...
Exploring prophet hyperparameters...
arima trained with MAPE: 34.32%
prophet trained with MAPE: 24.15%
Initializing conformal predictors...
arima conformal predictor calibrated
prophet conformal predictor calibrated
Training complete!
t+1h 1033 [585, 1481]
t+2h 1112 [664, 1560]
t+3h 1186 [738, 1635]
t+4h 1250 [802, 1698]
t+5h 1300 [851, 1748]
t+6h 1331 [883, 1780]

stderr also shows one warning: the hyperparameter search skips a weekly seasonal period that needs more history than four weeks.

Changes in 1.0.1

1.0.0 could not be installed: it depended on workspace:*, on agentdb@^2 (no such release) and on openrouter@^1 (no such package). 1.0.1 depends only on @neural-trader/[email protected], the one package it imports.

License

MIT OR Apache-2.0. More packages: ruv.io.