-
Notifications
You must be signed in to change notification settings - Fork 23
Proxy SVAR #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gabrielkonecny
wants to merge
28
commits into
nk027:master
Choose a base branch
from
gabrielkonecny:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Proxy SVAR #96
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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).
…xied variable first
- 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This version implements Proxy SVAR, including descriptions, tests, and examples.