Average function library
Joule math functions
Last updated
Joule math functions
Last updated
Averages are essential for summarising trends and smoothing fluctuations in datasets. This section covers three common types of averages:
Exponential Moving Average (EMA) This method emphasises recent data points, making it responsive to changes, particularly in financial applications.
Weighted Moving Average This average assigns different weights to data points, allowing for a focus on more important observations.
Simple Moving Average (SMA) The SMA calculates the unweighted mean of a fixed number of previous data points and is often used to identify trends over time.
Each type of average offers unique insights, making them valuable tools in data analysis.
Following is a list of the average functions which can be leverage through Joule.
An exponential moving average (EMA), also known as an exponentially weighted moving average (EWMA),[5] is a first-order infinite impulse response filter that applies weighting factors which decrease exponentially. The weighting for each older datum decreases exponentially, never reaching zero. This formulation is according to Hunter (1986) [wikipedia].
Attribute | Description | Data Type | Required |
---|---|---|---|
A weighted average is an average that has multiplying factors to give different weights to data at different positions in the sample window. Mathematically, the weighted moving average is the convolution of the data with a fixed weighting function [wikipedia].
In financial applications a simple moving average (SMA) is the unweighted mean of the previous 𝑘 data-points. However, in science and engineering, the mean is normally taken from an equal number of data on either side of a central value. This ensures that variations in the mean are aligned with the variations in the data rather than being shifted in time [wikipedia].
fields
Fields to calculated from the event
String[]
event history
Number of rolling events to stored and used for the calculation
Integer
assign prefix
Prefix to use for the result assignment. This is used to allow the same function to be used multiple times. If this is not provided the function postfix will be applied e.g. ask_EMA
String Default: Function postfix