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
13
votes
2 answers

Generate series of week intervals for given month

In a Postgres 9.1 database, I am trying to generate a series of weeks for a given month but with some constraints. I need all weeks to start on Monday and get cut when they start or end in another month. Example: For February, 2013 I want to…
Eddie
  • 302
  • 1
  • 2
  • 8
13
votes
2 answers

Matlab: neural network time series prediction?

Background: I am trying to use MATLAB's Neural Network toolbox to predict future values of data. I run it from the GUI, but I have also included the output code below. Problem: My predicted values lag behind the actual values by 2 time periods, and…
13
votes
2 answers

Speedup conversion of 2 million rows of date strings to POSIX.ct

I have a csv which includes about 2 million rows of date strings in the format: 2012/11/13 21:10:00 Lets call that csv$Date.and.Time I want to convert these dates (and their accompanying data) to xts as fast as possible I have written a script…
n.e.w
  • 1,128
  • 10
  • 23
12
votes
5 answers

Hurst exponent with R

I would like calculate the Hurst exponent with R. Is there a library or built in function that can do this? any suggestion will be appreciated (even weblinks to references). update: thanks to the comment of Ben Bolker, I have found this script in…
emanuele
  • 2,519
  • 8
  • 38
  • 56
12
votes
2 answers

Input 0 of layer conv1d is incompatible with the layer: : expected min_ndim=3, found ndim=2. Full shape received: (None, 30)

I have been working on a project for estimating the traffic flow using time series data combine with weather data. I am using a window of 30 values for my time series and I am using 20 weather related features. I have used the functional API to…
Minura Punchihewa
  • 1,498
  • 1
  • 12
  • 35
12
votes
2 answers

Grafana Prometheus Counter

I have trying to get exact count for an event in a Grafana visualization using Prometheus as timeseries DB. But the counter is showing incorrect records. I am getting a higher count for 2 days that I am getting 7 days, which definately points to…
user7510999
  • 351
  • 1
  • 4
  • 12
12
votes
6 answers

Calculate Returns over Period of Time

I'm trying to get a time series of returns for holding a certain asset for a specific time. My dataframe looks like this: Date Price 1998-01-01 20 1998-01-02 22 1998-01-03 21 1998-01-04 25 ... 1998-01-20 25 1998-01-21 …
Dani
  • 2,325
  • 5
  • 24
  • 20
12
votes
2 answers

Database suggestions for time series of events

For one of my projects, I have to enter a big-ish collection of events into a database for later processing and I am trying to decide which DBMS would be best for my purpose. I have: About 400,000,000 discrete events at the moment About 600 GB of…
thkala
  • 84,049
  • 23
  • 157
  • 201
12
votes
2 answers

Remove 'seconds' and 'minutes' from a Pandas dataframe column

Given a dataframe like: import numpy as np import pandas as pd df = pd.DataFrame( {'Date' : pd.date_range('1/1/2011', periods=5, freq='3675S'), 'Num' : np.random.rand(5)}) Date Num 0 2011-01-01 00:00:00 0.580997 1…
Dustin Helliwell
  • 630
  • 1
  • 8
  • 12
12
votes
2 answers

Using Prophet Package to Predict By Group in Dataframe in R

I am using the new package released from Facebook called Prophet. It does time series predictions and I want to apply this function By Group. Scroll down to R Section. https://facebookincubator.github.io/prophet/docs/quick_start.html This is my…
nak5120
  • 4,089
  • 4
  • 35
  • 94
12
votes
0 answers

SARIMAX model fitting too slow in statsmodels

I am trying a grid search to perform model selection by fitting SARIMAX(p, d, q)x(P, D, Q, s) models using SARIMAX() method in statsmodels. I do set d and D to 1 and s to 7 and iterate over values of p in {0, 1}, q in {0, 1, 2}, P in {0, 1}, Q in…
darXider
  • 447
  • 5
  • 16
12
votes
5 answers

Discrete Derivative in SQL

I've got sensor data in a table in the form: Time Value 10 100 20 200 36 330 46 440 I'd like to pull the change in values for each time period. Ideally, I'd like to get: Starttime Endtime Change 10 20 …
Parker
  • 7,949
  • 5
  • 26
  • 21
12
votes
1 answer

Error in rep: invalide 'times' argument

When I try to run the following code for 10000 iterations I get the following error.Error in rep(G1[, 2], G1[, 3]) : invalid 'times' argument. So don't know how to change the code to fix that error. Basically just want to create time series for the…
kelamahim
  • 577
  • 1
  • 4
  • 21
12
votes
2 answers

Pandas: Number of unique days in a timestamp Series

I have Pandas DataFrame with nearly 3,000,000 rows. One of the columns is called TIMESTAMP, and of the datetime64 type. The timestamp format is given below: 2015-03-31 22:56:45.510 My goal is calculating the number of days data were collected. My…
marillion
  • 10,618
  • 19
  • 48
  • 63
12
votes
3 answers

Pandas TimeSeries resample produces NaNs

I am resampling a Pandas TimeSeries. The timeseries consist of binary values (it is a categorical variable) with no missing values, but after resampling NaNs appear. How is this possible? I can't post any example data here since it is sensitive…
Peter Lenaers
  • 419
  • 3
  • 8
  • 17