Questions tagged [time-series]

A Time series is a sequence of data points with values measured at successive times (either in continuous time or at discrete time periods). Time series analysis exploits this natural temporal ordering to extract meaning and trends from the underlying data.

Time series data is data with a pattern (“trend”) over time. Quantitative forecasting can be applied when two conditions are satisfied:

  1. numerical information about the past is available;
  2. it is reasonable to assume that some aspects of the past patterns will continue into the future.

Time series data are useful when you are forecasting something that is changing over time (e.g., stock prices, sales figures, profits, etc.). Examples of time series data include:

  • Daily IBM stock prices
  • Monthly rainfall
  • Quarterly sales results for Amazon
  • Annual Google profits

https://www.otexts.org/fpp/1/4

Time series models attempt to make use of the natural one-way ordering of time so that values for a given period will be expressed as a function of past values. This same idea is used in time series forecasting — future values based on past data.

Typically, time series data points are spaced at uniform time intervals.

A time series model will generally reflect the fact that observations close together in time will be more closely related than observations further apart.

As a place to start, take a look at Wikipedia's page on time series. For further reading, refer to the Statsoft website which has an online textbook on time series analysis.

For time series analysis in , consider looking at the Time Series Task View and questions tagged for the zoo package and for the xts package.


Tag usage:

Questions on tag should be about implementation and programming problems, not about the statistical or theoretical properties of the technique. Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics, machine learning and data analysis or Data Science, the StackExchange site for Data Science related topics like time series.

15192 questions
18
votes
3 answers

Transforming a time-series into a data frame and back

The output of a time-series looks like a data frame: ts(rnorm(12*5, 17, 8), start=c(1981,1), frequency = 12) Jan Feb Mar Apr May Jun Jul ... 1981 14.064085 21.664250 14.800249 -5.773095 16.477470 …
Roland Kofler
  • 1,332
  • 1
  • 16
  • 33
18
votes
2 answers

Cross-validation for grouped time-series (panel) data

I work with panel data: I observe a number of units (e.g. people) over time; for each unit, I have records for the same fixed time intervals. When splitting the data into train and test sets, we need to make sure that both sets are disjoint and…
18
votes
3 answers

Ways to connect mongodb to grafana

My question is different ways to connect mongodb with grafana Link for reference ?
18
votes
4 answers

Which R time/date class and package to use?

I have a limited time series exposure in R. So, I wonder which time/date class (and associated package) would be most appropriate to start with. Among the plethora of packages available at CRAN task view, I so far favor the timeDate, which is a S4…
VitoshKa
  • 8,387
  • 3
  • 35
  • 59
18
votes
1 answer

How to construct input data to LSTM for time series multi-step horizon with external features?

I'm trying to use LSTM to do store sales forecast. Here is how my raw data look like: | Date | StoreID | Sales | Temperature | Open | StoreType | |------------|---------|-------|-------------|---------|-----------| | 01/01/2016 | 1 | …
18
votes
5 answers

Find date range overlap in python

I am trying to find a more efficient way of finding overlapping data ranges (start/end dates provided per row) in a dataframe based on a specific column (id). Dataframe is sorted on the 'from' column. I think there is a way to avoid the double apply…
Edouard
  • 183
  • 1
  • 1
  • 5
18
votes
2 answers

How to write a cumulative calculation in data.table

A sequential, cumulative calculation I need to make a time-series calculation, where the value calculated in each row depends on the result calculated in the previous row. I am hoping to use the convenience of data.table. The actual problem is a…
Douglas Clark
  • 2,975
  • 2
  • 17
  • 20
18
votes
2 answers

R: Filling missing dates in a time series?

I have a zoo time series with missing days. In order to fill it and have a continuous series I do... I generate a chron date-time sequence from start to end. I merge my series with this one. I use na.locf to substitute NAs with las obsservation. I…
skan
  • 7,423
  • 14
  • 59
  • 96
18
votes
4 answers

Dates with month and day in time series plot in ggplot2 with facet for years

I want to have both month and day in the x-axis of the time series plot when using facet for years in ggplot2. My MWE is below: set.seed(12345) Date <- seq(as.Date("2010/1/1"), as.Date("2014/1/1"), "week") Y <- rnorm(n=length(Date), mean=100,…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
18
votes
1 answer

Error when trying to use stl and decompose functions in R

I have made a simple time-series, i added a little noise to a sin function and tried to decompose it using the "stl" and "decompose" function in R, while my series definitely has more than 2 period and is periodic, R gives me the following error for…
Etan A Ehsanfar
  • 321
  • 1
  • 3
  • 7
18
votes
2 answers

Irregular, non-contiguous Periods in Pandas

I need to represent a sequence of events. These events are a little unusual in that they are: non-contiguous non-overlapping irregular duration For example: 1200 - 1203 1210 - 1225 1304 - 1502 I would like to represent these events using…
Jack Kelly
  • 2,214
  • 2
  • 22
  • 32
18
votes
5 answers

What is the best open source solution for storing time series data?

I am interested in monitoring some objects. I expect to get about 10000 data points every 15 minutes. (Maybe not at first, but this is the 'general ballpark'). I would also like to be able to get daily, weekly, monthly and yearly statistics. It is…
lorg
  • 1,160
  • 1
  • 10
  • 27
18
votes
2 answers

Interpolating timeseries

I have two sets of data with different time stamps. One set of data contains calibration data, the other contains sample data. The calibration is much less frequent than the samples. What I would like to do is interpolate the calibration data (low…
Alex Archibald
  • 407
  • 1
  • 6
  • 14
18
votes
2 answers

STL decomposition of time series with missing values for anomaly detection

I am trying to detect anomalous values in a time series of climatic data with some missing observations. Searching the web I found many available approaches. Of those, stl decomposition seems appealing, in the sense of removing trend and seasonal…
effie pav
  • 181
  • 1
  • 1
  • 4
17
votes
4 answers

R: merge two irregular time series

I have two multivariate time series x and y, both covering approximately the same range in time (one starts two years before the other, but they end on the same date). Both series have missing observations in the form of empty columns next to the…
Benjamin Allévius
  • 817
  • 1
  • 7
  • 14