A small Java library for time-series analysis and forecasting.
- exponential smoothing: single, double, and triple
- moving averages: simple, cumulative, exponential, and weighted
- transformations: log, roots, and Box-Cox
- statistics: mean, variance, autocovariance, ACF, and PACF
- stationarity testing with Augmented Dickey-Fuller
The project targets Java 17 and uses Gradle.
gradle testThis snapshot does not include the generated gradle-wrapper.jar, so gradle is the most reliable entry point unless you regenerate the wrapper locally.
Primary implementation packages:
tslib.collecttslib.model.expsmoothingtslib.movingaveragetslib.teststslib.transformtslib.util
Compatibility aliases added in this patch:
tslib.model.*forwards totslib.model.expsmoothing.*tslib.stats.Statsforwards totslib.util.Stats
These aliases make the public API line up with the README examples without breaking existing imports.
import java.util.List; import tslib.model.ExponentialSmoothing; import tslib.model.TripleExpSmoothing; import tslib.movingaverage.MovingAverage; import tslib.movingaverage.SimpleMovingAverage; import tslib.transform.Transform; import tslib.util.Util; List<Double> data = Util.readFile("data/hotel.txt"); ExponentialSmoothing model = new TripleExpSmoothing(0.5, 0.3, 0.2, 12, false); List<Double> forecast = model.forecast(data, 5); MovingAverage sma = new SimpleMovingAverage(3); List<Double> smoothed = sma.compute(data); double lambda = Transform.boxCoxLambdaSearch(data); List<Double> transformed = Transform.boxCox(data, lambda);See the examples/ directory for runnable snippets.
This patch makes the following repo-level improvements:
- fixes the Gradle project name from
expsmoothingtotslib - removes deprecated
jcenter()in favor ofmavenCentral() - adds API compatibility aliases for the package names shown in the docs
- refreshes CI to use current Gradle and Java setup
- adds focused regression tests and example programs
- adds a changelog stub for future releases