Choosing Java Tools or Custom Code for Time-Series Analysis
Summary
The discussion considers Java options for basic time-series analysis, including moving averages, standard deviations, correlations, charting, and exponential smoothing. Suggestions range from implementing common statistics directly to using libraries that provide tabular data structures, technical indicators, or time-series models.
One answer argues that writing simple calculations by hand can improve understanding and avoid relying on implementations whose reliability is uncertain. It also suggests using MATLAB, R, or Python for research and prototyping before implementing production needs in Java. Other replies name several Java libraries, but provide little comparative evaluation or evidence about their accuracy, maintenance, or suitability. The thread is therefore a collection of opinions and pointers rather than a tested recommendation; library capabilities may also have changed since the discussion.
Key ideas
- Simple statistics such as moving averages and standard deviations can be implemented directly in Java.
- The discussion recommends considering research languages for prototyping before translating selected functionality to Java.
- Several replies point to libraries for indicators, tabular data, charts, or time-series modeling.
- The thread offers no benchmarks or systematic comparison of library reliability.
Tags
Full text
# Which library shall I use for time series analysis in Java?
# Which library shall I use for time series analysis in Java?
I'm looking for a library to do some time series analysis in Java but I can't find anything suitable.
I've found plenty of libraries such as Math3 of JSAT but there's much I can you for my problem.
As an example, I'd like to compute standard deviation over time, moving average etc for a specific time series.
## Answer by Simon (score 7)
https://quant.stackexchange.com/a/14587
I work with time series intensively, and I am experienced in Java and scripting languages such as MATLAB and R. I strongly suggest that you should cook up your own implementations in Java, and stop hunting for and relying on any off-the-shelf implementations. They are not reliable. One should be able to write std, corr, cov, ma, etc., easily by hand. Coding them independently can really enhance your comprehension of the underlying problem.
In short, Java is not a good tool for analysis. You may want to perform prototyping and research in MATLAB, R and Python, and implement the required features in Java after the preliminary research.
## Answer by Ben McCann (score 2)
https://quant.stackexchange.com/a/35657
Tablesaw is similar to Python's Pandas: https://github.com/jtablesaw/tablesaw
## Answer by cyberz (score 1)
https://quant.stackexchange.com/a/24659
Some time ago I came up with TimEL, a Java library I've been writing to evaluate expressions for time-series data.
## Answer by Pavol Loffay (score 1)
https://quant.stackexchange.com/a/25525
Here is library for time series modelling. There are exponential smoothing models (simple, double, triple) with maximum likelihood estimation and another time series utility classes:
- https://github.com/hawkular/hawkular-datamining
- http://www.hawkular.org/docs/components/datamining/index.html
## Answer by Shahar (score 0)
https://quant.stackexchange.com/a/14573
You might find TA-Lib useful:
```
TA-Lib is widely used by trading software developers requiring to perform technical analysis of financial market data.
Includes 200 indicators such as ADX, MACD, RSI, Stochastic, Bollinger Bands etc... (more info)
Candlestick pattern recognition
Open-source API for C/C++, Java, Perl, Python and 100% Managed .NET
```
It is pretty useful and versatile: you can grow with it beyond just standard deviation and moving averages, and also to other programming languages, as mentioned above.
Good luck!
## Answer by Algorythmist (score 0)
https://quant.stackexchange.com/a/15801
JFreeeChart provides a TimeSeries data structures with some basic functionality but not a lot of analytics. I have started writing my own and I may open source it if there is sufficient interest. Moving averages, deviations, correlations, returns and most of the easy stuff are already implemented, but I think it needs a few more interesting features before I can consider it truly useful.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.