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

Use center in pandas rolling when using a time-series

I am trying to set center=True in pandas rolling function, for a time-series: import pandas as pd series = pd.Series(1, index = pd.date_range('2014-01-01', '2014-04-01', freq = 'D')) series.rolling('7D', min_periods=1, center=True,…
karen
  • 822
  • 1
  • 6
  • 22
17
votes
2 answers

Using Keras for video prediction (time series)

I want to predict the next frame of a (greyscale) video given N previous frames - using CNNs or RNNs in Keras. Most tutorials and other information regarding time series prediction and Keras use a 1-dimensional input in their network but mine would…
Isa
  • 1,121
  • 3
  • 10
  • 17
17
votes
1 answer

Time Series Analysis - unevenly spaced measures - pandas + statsmodels

I have two numpy arrays light_points and time_points and would like to use some time series analysis methods on those data. I then tried this : import statsmodels.api as sm import pandas as pd tdf = pd.DataFrame({'time':time_points[:]}) rdf = …
Robin
  • 605
  • 2
  • 8
  • 25
17
votes
1 answer

Setting limits with scale_x_datetime and time data

I want to set bounds for the x-axis for a plot of time-series data which features only time (no dates). My limits are: lims <- strptime(c("03:00","16:00"), format = "%H:%M") And my ggplot prints fine, but when I add this to…
raphael
  • 2,762
  • 5
  • 26
  • 55
17
votes
1 answer

How to present multiple time-series data to an SVM (ksvm) in R (or, How to present two-dimensional input data to an SVM)

How can I make a ksvm model aware that the first 100 numbers in a dataset are all time series data from one sensor, while the next 100 numbers are all time series data from another sensor, etc, for six separate time series sensor inputs?…
phonetagger
  • 7,701
  • 3
  • 31
  • 55
17
votes
3 answers

Find closest row of DataFrame to given time in Pandas

I have a Pandas dataframe which is indexed by a DatetimeIndex: DatetimeIndex: 53732 entries, 1993-01-07 12:23:58 to 2012-12-02 20:06:23 Data columns: Date(dd-mm-yy)_Time(hh-mm-ss) 53732 non-null…
robintw
  • 27,571
  • 51
  • 138
  • 205
17
votes
3 answers

Package for time series analysis in python

I am working on time series in python. The libraries which I found useful and promising are pandas; statsmodel (for ARIMA); simple exponential smoothing is provided from pandas. Also for visualization: matplotlib Does anyone know a library…
foc
  • 947
  • 1
  • 9
  • 26
16
votes
1 answer

How can I persuade ggplot2 geom_text to label a specified date in a time series plot?

I am using ggplot2 to plot simple line charts of time series data. One difficulty I have run into is labelling specific points corresponding to x-axis values i.e. dates. library(ggplot2) library(scales) date <-…
SlowLearner
  • 7,907
  • 11
  • 49
  • 80
16
votes
3 answers

Keras LSTM Autoencoder time-series reconstruction

I am trying to reconstruct time series data with LSTM Autoencoder (Keras). Now I want train autoencoder on small amount of samples (5 samples, every sample is 500 time-steps long and have 1 dimension). I want to make sure that model can reconstruct…
Tombozik
  • 161
  • 1
  • 5
16
votes
2 answers

Difference pandas.DateTimeIndex without a frequency

An irregular time series data is stored in a pandas.DataFrame. A DatetimeIndex has been set. I need the time difference between consecutive entries in the index. I thought it would be as simple as data.index.diff() but got AttributeError:…
clstaudt
  • 21,436
  • 45
  • 156
  • 239
16
votes
1 answer

seasonal decompose in python

I have a CSV file that contains the average temperature over almost 5 years. After decomposition using seasonal_decompose function from statsmodels.tsa.seasonal, I got the following results. Indeed, the results do not show any seasonal! However, I…
16
votes
1 answer

python pandas sum by hour of day

I'm working with the following dataset with hourly counts (df): The datframe has 8784 rows (for the year 2016, hourly). I'd like to see if there are daily trends (e.g if there is an increase in the morning hours. For this i'd like to create a plot…
julia_3010
  • 255
  • 1
  • 2
  • 11
16
votes
3 answers

value error in python statsmodels.tsa.seasonal

I have this dataframe with date time indices: ts_log: date price_per_unit 2013-04-04 12.762369 2013-04-05 12.777120 2013-04-06 12.773146 2013-04-07 12.780774 2013-04-08 12.786835 I have this piece of code for decomposition from…
Reza
  • 728
  • 1
  • 10
  • 28
16
votes
3 answers

pandas.Series() Creation using DataFrame Columns returns NaN Data entries

Im attempting to convert a dataframe into a series using code which, simplified, looks like this: dates = ['2016-1-{}'.format(i)for i in range(1,21)] values = [i for i in range(20)] data = {'Date': dates, 'Value': values} df =…
deepbrook
  • 2,523
  • 4
  • 28
  • 49
16
votes
2 answers

Converting data.frame to xts order.by requires an appropriate time-based object

I have this following data frame: > head(table,10) Date Open High Low Close Volume Adj.Close 1 2014-04-11 32.64 33.48 32.15 32.87 28040700 32.87 2 2014-04-10 34.88 34.98 33.09 33.40 33970700 33.40 3 2014-04-09 34.19…
asosnovsky
  • 2,158
  • 3
  • 24
  • 41