nathanh93 / mcxs_report

Macroeconometrics Research Report Repository
MIT License
1 stars 3 forks source link

Planned Extensions #2

Closed nathanh93 closed 1 year ago

nathanh93 commented 1 year ago

Hi @donotdespair,

Just opening this issue to discuss my planned extensions to the model.

As we discussed last week during our meeting I would like to go ahead with exploring the dummy observations as well as the Student t errors extensions as it sounds like they will complement my research topic well. What would you suggest I look at in terms of material. I will start with your article which you mentioned will be helpful for the dummy observations material.

I also remembered you mentioned that you might know a better source for downloading the Realized Library data? The github file I am currently using looks reasonably sufficient in terms of length but I remember you mentioned it might have had some strange amendments made to it.

Thanks,

Nathan

donotdespair commented 1 year ago

Hi @nathanh93

Thank you for opening this issue! Let's talk about it!

  1. The first go-to resource for the dummy observation priors would be the article Woźniak (2016) Bayesian Vector Autoregressions provided in the lecture materials. Section 6 explicitly discusses the setup and the estimation. Having studied this part you will know how to implement the prior and estimate a model with it.
  2. Now, you need a research paper that would tell you how to generate artificial data to generate the prior. Section 6, which I mentioned above, mentions two papers by Chris Sims that scrutinise such priors. Another option is a recent article Domenico Giannone, Michele Lenza & Giorgio E. Primiceri (2019) Priors for the Long Run, Journal of the American Statistical Association, 114:526, 565-580, DOI: 10.1080/01621459.2018.1483826
  3. The materials for the Student t error terms are not numerous. One is the appendix to a textbook by Bauwens, Lubrano, Richards (1999). Another is the article by Geweke (1993).

Please let me know, when you would need more input from me. Please, remember to tag me in such a post. Thanks, @donotdespair

donotdespair commented 1 year ago

Aha @nathanh93

I promised you reliable Realised Library data. Please, use the following file for your computations: RLib. It will have different order/names of columns but at least we'd know that its originally downloaded from the source (I did that myself).

nathanh93 commented 1 year ago

Hi @donotdespair,

I was trying to find the meeting notes for our BVAR meeting. I think you might have posted the SVAR meeting notes in the BVAR meeting link instead as the notes look identical for both meetings. Would you be able to double check?

I specifically wanted to check on your notes regarding the T distributed errors extension again, as I wanted to cross reference your notes with the Geweke (1993) article you provided me.

Thanks,

Nathan

donotdespair commented 1 year ago

Hi @nathanh93

Yes, indeed! I took the notes in the wrong file! Now they are both uploaded as they should!

Regarding the t-distributed error terms. Feel free to drop by for consultations and talk about this. Let me know if you're joining online via zoom.

T

nathanh93 commented 1 year ago

Hi @donotdespair,

Thanks for looking into it! I have just tried to access the file and it seems it is still showing the SVAR notes for both links. Did you post it under the 'Research Report Stuff' module titled 'BVARs meeting notes'?

Apologies that I am have not been able to make it to your consultation today. It is a little difficult with the timing since I am at work today. I have also found a paper which appears quite useful by E. Bobeica and B. Hartwig which suggests the use of an Inverse Gamma distribution for the scale mixture of normal distributions in order to achieve t distributed errors.

donotdespair commented 1 year ago

Hey @nathanh93

The notes have just been uploaded. Apologies for the delay. I prepared and exported them yesterday, but then, your colleagues came for a consultation, distracted me, and I forgot to come back to upload them. So, now they're there!

donotdespair commented 1 year ago

OK @nathanh93

Regarding the Babeica, Hartwig paper - very cool reference, and it's a worthwhile methodology! If you want to introduce the t-distributed error terms as they did, I propose the following:

Have you started developing the code? Please, let me know. And see you later!

donotdespair commented 1 year ago

Hi @nathanh93

Please, have a look at the Appendix I was talking about during the meeting by Bauwens, Lubrano, and Richards (1999). There on page 307 you will find the definition and derivation of the matricvariate t-distribution coherent with our derivations in the notes (the link has been updated on Canvas). The necessary changes are that in our derivation q=1 (and so, the IW distribution becomes IG2) and, their P^{-1} (P is the precision matrix) is our Sigma covariance matrix.

Greetings, @donotdespair

nathanh93 commented 1 year ago

Hi @donotdespair,

Thanks for your comments above, they are very helpful.

I agree that using a time-invariant lambda will probably be wise at this stage. I have attempted the derivation of the full conditional for lambda on paper already and will put it into my page so that you can review it. If I understand correctly you were suggesting I should make the same derivation you went through in our meeting yesterday, however using the matrix-variate normal form for the error distribution rather than the multivariate form you used in your example? I think my end result looks similar to what we arrived at yesterday. As an aside, does the later extension of stochastic volatility make my t-distributed errors extension somewhat obsolete? Would it ultimately achieve the same thing as a time-varying lambda?

donotdespair commented 1 year ago

Hey @nathanh93

  1. You can simply email me a photocopy of your derivations.
  2. Your result should look similarly, but it should apply to u_t for all t=1,...,T
  3. No, it wouldn't! Conditional heteroskedasticity is not conditional t-distributed error terms. Time-varying \lambda from the paper could be interpreted as heteroskedasticity, however, it assumes no persistence. And the predominant feature of the volatility of macro and financial (RV included) time series is the volatility persistence. The volatility estimates will be very different. Also, there is no way of forecasting using the model with \lambdas. And SV is excellent in that. It would be best if you combined the t distribution with the SV heteroskedasticity. That would be a model well fitted to the logRV data.

I'm looking forward to seeing these developments!

nathanh93 commented 1 year ago

Hi @donotdespair ,

I have emailed a copy of my derivation for you to double check. Thanks! As for the posteriors for A and Sigma, I managed to arrive at the same result that is shown in the Babeica, Hartwig paper, it is not too different from the normal derivation without the lambda.

I have also tried to implement the estimation routine in a Gibbs Sampler. I initialise values for the prior parameters and the lambda hyperparameters. I then construct the diagonal lambda matrix and use that to draw from the sigma posterior and A posterior, then calculate the next lambda using the derivation I sent to you.

The loop seems to fail for certain values of lambda, which happens when drawing from the inverse wishart for Sigma. It happens because the scale matrix is not positive definite. The code works, however, if I fix the value of lambda at 1. I suspect there must be something wrong with how I am updating lambda. I have updated my quarto page to include my Gibbs Sampler code now so that you can take a look.

Thanks

Nathan

nathanh93 commented 1 year ago

Aha @nathanh93

I promised you reliable Realised Library data. Please, use the following file for your computations: RLib. It will have different order/names of columns but at least we'd know that its originally downloaded from the source (I did that myself).

Hi @donotdespair,

I was just coming back to this post previously where you provided me with your more reliable Oxford Man RV dataset. Is there a way that I can import the data directly from that link into my quarto file? I remember you mentioned you would like the code to only use datasets accessible from the internet and as such I was wondering if this was possible with that link?

Thanks,

Nathan

donotdespair commented 1 year ago

Hi @nathanh93

Indeed, if the Realized Library was available, I would encourage you to download the xls file directly into R from the internet, but... it's not available so, for your project, it's OK to use the file. The one I sent you is just more reliable as I know I surely downloaded it from the RL and did not modify it. I'm not sure what folks had done with the file you downloaded before.

nathanh93 commented 1 year ago

Closing this issue as the research report has been finalised. Thanks!