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

Time Series Prediction via Neural Networks

I have been working on Neural Networks for various purposes lately. I have had great success in digit recognition, XOR, and various other easy/hello world'ish applications. I would like to tackle the domain of time series estimation. I do not have a…
20
votes
1 answer

Pandas DataFrame - 'cannot astype a datetimelike from [datetime64[ns]] to [float64]' when using ols/linear regression

I have a DataFrame as follows: Ticker Date Close 0 ADBE 2016-02-16 78.88 1 ADBE 2016-02-17 81.85 2 ADBE 2016-02-18 80.53 3 ADBE 2016-02-19 80.87 4 ADBE 2016-02-22 83.80 5 ADBE 2016-02-23 83.07 ...and so on. The Date column is…
Cole Starbuck
  • 603
  • 3
  • 11
  • 21
20
votes
3 answers

Inserting with a specific time?

I am looking through all the InfluxDB examples, and they all seem to insert with "time now" (time of insert). There is a well-defined "time" field, but none of the examples use it. Recording the time of an event as "insert time into the DB" is a…
Brian Bulkowski
  • 866
  • 1
  • 7
  • 10
20
votes
3 answers

Time-series - data splitting and model evaluation

I've tried to use machine learning to make prediction based on time-series data. In one of the stackoverflow question (createTimeSlices function in CARET package in R) is an example of using createTimeSlices to cross-validation for model training…
Jot eN
  • 6,120
  • 4
  • 40
  • 59
20
votes
6 answers

Hidden Markov Model for multiple observed variables

I am trying to use a hidden Markov model (HMM) for a problem where I have M different observed variables (Yti) and a single hidden variable (Xt) at each time point, t. For clarity, let us assume all observed variables (Yti) are categorical, where…
Zhubarb
  • 11,432
  • 18
  • 75
  • 114
19
votes
2 answers

How can I detect if trend is increasing or decreasing in time series?

I have few weeks data with units sold given xs[weeks] = [1,2,3,4] ys['Units Sold'] = [1043,6582,5452,7571] from the given series, we can see that although there is a drop from xs[2] to xs[3] but overall the trend is increasing. How to detect the…
Kanika Singhal
  • 253
  • 1
  • 2
  • 10
19
votes
4 answers

how to understand closed and label arguments in pandas resample method?

Based on the pandas documentation from here: Docs And the examples: >>> index = pd.date_range('1/1/2000', periods=9, freq='T') >>> series = pd.Series(range(9), index=index) >>> series 2000-01-01 00:00:00 0 2000-01-01 00:01:00 1 2000-01-01…
mingchau
  • 450
  • 3
  • 12
19
votes
4 answers

Filling missing dates in a grouped time series - a tidyverse-way?

Given a data.frame that contains a time series and one or ore grouping fields. So we have several time series - one for each grouping combination. But some dates are missing. So, what's the easiest (in terms of the most "tidyverse way") of adding…
JerryWho
  • 3,060
  • 6
  • 27
  • 49
19
votes
1 answer

How to Use Lagged Time-Series Variables in a Python Pandas Regression Model?

I'm creating time-series econometric regression models. The data is stored in a Pandas data frame. How can I do lagged time-series econometric analysis using Python? I have used Eviews in the past (which is a standalone econometric program i.e. not…
Steve Maughan
  • 1,174
  • 3
  • 19
  • 30
19
votes
2 answers

Is RNN initial state reset for subsequent mini-batches?

Could someone please clarify whether the initial state of the RNN in TF is reset for subsequent mini-batches, or the last state of the previous mini-batch is used as mentioned in Ilya Sutskever et al., ICLR 2015 ?
VM_AI
  • 1,132
  • 4
  • 13
  • 25
19
votes
1 answer

Efficiently storing time series data: mySQL or flat files? Many tables (or files) or queries with WHERE condition?

What's the best way to store time series data of thousands (but could become millions soon) real-world hardware sensors? The sensors itself are different, some just capture one variable, some up to a dozen. I need to store these values every hour,…
user1891659
  • 335
  • 1
  • 3
  • 10
19
votes
3 answers

How to delete columns of a series in InfluxDB

Is there any solution to remove a specific column of a series in InfluxDB? Its seems that this feature is not implemented. But does anybody have found any kind of trick to do that?
Darko P.
  • 567
  • 1
  • 4
  • 14
19
votes
1 answer

Daily time series with ts.. how to specify start and end

I have a daily time series that begins on Saturday and ends on Wednesday. There is a clear weekly period to it. It is stored in a vector a in R. So, I try and convert it into a time series object - ts(a,frequency=7) This gives me - Time…
Rohit Pandey
  • 2,443
  • 7
  • 31
  • 54
19
votes
4 answers

Time series and stl in R: Error only univariate series are allowed

I am doing analysis on hourly precipitation on a file that is disorganized. However, I managed to clean it up and store it in a dataframe (called CA1) which takes the form as followed: Station_ID Guage_Type Lat Long Date Time_Zone…
Luciano Rodriguez
  • 719
  • 4
  • 9
  • 16
18
votes
5 answers

Analyzing Daily/Weekly data using ts in R

I have just started playing with the ts class to analyze some time series data I have. I am getting a sense that the ts class is not well suited for analyzing daily or weekly data. Almost all the examples I see on the web or in Cowpertwait and…
Rajiv
  • 300
  • 1
  • 4
  • 10