Autocorrelation tests (Part 1): Durbin-Watson statistic (Excel)

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 35

  • @NEDLeducation
    @NEDLeducation  4 года назад +2

    You can find the spreadsheets for this video and some additional materials here: drive.google.com/drive/folders/1sP40IW0p0w5IETCgo464uhDFfdyR6rh7
    Please consider supporting NEDL on Patreon: www.patreon.com/NEDLeducation

    • @fordeden638
      @fordeden638 3 года назад

      you all probably dont care but does someone know of a method to log back into an Instagram account??
      I stupidly lost my account password. I appreciate any help you can offer me!

    • @brysendash8748
      @brysendash8748 3 года назад

      @Ford Eden Instablaster ;)

    • @fordeden638
      @fordeden638 3 года назад

      @Brysen Dash I really appreciate your reply. I got to the site on google and im trying it out now.
      Looks like it's gonna take quite some time so I will get back to you later when my account password hopefully is recovered.

    • @fordeden638
      @fordeden638 3 года назад

      @Brysen Dash DAMN IT REALLY WORKED :O Just got access to my IG login after roughly 40 minutes of using the site.
      I had to pay 15$ but for sure worth the money =)
      Thank you so much you saved my account!

    • @brysendash8748
      @brysendash8748 3 года назад

      @Ford Eden Glad I could help :D

  • @alexh.4842
    @alexh.4842 2 года назад +1

    Super! didn't pay attention to the concept of order-1 & order-2 at all before... great to know!

  • @wctyna
    @wctyna 4 года назад +2

    good vid, as a teacher, i found your discussion to be very concise and inspiring.

    • @NEDLeducation
      @NEDLeducation  4 года назад

      Hi, thank you very much for your feedback! Glad the video was interesting :)

  • @akshaydamani
    @akshaydamani 3 года назад +1

    1. Hi, excellenct clarification of auto correlation. As explained when DW is 0 it means that there is a positive relationship of yesterday price with todays price indicating absence of random walk of process. If it is 4, it indicates negative I.e. yesterday's gains and todays extreme loss. 2 indicates absence of auto correlation. So of we have say 2 it means that todays price movements are independent of yesterday's price right?
    2. We prepared the regression equation from historical data, but why did we use it for computed expected residuals.

    • @NEDLeducation
      @NEDLeducation  3 года назад +2

      Hi Akshay, and many thanks for the comment! As for your questions:
      1) Yes. A DW stat of very close to 2 indicates absence of autocorrelation (in your application, it means returns today are not influenced by returns yesterday). If you suspect serial correlation of higher orders though (for example, returns two days ago influencing returns today), check my video on Breusch-Godfrey LM test: ruclips.net/video/xOvi-SLr1AQ/видео.html. Nevertheless, in practice, testing of autocorrelation of order 1 mostly enough for financial applications.
      2) Using residuals instead of raw data is important when calculating DW stat to see whether autocorrelation is an issue for a particular model. For example, there might be serial dependence in raw data, but a particular model might explain it away quite well, so the DW stat in residuals would be close to 2. If you would like to check for autocorrelation in raw data instead, you can apply the same calculations to demeaned data (subtracting sample average) instead of residuals.
      Hope it helps!

    • @akshaydamani
      @akshaydamani 3 года назад +1

      Thank you for the reply.

  • @ivanklful
    @ivanklful 3 года назад +1

    Another awesome video, and of course I'm already using it as literature for creating my own models! Would ask a question that combines some multiple videos that have seen here. So I created model with annual inflation as dependent variable and three independent variables using OLS: 1.ISM Manufacturing PMI (I've set up values to determine percentage deviation from cut-off value of 50 witch distinguish increase and decrease so if the value is 52, the variable would be (52 - 50)/50), 2. 10-Year U.S Treasury Yield (%), and 3. Unemployment rate. I checked if any of independent variables are different from zero, or if any of independent variables do contribute to the explanation of dependent variable (annual inflation), and all three do contribute, to explanation of dependent variable. For entire model R-squared = 0.4998 which points out that all three independent variables explain the variation of dependent variable of nearly 50%! However Durbin-Watson test result is DW = 0.13, which clearly is pointing out to highly positive autocorrelation problem, which would signal me that my model is not properly created. Please can you say me what could be wrong with my model and what would be remedy for it? Can you please comment my findings. Thank you very much again!

    • @NEDLeducation
      @NEDLeducation  3 года назад +1

      Hi Ivan, and glad the video helped! The reason why the Durbin-Watson statistic for your model is so low is that inflation can be positively autocorrelated (higher/lower inflation this year leads to higher/lower inflation next year). A macroeconomic explanation of this most of the time has to do with inflation expectations. To address positive autocorrelation in your model econometrically, the easiest solution could be to include lagged inflation as an additional independent variable and see what DW stat is in such a specification. My guess is that it would move much closer to 2 (it almost always does!). Hope it helps!

    • @ivanklful
      @ivanklful 3 года назад

      @@NEDLeducation I've changed my variables and as dependent variables I used the first difference of annual inflation on monthly level ( the change in annual inflation), and thereafter as independent variables I used changes of ISM Manufacturing (percentage above/below 50 neutral level) , changes of 10-Year Yield, and Unemployment rate change, and 1, 2, 3 and 6 lags. So almost all DW statistics results are within 1.7 up to 2.3 range and the best result ( almost 2) has been reached with the linear regression of 10-Year Yield change and Lag 1 and Lag 2 variables. However t-stat of Lag 2 is insignificant (p-value = 29.2%), and as well as for alpha ( p-value = 80.17%). Does it mean that variables (or intercepts) when t-values are statistically insignificant ( p-value > 10% let's say) suppose to be removed from the regression? Is the remedy I've used to address this issue suitable?

  • @vaibhav1131
    @vaibhav1131 3 года назад +2

    when we want to calculate autocorrelation say for just tesla alone without using s&p, then average expected return will be average returns of tesla to calculate autocorrelation?

    • @NEDLeducation
      @NEDLeducation  3 года назад

      Hi Vaibhav, exactly, you could apply the same tests for the demeaned returns of Tesla without using any explanatory variables!

  • @futurestradinginunder7minu872
    @futurestradinginunder7minu872 4 года назад +2

    May I ask a question? I want to test for auto-correlation as a requirement for using Monte Carlo simulation. You used Tesla as the dependent (y), and S&P as the independent (x) variable. I'm interested only in the S&P. I assume that (S&P) would be my dependent (y) variable? Would be my independent (x) variable simply numbers from 1 through . . .n? I don't know what else it could be. Thank you!

    • @NEDLeducation
      @NEDLeducation  4 года назад +1

      Hi again, and thanks for the question! To test for autocorrelation, you need not have independent variables in principle. Here, it is shown to demonstrate what to do with residuals obtained from a regression. To identify autocorrelation in S&P 500, you may just treat the demeaned return as your residual. That is, subtract average return throughout the sample from every observation and calculate the Durbin-Watson stat for demeaned returns as residuals. Hope it helps!

    • @futurestradinginunder7minu872
      @futurestradinginunder7minu872 4 года назад +1

      @@NEDLeducation Thanks again. Just to confirm, my independent (x) variable will be every day's return, minus the average return for the entire series?

    • @NEDLeducation
      @NEDLeducation  4 года назад

      @@futurestradinginunder7minu872 that's right!

  • @igorcarvalho8253
    @igorcarvalho8253 2 года назад +1

    Hi NEDL! Great explanation, I have one question, my DW is less than two what can I do to solve that kind of problem?

  • @xBl4zZoR
    @xBl4zZoR 9 месяцев назад

    Great video as always! I do have one question though. Why do you use the discrete returns and not log-returns?
    I have learnt that when working with capital market assumptions (like beta and alpha) you should use the log-returns.

  • @ivanklful
    @ivanklful 3 года назад +1

    Saba, your awesome videos, are inspiring me further and further. I would like to ask you one practical question. When we set up some model and calculate linear regression that is derived and expressed from this model what is procedure that we have to go through before? Is this 1. check if unit root is present, 2. check autocorrelation, 3. check heteroskedasticity, 4. check if each single independent variable is statistically significant different from dependent variable? (paired sample t-test) Is this procedure right? What check-ups have to be performed before we can be reasonably sure that a model is ok?

    • @NEDLeducation
      @NEDLeducation  3 года назад +1

      Hi Ivan, and absolutely glad to hear that! As for your questions, the standard practice for regression modelling is to check for assumption violations - that is, for autocorrelation, heteroskedasticity, and multicollinearity. For additional robustness, you can also check for normality (but it is not required for the regression estimators to be best unbiased linear estimators). There are plenty of videos on autocorrelation, heteroskedasticity, and normality testing on the channel, and couple of videos on multicollinearity will be there shortly. Hope it helps!

  • @futurestradinginunder7minu872
    @futurestradinginunder7minu872 4 года назад +1

    Excellent video! I've been searching for a good explanation. Any chance you could post your Excel sheet? I'd like to check my math. Thanks.

    • @NEDLeducation
      @NEDLeducation  4 года назад

      Hi and many thanks for the feedback! Really appreciate that! Just drop me an email on s.shanaev@northumbria.ac.uk and I will send you the spreadsheet :)

  • @muntedme203
    @muntedme203 2 года назад +1

    Can you use on AR(1) to extimate serial sutocorrelation in an univariate case?

    • @NEDLeducation
      @NEDLeducation  2 года назад

      Yes, you can test for serial autocorrelation using an autoregressive model. If the autoregressive coefficient is significant, this evidences the presence of autocorrelation.

  • @veronicataylor5977
    @veronicataylor5977 3 года назад +1

    Hi - a quick question, how do we calculate first autocorrelation for VaR violations?

    • @NEDLeducation
      @NEDLeducation  3 года назад

      Hi Veronica, and thanks for the question! First-order autocorrelation can be simply calculated using the CORREL function, applying it to two arrays: returns from the second day until the last day, and returns from the first day until the second to last day. Hope it helps!

  • @mikewilson5749
    @mikewilson5749 Год назад

    I have a question regarding the formula you used for Expected. Kindly correct me if I'm wrong, but should the Expected formula applied to column F use the prior days % chg of SP500? I ask because as up state, the residual is the (Actual - Expected); however, as i understand it, the Expected is a forecasted value, or a prediction. Should then the Expected correspond to an event or value that occurred prior to the Actual? For example, in cell F3 for Expected you have, "E$1263+D$1263*E3"; however, should it be, ""E$1263+D$1263*E4", where E4 is the daily return of the SPX from the previous day (i.e. prcnt chg of SP500 @ [ t-1])? Much obliged for any clarification you can provide. BTW: wonderful, wonderful videos! So much so, I subscribed and can't wait to watch the next ones.

    • @NEDLeducation
      @NEDLeducation  Год назад

      Hi Mike, and thanks for the excellent question! Here, we are interested with (to some extent) backtesting the model and assessing its quality (that is, whether the absence of serial correlation assumption is violated or not). In this case we can use historical data and "predict" past values using the model. If we were to produce a function for a trading strategy, for example, it would be instrumental to test it out of sample, you are correct in this sense.

  • @phanquochung3924
    @phanquochung3924 3 года назад +1

    thank you xD

  • @francescopatrizi220
    @francescopatrizi220 Год назад

    I wish we could see the formula, your camera is covering it :/