Adding Heaps Stationary VAR Models - #333
Sliderland wants to merge 8 commits into
Conversation
Adding new changes from the main branch to forked repo
There was a problem hiding this comment.
Can we have a better name for data like qusm10 or so. Heaps is in the reference. Especially if we have additional quarterly.
Also, the hyperparameters should exist in the stan model and not in the data.
| @@ -0,0 +1,307 @@ | |||
| functions { | |||
| /* Function to compute the matrix square root */ | |||
| matrix sqrtm(matrix A) { | |||
There was a problem hiding this comment.
Does similar functions exist in stan? I think we should try to reuse functionality as much as possible.
There was a problem hiding this comment.
Or is this the original code from Heaps?
There was a problem hiding this comment.
The code was (mostly) taken directly from the paper, but it was written for an older version of stan (specifically the syntax is slightly different). There is a function called canonicalize that converts older versions of stan code that use deprecated functions to use the newer syntax. I added the generated quantities to compute the eigenvalues of the companion matrix as well. Outside of these changes, everything else was left the same.
None of the variables in the generated quantities block are saved.
With regards to Issue #330
This is a draft PR and is currently incomplete (some draws are still being sampled).
Reference draw currently added:
heaps_small3-statprior_varheaps_small3_semiconj_var-semiconj_varheaps_small3_statrml_var-statrml_varheaps_med10_semiconj_var-semiconj_varIncluding
mean_valueandmean_squared_valueAdditional reference draws: specifically same models on larger data, will be added to my fork as they complete and hopefully added to the pull request.
Future considerations:
heaps_med10-statprior_varrequires > 100Mb of storage, so we should discuss how to deal with these in the futureheaps_med10_statrml_var-statrml_varproduces some divergent transitions so I need to figure out why this is occurring and what I can do to make sure it passes the quality checksheaps_med20_statinvert_varma-statinvert_varmais intentionally excluded for now because its initialization is quite expensive. It would likely also suffer from storage issues that need to be addressedheaps_med20_statinvert_varmadata object was added even though its resulting posterior reference draws are likely not to be added for a while. I will update this.