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
14
votes
5 answers

How to calculate rolling cumulative product on Pandas DataFrame

I have a time series of returns, rolling beta, and rolling alpha in a pandas DataFrame. How can I calculate a rolling annualized alpha for the alpha column of the DataFrame? (I want to do the equivalent to =PRODUCT(1+[trailing 12 months])-1 in…
AP228
  • 333
  • 1
  • 3
  • 6
14
votes
1 answer

How to analyse irregular time-series in R

I have a zoo time series in R: d <- structure(c(50912, 50912, 50912, 50912, 50913, 50913, 50914, 50914, 50914, 50915, 50915, 50915, 50916, 50916, 50916, 50917, 50917, 50917, 50918, 50918, 2293.8, 2302.64, 2310.5, 2324.02, 2312.25, 2323.93,…
robintw
  • 27,571
  • 51
  • 138
  • 205
14
votes
3 answers

KDB+ like asof join for timeseries data in pandas?

kdb+ has an aj function that is usually used to join tables along time columns. Here is an example where I have trade and quote tables and I get the prevailing quote for every trade. q)5# t time sym price size…
signalseeker
  • 4,100
  • 7
  • 30
  • 36
14
votes
6 answers

Peak Detection in Time Series

I'm currently working on a little project in which I want to compare two time-series. The similarity measure is really vague, they are considered to be similar if the two time series roughly have the same shape. So I thought to myself "Well if they…
IdealOutage
  • 69
  • 1
  • 1
  • 11
14
votes
6 answers

How to align two unequal sized timeseries numpy array?

I have two numpy arrays containing timeseries (unix timestamps). I want to find pairs of timestamps (1 from each array) whose difference is within a threshold. For achieving this, I need to align two of the time series data into two arrays, such…
Dexters
  • 2,419
  • 6
  • 37
  • 57
13
votes
8 answers

general lag in time series panel data

I have a dataset akin to this User Date Value A 2012-01-01 4 A 2012-01-02 5 A 2012-01-03 6 A 2012-01-04 7 B 2012-01-01 2 B 2012-01-02 3 B 2012-01-03 4 B 2012-01-04 5 I want to…
Daniel Egan
  • 826
  • 1
  • 9
  • 22
13
votes
1 answer

Time Series data on PostgreSQL

MongodDB 5.0 comes with support for time series https://docs.mongodb.com/manual/core/timeseries-collections/ I wonder, what is status with PostgreSQL support for time series? I could quickly find…
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
13
votes
1 answer

Multivariate time series forecasting with 3 months dataset

I have 3 months of data (each row corresponding to each day) generated and I want to perform a multivariate time series analysis for the same : the columns that are available are - Date Capacity_booked Total_Bookings Total_Searches …
dper
  • 884
  • 1
  • 8
  • 31
13
votes
3 answers

How to perform time series analysis that contains multiple groups in Python using fbProphet or other models?

All, My dataset looks like following. I am trying to predict the 'amount' for next 6 months using either the fbProphet or other model. But my issue is that I would like to predict amount based on each groups i.e A,B,C,D for next 6 months. I am not…
Data_is_Power
  • 765
  • 3
  • 12
  • 30
13
votes
1 answer

Statsmodels seasonal_decompose - what is naive about it?

Have been working with time series in Python, and using sm.tsa.seasonal_decompose. In the docs they introduce the function like this: We added a naive seasonal decomposition tool in the same vein as R’s decompose. Here is a copy of the code from…
cardamom
  • 6,873
  • 11
  • 48
  • 102
13
votes
1 answer

Filling gaps in timeseries Spark

I have a problem dealing with time-series data. Due power failures some timestamps are missing in the dataset. I need to fill this gaps by adding rows, and after that, I can interpolate the missing values. Input data: periodstart …
RHeutz
  • 131
  • 1
  • 1
  • 5
13
votes
1 answer

Pandas Rolling Window - datetime64[ns] are not implemented

I'm attempting to use Python/Pandas to build some charts. I have data that is sampled every second. Here is a sample: Index, Time, Value 31362, 1975-05-07 07:59:18, 36.151612 31363, 1975-05-07 07:59:19, 36.181368 31364, 1975-05-07 07:59:20, …
David Crook
  • 2,722
  • 3
  • 23
  • 49
13
votes
3 answers

Detecting rare incidents from multivariate time series intervals

Given a time series of sensor state intervals, how do I implement a classifier which learns from supervised training data to detect an incident based on a sequence of state intervals? To simplify the problem, sensor states are reduced to either true…
Petrus Theron
  • 27,855
  • 36
  • 153
  • 287
13
votes
1 answer

Fill the missing date values in a Pandas Dataframe column

I'm using Pandas to store stock prices data using Data Frames. There are 2940 rows in the dataset. The Dataset snapshot is displayed below: The time series data does not contain the values for Saturday and Sunday. Hence missing values have to be…
User456898
  • 5,704
  • 5
  • 21
  • 37
13
votes
3 answers

pandas dataframe resample per day without date time index

I have a dataframe in pandas of the following form: timestamps light 7 2004-02-28 00:58:45 150.88 26 2004-02-28 00:59:45 143.52 34 2004-02-28 01:00:45 150.88 42 2004-02-28 01:01:15 150.88 59 2004-02-28 01:02:15 150.88 Here note…
Nikhil
  • 545
  • 1
  • 7
  • 18