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

Percentage change on a time series in pandas

I am new to python and learning it by doing some basic stock data analysis. Below is the dataframe I am using date open high ... close volume 0 2010-01-05 09:16:00 5282.00 5283.10 ... 5281.10 …
Fudgster
  • 43
  • 1
  • 7
3
votes
1 answer

Are there any rules when it comes to determining the Order and the Seasonal Order in a SARIMA?

Are there any rules when it comes to determining the Order and the Seasonal Order in a SARIMA? I have noticed that when I use StatsModels in Python I can't choose a seasonal lag that is below or equal to the number of AR lags. Example: I am running…
RLA
  • 45
  • 1
  • 5
3
votes
1 answer

diffinv function output not what I thought

Trying to figure out how to inverse-difference correctly if using 2 differences. I can difference twice with the option differences = 2 and everything works: diff(c(3,6,23,64,77)) = 3 17 41 13 diff(c(3, 17, 41, 13)) = 14 24…
Frank
  • 952
  • 1
  • 9
  • 23
3
votes
2 answers

Gnuplot filled curves adds unwanted "bottom" border

I am trying to visualize a time series data set on one plot as a pseudo 3d figure. However, I am having some trouble getting the filledcurves capability working properly. It seems to be adding an unwanted border at the "bottom" of my functions and I…
Eric Tovar
  • 33
  • 3
3
votes
2 answers

Carry Forward Data for Each Case

In SPSS, how do I pull forward longitudinal data to blank cells for each id? Example: ID Time Gender 1 1 M 1 2 . 1 3 . 2 1 F 2 2 . 2 3 . 3 1 . 3 2 F 3 3 . How do I get to this? ID Time Gender Gender_Recoded 1 …
3
votes
2 answers

Create Pandas TimeSeries from Data, Period-range and aggregation function

Context I'd like to create a time series (with pandas), to count distinct value of an Id if start and end date are within the considered date. For sake of legibility, this is a simplified version of the problem. Data Let's define the Data this…
Bsquare ℬℬ
  • 4,423
  • 11
  • 24
  • 44
3
votes
1 answer

How do I perform crosscorelation between two time series and what transformations should I perform in python?

I have two-time series datasets i.e. errors received and bookings received on a daily basis for three years (a few million rows). I wish to find if there is any relationship between them.As of now, I think that cross-correlation between these two…
harshit
  • 333
  • 1
  • 2
  • 13
3
votes
1 answer

Create an array of arrays from a dataframe with multiple multivariate time series in Python

I need to create an array of arrays from the dataframe: HR sBP dBP T ID 101 51 81 37.1 P1.1 102 52 82 37.2 P1.1 103 53 83 37.3 P1.1 104 54 84 37.4 P1.1 105 55 85 37.5 P1.1 210 65 90 36.1 …
Juan Weber
  • 33
  • 3
3
votes
1 answer

How to get plot.ts to accept par or layout?

I tried to use par with plot.ts but it didn't work. Examining the code I found, plot.ts uses already par internally, which may lead to a clash. However, also layout won't work. Here my code for both methods, the plots are plotted one after the…
jay.sf
  • 60,139
  • 8
  • 53
  • 110
3
votes
1 answer

Why do some prometheus metric values return +Inf

Occasionally when I query prometheus using the api endpoint one or more of the metric values will be +Inf. What does +Inf mean and what causes a metric value to be +Inf ? Additional info: This data is coming from a Gauge metric type The query…
ap.dev
  • 320
  • 3
  • 11
3
votes
2 answers

Resampling Dataframe from Monthly to Daily

Here is my problem: This is a sample of my DataFrame (it actually goes from 2002 to 2012) df = pd.DataFrame( …
Kben59
  • 378
  • 2
  • 10
3
votes
1 answer

Nth order difference and Nth difference

In ARIMA/SARIMA one parameter id "d", which specifies difference. For differencing when d>1, I have heard two expressions: "n differencing", "n-order differencing". Are these two expressions referring to the same thing? For example, for 2nd order…
User 19826
  • 509
  • 2
  • 5
  • 13
3
votes
4 answers

Filtering Dataframe based on many conditions

here is my problem: I have a dataFrame that look like this : Date Name Score Country 2012 Paul 45 Mexico 2012 Mike 38 Sweden 2012 Teddy 62 USA 2012 Hilary 80 USA 2013 Ashley 42 France 2013 Temari 58 UK…
Kben59
  • 378
  • 2
  • 10
3
votes
3 answers

R: How to plot multiple ARIMA forecasts on the same time-series

I would like to plot several forecasts on the same plot in different colours, however, the scale is off. I'm open to any other methods. reproducible example: require(forecast) # MAKING DATA data <- c(3.86000, 19.55810, 19.51091, …
HarriS
  • 605
  • 1
  • 6
  • 19
3
votes
1 answer

Dynamically count number of business days excluding holiday calendar in Python

I want to calculate the number of business days between two dates and create a new pandas dataframe column with those days. I also have a holiday calendar and I want to exclude dates in the holiday calendar while making my calculation. I looked…
datanerd
  • 43
  • 3