Questions tagged [lags]

A lagged value in a time series is a value of a variable corresponding to an earlier time. For example, in a monthly time series, the first lagged value will be the value for the previous month and so on.

Consider a time series $x_t$ where the value of variable $x$ is recorded at different time periods/points $t=\dots,-2,-1,0,1,2,\dots$. If the current time period/point is $t$, then lag $1$ of $x_t$ is $x_{t-1}$. E.g. if $x$ are sales and we are at the end of February 2021, $x_t$ is the February sales, $x_{t-1}$ is the January 2021 sales, $x_{t-2}$ is the December 2020 sales etc. More generally, lag $h$ of $x_t$ is $x_{t-h}$ for $h=1,2,\dots$. Lags can be used in autoregressive modelling and forecasting, the autocorrelation and partial autocorrelation functions (ACF and PACF) etc.

351 questions
33
votes
6 answers

Inclusion of lagged dependent variable in regression

I'm very confused about if it's legitimate to include a lagged dependent variable into a regression model. Basically I think if this model focuses on the relationship between the change in Y and other independent variables, then adding a lagged…
user22109
  • 351
  • 1
  • 3
  • 3
17
votes
1 answer

Multivariant time series in R. How to find lagged correlation and build model for forecasting

I'm new in the page and pretty new in statistics and R. I'm working on a project for college with the objective of finding the correlation between rain and water flow level in rivers. Once the correlation is proved I want to forecast/predict it. The…
Fernando Ayuso
  • 173
  • 1
  • 1
  • 6
16
votes
1 answer

When is it necessary to include the lag of the dependent variable in a regression model and which lag?

The data we want to use as dependent variable looks like this (it is count data). We fear that since it has a cyclic component and trend structure the regression turns out to be biased somehow. We will use a negative binomial regression in case it…
14
votes
3 answers

Residual autocorrelation versus lagged dependent variable

When modeling time series one has the possibility to (1) model the correlational structure of the error terms as e.g. an AR(1) process (2) include the lagged dependent variable as an explanatory variable (on the right hand side) I understand that…
majom
  • 872
  • 1
  • 12
  • 27
14
votes
1 answer

Lag order for Granger causality test

Suppose I'm considering several independent variables for possible inclusion in an ARIMAX model I'm developing. Before fitting different variables, I'd like to screen out variables that exhibit reverse causality by using a Granger test (I'm using…
ch-pub
  • 741
  • 1
  • 8
  • 22
13
votes
3 answers

Creating auto-correlated random values in R

We are trying to create auto-correlated random values which will be used as timeseries. We have no existing data we refer to and just want to create the vector from scratch. On the one hand we need of course a random process with distribution and…
Fabian Stolz
  • 237
  • 1
  • 2
  • 6
13
votes
2 answers

Correlating volume timeseries

Consider the following graph: The red line (left axis) describes the trading volume of a certain stock. The blue line (right axis) describes the twitter message volume for that stock. For instance, on May 9 (05-09) about 1.100 million trades and…
Pr0no
  • 748
  • 7
  • 16
  • 28
13
votes
7 answers

Lagging over a grouped time series

I have a few tens of thousands of observations that are in a time series but grouped by locations. For example: location date observationA observationB --------------------------------------- A 1-2010 22 12 A 2-2010 …
Aren Cambre
  • 233
  • 1
  • 2
  • 6
10
votes
1 answer

Cross-validation for timeseries data with regression

I am familiar with "regular" cross-validation, but now I want to make timeseries predictions while using cross-validation with a simple linear regression function. I write down a simple example, to help clarify my two questions: one about the…
user24544
10
votes
3 answers

Forecast time series data with external variables

Currently I'm working on a project to do forecasting of a time series data (monthly data). I am using R to do the forecasting. I have 1 dependent variable (y) and 3 independent variables (x1, x2, x3). The y variable has 73 observations, and so…
S.B
  • 151
  • 1
  • 3
  • 8
10
votes
1 answer

Distinguish between short run and long run effects

I read in a paper the following sentence: The fact that there is a difference between short-term and long-term coefficients is a result of our specification which includes lagged endogenous variables. They run a regression in first differences…
Michael B
  • 172
  • 1
  • 12
8
votes
3 answers

How to determine appropriate lagged features for learning systems with states?

In much of machine learning literature, the systems being modelled are instantaneous. Inputs -> outputs, with no notion of impact from past values. In some systems, inputs from previous time-steps are relevant, e.g. because the system has internal…
naught101
  • 4,973
  • 1
  • 51
  • 85
8
votes
1 answer

Autocorrelation of concatenated independent AR(1) processes

Let $\left\{X_t\right\}$ be a stochastic process formed by concatenating iid draws from an AR(1) process, where each draw is a vector of length 10. In other words, $\left\{X_1, X_2, \ldots, X_{10}\right\}$ are realizations of an AR(1) process;…
Adrian
  • 3,754
  • 1
  • 18
  • 31
8
votes
0 answers

Fixed Effects vs Lagged DV vs. First Differences Regression

What are the differences between using unit fixed effects, unit fixed effects and time fixed effects, lagged DV, or first differences to analyze a time series with 4-5 time periods and 35-50 units per time period (depending on the subset)? In…
Michael
  • 390
  • 3
  • 13
7
votes
1 answer

Confusion over Lagged Dependent and HAC Standard Errors

It seems that the consensus is that after fitting a linear regression via OLS, when you have included a lagged dependent variable (because it is supported by theory or appears needed based on the data) such as the following…
B_Miner
  • 7,560
  • 20
  • 81
  • 144
1
2 3
23 24