com.github.servicenow.ds.stats
Class TimeSeriesUtilities
- java.lang.Object
-
- com.github.servicenow.ds.stats.TimeSeriesUtilities
-
public class TimeSeriesUtilities extends java.lang.ObjectTimeSeriesUtilities is a collection of static functions implementing common time-series utilities. Created by Jim Crotinger on 19-Apr-2016.
-
-
Constructor Summary
Constructors Constructor and Description TimeSeriesUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static double[]simpleMovingAverage(double[] data, int window)Compute the simple moving average of the array data using the specified window size and return the results.static voidsimpleMovingAverage(double[] data, int window, double[] average)Compute the simple moving average of the array data using the specified window size and return the results in the array average.
-
-
-
Method Detail
-
simpleMovingAverage
public static double[] simpleMovingAverage(double[] data, int window)Compute the simple moving average of the array data using the specified window size and return the results.- Parameters:
data- double[] array of input datawindow- int width of moving average- Returns:
- double[] of length data.length - window + 1, containing the simple moving average
-
simpleMovingAverage
public static void simpleMovingAverage(double[] data, int window, double[] average)Compute the simple moving average of the array data using the specified window size and return the results in the array average.- Parameters:
data- double[] array of input datawindow- int width of moving averageaverage- double[] array of output data of length at least data.length - window + 1
-
-
DataMelt 3.0 © DataMelt by jWork.ORG