---
title: Statistical Functions
slug: litmusedge/statistical-function-overview
createdAt: 2024-08-06T18:53:05.058Z
---

The Analytics module makes use of built-in statistical functions to process the input data. Each processor below performs one kind of operation and are grouped here by what you're trying to do.

## Transform a value

| **Processor**                                    | **What it does**                                                                |
| ------------------------------------------------ | ------------------------------------------------------------------------------- |
| [Change](docId\:tQT_WmLlnG5m3ZQJoAUOA)           | Sets, replaces, deletes, or moves a field's value.                              |
| [Conversion](docId\:djBs7eHMMsmSwcEc5nrs-)       | Converts common factory units, such as temperature, angle, or timestamp format. |
| [Base Conversion](docId\:e4-WrFnt8-bBpQ9LYvWEt)  | Converts a number between decimal, binary, octal, and hexadecimal.              |
| [Normalization](docId\:W14LBhZ85neoP7nOCx8qn)    | Scales incoming values into a 0-to-1 range.                                     |
| [Rounding](docId:0v93-YJDX8EzDz51ivnzu)          | Rounds a number to a set number of decimal digits.                              |

## Filter and smooth a signal

| **Processor**                                         | **What it does**                                                                       |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [Gaussian Filter](docId\:P-Gq3y-dT0yttszQK78E-)       | Smooths a signal using a Gaussian weighting function while preserving its trend.       |
| [Moving Window](docId\:LhRZ9Q_ylqg0rq6uqxBib)         | Calculates a continuously updating average, maximum, or minimum over a sliding window. |
| [Simple Window](docId\:TrFZln0j3lIy1WvNuK-4b)         | Outputs a raw moving window of recent values, oldest to newest.                        |
| [Signal Decomposition](docId\:mrRZ8XebpDGJjAaz9kP4U)  | Separates a time series into trend, seasonality, and residual components.              |

## Detect patterns and monitor quality

| **Processor**                                          | **What it does**                                                                                           |
| ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
| [Anomaly Detection](docId\:yfO25TUsA1e0Jozm93nnQ)      | Flags data points outside a normal statistical range using the three-sigma rule.                           |
| [Rise and Fall](docId\:nFGS9eY_iIvtbnBrLJVXm)          | Detects when a value crosses a threshold and reports the crossing's duration.                              |
| [SPC Charts](docId\:UGp1yNvgZaCz0jhm2x6gu)             | Assesses process performance and capability against specification limits, flagging Nelson Rule violations. |
| [XMR Chart](docId\:Je0DPvRpzPzSDMf2KJB0w)              | Tracks a process against control limits calculated from a stabilized baseline.                             |
| [Statistical Functions](docId\:pbqPg2jOcoRtGY3OJgo6o)  | Tests whether a window of data matches a normal distribution using goodness-of-fit tests.                  |

## Predict future values

| **Processor**                                           | **What it does**                                                                    |
| ------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [ARIMA Filter](docId\:b79lhgg8fhtGSie2-tZBa)            | Forecasts the next value using an ensemble of ARIMA models fit to a rolling window. |
| [Linear Prediction](docId:_Qu183C75gRucbknI0VPQ)        | Forecasts future values by fitting a linear trend line to recent data.              |
| [Statistical Prediction](docId\:yMXcWsvSTrurMzZs_PGZd)  | Forecasts future values with cyclical patterns using a Fast Fourier Transform.      |

## Route or combine messages

| **Processor**                                          | **What it does**                                                          |
| ------------------------------------------------------ | ------------------------------------------------------------------------- |
| [Switch](docId\:AwSOaV-oYt5YqlJqZWnm3)                 | Forwards a message only when it passes a rule you define.                 |
| [Inputs](docId\:SP5iJen4Q-XNxREIlchdi)                 | Calculates an average, maximum, minimum, or sum across multiple inputs.   |
| [Combination Processor](docId\:yoVCJhG_N3mceQTs8gZ4-)  | Combines fields from multiple input processors into a single JSON string. |
| [Join Processor](docId\:xE4tb9WA_d7DmB9hUYf6K)         | Combines the output of multiple input processors into a single message.   |

## Apply AI and ML models

| **Processor**                                                | **What it does**                                                                                                 |
| ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| [AI Processor](docId\:yYretv-LuMoiX8Kp0ezGt)                 | Sends data to an AI model and returns its response, for summarizing, classifying, or extracting structured data. |
| [AI Vision Processor](docId\:kR1EDKYP9KNiQ7RsCZY96)          | Sends an image to an AI model and returns its response.                                                          |
| [Feature Extractor](docId\:JGgyi2TOODvs5hy4hh81i)            | Calculates statistical features, such as average, standard deviation, and skewness, from a window of values.     |
| [TensorFlow Processor](docId\:We_FgWet1oX-foiS45mNy)         | Feeds time-series data to a trained TensorFlow model.                                                            |
| [TensorFlow Images Processor](docId\:hDS9JBv_OoQWptSoFXUDe)  | Feeds images to a trained TensorFlow model.                                                                      |

## Write custom logic

| **Processor**                                         | **What it does**                                                       |
| ----------------------------------------------------- | ---------------------------------------------------------------------- |
| [Expression](docId:5eg8slQl4Uh6CYxjzJsnI)             | Evaluates a custom mathematical formula against input values.          |
| [JavaScript Processor](docId\:sgPpz90jjNSjH5dZagJcd)  | Adds, removes, or modifies message fields using JavaScript.            |
| [JSONata Processor](docId:1Vu5NprWs7sDqR3W0Iipa)      | Reshapes, filters, or combines JSON fields using a JSONata expression. |
| [Tengo Script](docId:6gsp0epdfYo3QyQimFsPr)           | Adds, removes, or modifies message fields using a Tengo script.        |

## Read files

| **Processor**                                           | **What it does**                                                |
| ------------------------------------------------------- | --------------------------------------------------------------- |
| [File Reading Processor](docId\:qGYvA1aHeMszhjJKBcK1T)  | Reads a file's contents and returns them in the output payload. |

