QuickStatistics.Net 3.2.0

dotnet add package QuickStatistics.Net --version 3.2.0
NuGet\Install-Package QuickStatistics.Net -Version 3.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="QuickStatistics.Net" Version="3.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add QuickStatistics.Net --version 3.2.0
#r "nuget: QuickStatistics.Net, 3.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install QuickStatistics.Net as a Cake Addin
#addin nuget:?package=QuickStatistics.Net&version=3.2.0

// Install QuickStatistics.Net as a Cake Tool
#tool nuget:?package=QuickStatistics.Net&version=3.2.0


this library contains some lightweight math functions for my projects. The main purpose is to obtain fast, reliable and well performing statistics on live fed data. This is particularly useful on Sensor Data, Spot Data or to get statistics on data where the dataset is simply too large to fit into memory.

The focus is on simplicity, stability and the utmost performance which I'm personally able to archieve through my skills.

It is not about errorhandling. Make sure, you feed quality data. Garbage in, Garbage out. While I try to add unit tests to my projects, do a quick test yourself and check if the data pushed out by this library actually makes sense to you.

Current implementations


  • Moving average
using QuickStatistics.Net.Average_NS;

// Create a new Moving_Average_Double object with a total tracking time of 2 hours and a value resolution of 1 minute
Moving_Average_Double ma = new Moving_Average_Double(TimeSpan.FromHours(2), TimeSpan.FromMinutes(1));

// Add some values to the moving average

// Get the current value of the moving average
double currentValue = ma.Value;

// Set the resolution to track the past 3 hours with a value resolution of 15 minutes
ma.SetResolution(TimeSpan.FromHours(3), TimeSpan.FromMinutes(15));

// Add a value with a timestamp of 1 hour ago
ma.AddValue(8, DateTime.Now - TimeSpan.FromHours(1));

// Get the current value of the moving average
currentValue = ma.Value;

// Clear all values in the moving average


  • progressing_Average: a straight forward, very fast, precise implementation for calculating the average value. Limit is int.max (count of values) so it is not suited for an infinite stream of data such as for sensors
  • ProgressingAverage_Nano: Same as ProgressingAverave but optimized for absolute minimum memory footprint in case a large quantity of averages needs to be tracked.
// Arrange
float currentValue = 0;
ushort elementCount = 0;

// Act
ProgressingAverage_Nano.AddValue(ref currentValue, ref elementCount, 0);
ProgressingAverage_Nano.AddValue(ref currentValue, ref elementCount, 10);

// Verify
Assert.Equal(5, currentValue);
Assert.Equal(2ul, elementCount);
  • Simple_Exponential_Average: Moving average approximation, very fast and lightweight
  • Simple_Moving_Average: Average on the fly (omitting memory restraints and overflow) Supports: AbsoluteRateOfChange, Trend, Momentum, Deviation
  • Volumetric average for 2 values (averaging two values by their weight)
  • Moving_Average: Time based moving average (good for historic data and data with gaps, also good for targeting a certain time duration or when the input data stream is not consistent in speed) Maps the incoming data to a consistient timeline with variable resolution Supports: AbsoluteRateOfChange, Trend, Momentum, Deviation


Median can be calculated:

  • On an array / List
  • Procedural upon adding values
  • On a rolling time window

Minimum / Maximum

  • Calculate Maximum or Minimum for a given amount of Datapoints (useful for sensor Data)
  • Calculate Maximum or Minimum for a sliding time window (useful for historical or inconsistent Data)


  • obtain standard deviation on the fly. (warning: will overflow if ran indefinitely)
  • obtain exponential standard deviation on the fly for infinite amount of data points (less precision)
  • AbsoluteRateOfChange, Trend, Momentum and Deviation on sliding windows (Supported by simple moving average & moving average)
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on QuickStatistics.Net:

Package Downloads

fix transparency with image convert


a small library to help converting, mixing and generating colors

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.2.0 97 4/17/2024
3.1.0 80 4/17/2024
3.0.0 81 4/16/2024
2.6.0 140 1/12/2024
2.5.1 96 1/11/2024
2.5.0 123 12/22/2023
2.4.0 112 12/12/2023
2.3.4 143 10/31/2023
2.3.3 97 10/31/2023
2.3.2 97 10/31/2023
2.3.1 95 10/31/2023
2.2.1 87 10/31/2023
2.2.0 80 10/31/2023
2.1.2 96 10/31/2023
2.1.0 156 7/28/2023
2.0.0 123 5/10/2023
1.0.1 280 1/25/2023
1.0.0 260 1/9/2023

imemented several functions related to normal distributions to moving median and the variance namespace

- Renamed RunningMedian to ProgressingMedian to fall in line with ProgressingAverage
- Added feature to get distributionMap from Median
- MovingMedian can obtain a percentile now

- implemented enumerable downsampling methods
- implemented enumerable upsampling methods
- expanded unit tests
- Fixed a critical issue in Moving median where the result was shifted by 1 slot
- update generic methods (>= .NET 7)
- added several extension methods for arrays
double[] myEnumerable = [1,3];
double average = myEnumerable.GetAverage();