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

time-series-error

v2.0.7

Published

Time Series Error Evaluation Metrics

Downloads

1

Readme

Time Series Error (tserror) :chart_with_upwards_trend: :rocket:

This node package consists with basic time series error evaluation metric implementation in js. You can use this package for any machine learning model evaluation other than the time series secnarios.

Recommended Release: 2.0.5

How to use

  • First, you have to assign the actual and forecasted the data points in seperate lists in choronological order.
  • Make sure to invoke the methods with only the values(data points) without time_stamps.

Implemented Error Metrics

Mean Forecast Error (MFE)

mfe(real_time_values, forecasted_data_values)

Provides the direction of the error. Better forecasts yields MFE near to zero. Doesn't identify extreme errors. Easily identify data transformation and observation scale.

Mean Squared Error (MSE)

mse(real_data_values, forecasted_data_values)

Provides overall idea of the error. Better forecasts yields MSE close to zero. Resolve not penalizing the xtereme errors by MFE. Sensitive to observations scale and data transformations.

Root Mean Sqaured Error (RMSE)

rmse(real_data_values, forecasted_data_values)

Provides rooted error value of mse. Shows significance of the balanced error. Better when the rmse near to zero.

Mean Absolute Error (MAE)

mae(real_data_values, forecasted_data_values)

Summation of the absolute terms of the errors despicts in Mean Absolute Error

Mean Absolute Scaled Error (MASE)

mase(real_data_values, forecasted_data_values)

MASE is a scale-free error metric that gives each error as a ratio compared to a baseline’s average error.

Mean Absolute Percentage Error (MAPE)

mape(real_data_values, forecasted_data_values)

Total error represented as an percentage, which is scale -independent and can be used for comparing on different scales. This is asymmetric and allows heavier penality on negative errors than positive errors.

Scaled Mean Absolute Percentage Error (sMAPE)

smape(real_data_values, forecasted_data_values)

Resolved the asymmetric of MAPE. Error persent as a percentage. This error originally introduced in M3 competition. Fixes the shortcoming of the original MAPE — it has both the lower (0%) and the upper (200%) bounds.

Example

var myerror = require('time-series-error');

a = [1.78,3.76,6.78,9.0]
b = [1.65,3.80,6.10,9.5]

console.log(myerror.mfe(a,b))
console.log(myerror.mse(a,b))
console.log(myerror.rmse(a,b))