Skip to content

Conversation

@gabrielkonecny
Copy link

This version implements Proxy SVAR, including descriptions, tests, and examples.

Set up temporary data and files for testing.
Sketch of how bv_irf() could accept instrument as input. Sketched file for the identification using IV.
Open questions: Dates for subsetting residuals to correspond to IV length. Do / Will residuals always have information on date?
Extended the core functions to accept an instrument. test_file_iv.R tries to make working example. Some temporary data were added to make results comparable to the linear model in my thesis. Very preliminary
One file was not saved.
Users can now alternatively provide the dates directly in the function bvar() and bv_irf() by specifying start_date() and frequency(). This could be user-friendly alternative to forcing them to provide rownames. For now only tested with frequency = "month".
1) In proxy VAR a warning due to deprecated calculation was solved.

2) Some checks for instrument input were implemented

3) Some fixes wrt how arguments are passed between functions.

4) The test file now provides 2 internal examples and 1 non-example. Data transformations are commented out and moved to the end of the file. Instead, data for examples are saved now as .rds and loaded when needed.
1) Implemented  F-statistic from the first-stage regression of the reduced-form innovations on the instrument.

2) For first draft I used resid(x) instead of draw specific residuals. This is now fixed - this version uses Y - X %*% beta[j, , ] instead in 64_irf_method.R

3) Fixed some instances where by introducing instrument to the functions, if not used, cases emerged where some objects were not well defined.

3) Added External Instrument string in .print_irf
Also tried to print F-stat but it did not work, so its commented out for now.

4) Renamed some elements to lower case
+ some renaming
check_iv replaces and generalizes intersect_vectors_by_date by providing more outputs and a method for print. Since irf.bvar calls check_iv, and bvar calls irf.bvar, it should cover both use cases - estimating irf inside bvar() and ex-post.
Removed dependence of proxy_svar on Matrix library, reduced n.o. times proxy_svar is called. Test file: switching from manually loading functions to load_all(), solved bug where when using load_all, estimation in proxy svar would fail.
- print method for check_iv uses now scientific notation
- if the intersection of (row)names of data and instrument is empty, check_iv returns an error with a short message
- this also works fine if called within bvar, since trycatch is already implemented for irf.bvar
for proxy_svar and check_iv, not exported.
Added new references to irf setup.
Added my test file to gitignore
This is what we referred to in our last meeting as "exact matching"
Default FALSE; if set to TRUE, user is not expected to specify common index for the data and instrument. Instead the length of instrument needs to match the length of residuals (= length(data inputted in bvar) - lags).
- proxyvar argument in bv_irf implemented
-> Starting from this version, instrument does not need to be ordered as first variable
- tinytests adjusted
- example in bv_irf description only as placeholder, needs to be discussed first
Better print description for check_iv
Can be found in folder vignettes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant