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

PySpark: how to resample frequencies

Imagine a Spark Dataframe consisting of value observations from variables. Each observation has a specific timestamp and those timestamps are not the same between different variables. This is because the timestamp is generated when the value of a…
Matthias
  • 5,574
  • 8
  • 61
  • 121
15
votes
3 answers

Pandas: Average value for the past n days

I have a Pandas data frame like this: test = pd.DataFrame({ 'Date' : ['2016-04-01','2016-04-01','2016-04-02', '2016-04-02','2016-04-03','2016-04-04', '2016-04-05','2016-04-06','2016-04-06'], …
ahoosh
  • 1,340
  • 3
  • 17
  • 31
15
votes
2 answers

C3.js - Timeseries with time fails to parse

I want to display a time series chart with C3.js using a date in the format 2015-09-17 18:20:34 and the format string '%Y-%m-%d %H:%M:%S' but it fails to parse. My code: var chart = c3.generate({ bindto: '#chart', data: { x: 'times', …
das Keks
  • 3,723
  • 5
  • 35
  • 57
15
votes
2 answers

How to groupby time series by 10 minutes using pandas

Have a time series(ts) indexed by DatatimeIndex, want to group it by 10 minutes index x y z ts1 .... ts2 .... ... I know how to group by 1 minute def group_by_minute(timestamp): year = timestamp.year month = timestamp.month …
Hello lad
  • 17,344
  • 46
  • 127
  • 200
15
votes
1 answer

pandas rolling sum of last five minutes

Assume I have below data frame Date, A 2014-11-21 11:00:00, 1 2014-11-21 11:03:00, 4 2014-11-21 11:04:00, 1 2014-11-21 11:05:00, 2 2014-11-21 11:07:00, 4 2014-11-21 11:08:00, 1 2014-11-21 11:12:00, 1 2014-11-21 11:13:00, 2 First column is datetime…
Sajith Edirisinghe
  • 1,707
  • 1
  • 12
  • 18
15
votes
1 answer

Explaining the forecasts from an ARIMA model

I am trying to explain to myself the forecasting result from applying an ARIMA model to a time-series dataset. The data is from the M1-Competition, the series is MNB65. I am trying to fit the data to an ARIMA(1,0,0) model and get the forecasts. I am…
Samik R
  • 1,636
  • 3
  • 15
  • 33
15
votes
1 answer

Pandas aligning multiple dataframes with TimeStamp index

This has been the bane of my life for the past couple of days. I have numerous Pandas Dataframes that contain time series data with irregular frequencies. I try to align these into a single dataframe. Below is some code, with representative…
Zhubarb
  • 11,432
  • 18
  • 75
  • 114
15
votes
3 answers

Pybrain time series prediction using LSTM recurrent nets

I have a question in mind which relates to the usage of pybrain to do regression of a time series. I plan to use the LSTM layer in pybrain to train and predict a time series. I found an example code here in the link below Request for example:…
dnth
  • 879
  • 2
  • 12
  • 22
15
votes
3 answers

How to fit autoregressive poisson mixed model (count time series) in R?

My task is to assess how various environmental variables affect annual population fluctuations. For this, I need to fit poisson autoregressive model for time-series counts: Where Ni,j is the count of observed individuals at site i in year j,…
Tomas
  • 57,621
  • 49
  • 238
  • 373
15
votes
1 answer

Resample a time series with the index of another time series

I have 2 data frames with identical columns but different datetime indices. I want to resample one of them to use the index of the other and forward fill data from the one on any dates in the index of the other in which there wasn't data…
piRSquared
  • 285,575
  • 57
  • 475
  • 624
15
votes
3 answers

Pandas: Using Unix epoch timestamp as Datetime index

My application involves dealing with data (contained in a CSV) which is of the following form: Epoch (number of seconds since Jan 1, 1970), Value 1368431149,20.3 1368431150,21.4 .. Currently i read the CSV using numpy loadtxt method (can easily use…
Nipun Batra
  • 11,007
  • 11
  • 52
  • 77
15
votes
1 answer

Similarity of trends in time series analysis

I am new in time series analysis. I am trying to find the trend of a short (1 day) temperature time series and tried to different approximations. Moreover, sampling frequency is 2 minute. The data were collocated for different stations. And I will…
A.Amidi
  • 2,502
  • 5
  • 25
  • 37
15
votes
3 answers

Sequence of time(hour)

I tried: seq( from=as.POSIXct("2012-1-1 0", tz="UTC"), to=as.POSIXct("2012-1-3 23", tz="UTC"), by="hour" ) But I only get 1 hour(0:00:00) of the last day instead of 24 hours, actually any hour of the day resulted in only one…
Rosa
  • 1,793
  • 5
  • 18
  • 23
15
votes
1 answer

Refer to time series object by column name

I have the following test data frame : test <- read.table(header = TRUE, text = " a b c d e -0.67 -0.02 -0.1 -0.22 -0.32 0.46 -1.51 -0.79 0.26 1.19 0.22 -0.18 -1.4 0.41 -0.32 -2.21 0.79 0.36 1. …
eykanal
  • 26,437
  • 19
  • 82
  • 113
15
votes
1 answer

Hourly Date Sequence In R

I am trying to produce a sequence of dates at hourly intervals. As an example I tried the following: > seq(as.Date("1912-02-24 23:00:00"), as.Date("1912-02-25 08:32:00"), by="hour") which produces an error, yet it works fine for by= year, month,…
TQEF