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
28
votes
3 answers

MongoDB as a Time Series Database

I'm trying to use mongodb for a time series database and was wondering if anyone could suggest how best to set it up for that scenario. The time series data is very similar to a stock price history. I have a collection of data from a variety of…
sequoia
  • 3,025
  • 8
  • 33
  • 41
28
votes
2 answers

How to setup 1D-Convolution and LSTM in Keras

I would like to use 1D-Conv layer following by LSTM layer to classify a 16-channel 400-timestep signal. The input shape is composed of: X = (n_samples, n_timesteps, n_features), where n_samples=476, n_timesteps=400, n_features=16 are the number of…
Thuan N.
  • 369
  • 1
  • 5
  • 11
28
votes
5 answers

SparkSQL on pyspark: how to generate time series?

I'm using SparkSQL on pyspark to store some PostgreSQL tables into DataFrames and then build a query that generates several time series based on a start and stop columns of type date. Suppose that my_table contains: start | stop …
pietrop
  • 1,071
  • 2
  • 10
  • 27
28
votes
4 answers

starting a daily time series in R

I have a daily time series about number of visitors on the web site. my series start from 01/06/2014 until today 14/10/2015 so I wish to predict number of visitor for in the future. How can I read my series with R? I'm thinking: series <-…
max
  • 281
  • 1
  • 4
  • 6
28
votes
4 answers

Using geom_rect for time series shading in R

I am trying to shade a certain section of a time series plot (a bit like recession shading - similarly to the graph at the bottom of this article on recession shading in excel). I have put a little, possibly clumsy, sample together to illustrate. I…
toksing
  • 325
  • 1
  • 3
  • 7
28
votes
5 answers

optimized rolling functions on irregular time series with time-based window

Is there some way to use rollapply (from zoo package or something similar) optimized functions (rollmean, rollmedian etc) to compute rolling functions with a time-based window, instead of one based on a number of observations? What I want is simple:…
vsalmendra
  • 577
  • 1
  • 6
  • 13
27
votes
7 answers

Time series forecasting (eventually with python)

What algorithms exist for time series forecasting/regression ? What about using neural networks ? (best docs about this topic ?) Are there python libraries/code snippets that can help ?
gpilotino
  • 13,055
  • 9
  • 48
  • 61
27
votes
4 answers

Pandas: Remove NaN only at beginning and end of dataframe

I've got a pandas DataFrame that looks like this: sum 1948 NaN 1949 NaN 1950 5 1951 3 1952 NaN 1953 4 1954 8 1955 NaN and I would like to cut off the NaNs at the beginning and at the end ONLY (i.e. only the values…
user3017048
  • 2,711
  • 3
  • 22
  • 32
27
votes
4 answers

simple examples of filter function, recursive option specifically

I am seeking some simple (i.e. - no maths notation, long-form reproducible code) examples for the filter function in R I think I have my head around the convolution method, but am stuck at generalising the recursive option. I have read and battled…
thelatemail
  • 91,185
  • 12
  • 128
  • 188
26
votes
1 answer

Difference between time-series database and relational database

I have read some concept about time-series database and some answers about the differences between these 2 but I can't still get my head around these differences. How data is written and stored to disk that make the differences between time-series…
xtiger
  • 1,446
  • 2
  • 15
  • 33
26
votes
3 answers

Forecasting time series data

I've done some research and I am stuck in finding the solution. I have a time series data, very basic data frame, let's call it x: Date Used 11/1/2011 587 11/2/2011 578 11/3/2011 600 11/4/2011 599 11/5/2011 678 11/6/2011 …
george willy
  • 1,693
  • 8
  • 22
  • 26
25
votes
1 answer

Pandas missing values : fill with the closest non NaN value

Assume I have a pandas series with several consecutive NaNs. I know fillna has several methods to fill missing values (backfill and fill forward), but I want to fill them with the closest non NaN value. Here's an example of what I have: s =…
Clément F
  • 3,535
  • 6
  • 18
  • 26
25
votes
4 answers

Convert date to float for linear regression on Pandas data frame

It seems that for OLS linear regression to work well in Pandas, the arguments must be floats. I'm starting with a csv (called "gameAct.csv") of the form: date, city, players,…
Quetzalcoatl
  • 2,016
  • 4
  • 26
  • 36
25
votes
3 answers

Date ranges in Pandas

After fighting with NumPy and dateutil for days, I recently discovered the amazing Pandas library. I've been poring through the documentation and source code, but I can't figure out how to get date_range() to generate indices at the right…
knite
  • 6,033
  • 6
  • 38
  • 54
24
votes
2 answers

Error: ValueWarning: A date index has been provided, but it has no associated frequency information and so will be ignored when e.g. forecasting

So I have a CSV file with two columns: date and price, but when I tried to use ARIMA on that time series I encountered this error: ValueWarning: A date index has been provided, but it has no associated frequency information and so will be ignored…
Dorki
  • 1,021
  • 2
  • 8
  • 23