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
3
votes
1 answer

Identify activities in time series in Python

The graph shows water temperature against time. When there is an activation, temperature will increase. When the activation ends, temperature will start decreasing(although sometimes there may be a time lag). I would like to calculate the number…
nilsinelabore
  • 4,143
  • 17
  • 65
  • 122
3
votes
2 answers

find correlation between pandas time series

I have two pandas data frames which I have taken from only one column and set dates column as index, so now I have two Series instead. I need to find the correlation for those Series. Here are a few rows fromdfd: index change 2018-12-31 …
3
votes
2 answers

Simulating Time Series Model in R

I want to answer the following question, I know that I can use the arima.sim function but I am not sure how to simulate model asked: I want to simulate the following: yt =α+βt+φyt−1 +εt, εt ∼IIDN(0,1) when: alpha=1, beta=0 and theta=0.8 Before each…
Peter
  • 151
  • 1
  • 11
3
votes
3 answers

Code sequence by group in R: recurring values within group

I would like to code a numerical sequence based on the combination of three columns: ID, year, and location. I want to number the years a person spent in one place as a sequence. The sequence should start anew in the year of a location change, so…
lekker
  • 45
  • 2
3
votes
3 answers

Finding monthly repeating values in dataframe (pandas)

So I have a dataset that includes dates and values, corresponding to those dates. date value category 1951-07 199 1 1951-07 130 3 1951-07 50 5 1951-08 199 1 1951-08 50 5 1951-08 199 1 1951-09 184 2 1951-09 50 5 1951-09 13 13 Now my goal is…
3
votes
0 answers

Time Series Clustering in Python

I have one column that corresponds to the item and the following columns correspond to timestamps. In every column corresponding to the timestamps we have the number of sales of each item. This is just an example of my dataframe. I have hundreds of…
dante
  • 31
  • 4
3
votes
2 answers

extracting from a TimeArray another one by columns

I have a julia TimeArray, let's say ta, and I want to build sub_array a TimeArray sub_ta by extracting some of the columns. Some month ago, I used a code similar to minimal example below, but which doesn't work anymore import TimeSeries import…
Guilhem L.
  • 421
  • 2
  • 8
3
votes
1 answer

Interval selections in Vega-Lite specifications on mobile browsers

The Altair example gallery contains a nice example of how to use interval selections to create two plots where one allows you to define the scale of the other. import altair as alt from vega_datasets import data source = data.sp500.url brush =…
fuglede
  • 17,388
  • 2
  • 54
  • 99
3
votes
2 answers

Seaborn violin plot over time given numpy ndarray

I have a distribution that changes over time for which I would like to plot a violin plot for each time step side-by-side using seaborn. My initial attempt failed as violinplot cannot handle a np.ndarray for the y argument: import numpy as np import…
smonsays
  • 400
  • 2
  • 17
3
votes
2 answers

plotting time series grouped by hour and day of week

I have hourly timeseries data for over a year, and wish to plot average hourly measurements for each day of the week. I have run the following code and my data is in the following format (i previously created columns for days of week). df =…
ojp
  • 973
  • 1
  • 11
  • 26
3
votes
1 answer

auto_arima returning the best model as SARIMAX even when time series is stationary and has no seasonal component in Python

I have a time series dataset having frequency as daily. I have checked that my dataset is stationary using augmented dickey-fuller test. After which, when i am trying to determine the values of p,d,q using: from pmdarima import…
Sri2110
  • 335
  • 2
  • 19
3
votes
1 answer

Pandas Timeseries: Keep only one value peer week and id

Problem I have a mysql database that saves a time series (for each customer and a date the balance of the customer's account). Each week might have multiple values. The date column can be assumed a valid and complete datetime object. There might be…
Lennart Thamm
  • 269
  • 1
  • 12
3
votes
1 answer

ts_backtesting function from TSstudio is not showing in the list of functions in TSstudio package in R

I have been trying to perform the horse approach for finding the best model to run on the time series data but when I run ts_backtesting function, there is a message in console that Error in ts_backtesting(x) : could not find function…
3
votes
1 answer

R attach dates to time series

I have a spreadsheet in excel which consists of first row of dates and then subsequent columns that refer to prices of different securities on those dates. I saved the excel file as a csv and then imported to excel…
hugh
  • 31
  • 1
  • 2
3
votes
1 answer

Facebook Prophet saturation failling

I´m using Prophet to predict sales and using the saturation parameter to not have negative values: df_prof = df_prof.sample(1000) df_prof['cap'] = 6000 df_prof['floor'] = 10 m = Prophet(growth='logistic') m.fit(df_prof) future =…
Luis Ramon Ramirez Rodriguez
  • 9,591
  • 27
  • 102
  • 181
1 2 3
99
100