https://github.com/junyuan-chen/autoregressivemodels.jl
Essential toolkits for working with autoregressive models
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 2 DOI reference(s) in README -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.2%) to scientific vocabulary
Keywords
Repository
Essential toolkits for working with autoregressive models
Basic Info
Statistics
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
AutoregressiveModels.jl
Essential toolkits for working with autoregressive models
AutoregressiveModels.jl is a Julia package that provides essential toolkits for working with autoregressive models. Performance and reusability is prioritized over comprehensive coverage of functionalities, as a main goal of the package is to provide support for other packages with more specialized purposes. At this moment, the main focus is on vector autoregressions (VAR). Estimation of factor models is implemented for balanced panel data following Stock and Watson (2016). Some basic support for the autoregressive-moving-average (ARMA) models is also included.
Example Usage
To illustrate what the package offers, here is an example of estimating the impulse responses based on structural vector autoregressions (SVAR) and producing a simultaneous confidence band with bootstrap. Details for individual functions may be found from docstrings in the help mode of Julia REPL.
Impulse Responses from Structural VAR
The example below reproduces one application from Montiel Olea and Plagborg-Møller (2019). The data used are from Gertler and Karadi (2015).
Step 1: Model Specification and Point Estimates
```julia using AutoregressiveModels, CSV, ConfidenceBands using LocalProjections: datafile # Only needed for the data file
Load a prepared data file from Gertler and Karadi (2015)
data = CSV.File(datafile(:gk))
Specify the variables for VAR (the order matters)
names = (:logcpi, :logip, :gs1, :ebp)
Estimate VAR(12) with OLS and conduct Cholesky factorization for identification
r = fit(VARProcess, data, names, 12, choleskyresid=true, adjust_dofr=false)
Compute point estimates of impulse responses (37 horizons) to the structural shock (3)
irf = impulse(r, 3, 37, choleskyshock=true) ```
Step 2: Bootstrap Confidence Band
A flexible autoregressive bootstrap framework is defined via bootstrap!
and can be used to produce the draws of estimates for
SuptQuantileBootBand() implemented in
ConfidenceBands.jl:
```julia
Define how the bootstrap statistics are computed
See the docstring of bootstrap! for explanations
fillirf!(x) = impulse!(x.out, x.r, 3, choleskyshock=true) ndraw = 10000
Preallocate an output array for statistics computed over the bootstrap iterations
bootirfs = Array{Float64, 3}(undef, 4, 37, ndraw)
Specify the bootstrap procedure
bootstrap!(bootirfs=>fillirf!, r, initialindex=1, drawresid=iidresiddraw!)
Produce a confidence band from the result
boot2 = view(bootirfs, 2, :, :) lb, ub, pwlevel = confint(SuptQuantileBootBand(), boot2, level=0.68) ```
Step 3: Visualization
Here is a plot for the results with the complete script located here:
References
Gertler, Mark, and Peter Karadi. 2015. "Replication Data for: Monetary Policy Surprises, Credit Costs, and Economic Activity." American Economic Association [publisher], Inter-university Consortium for Political and Social Research [distributor]. https://doi.org/10.3886/E114082V1.
Montiel Olea, José Luis and Mikkel Plagborg-Møller. 2019. "Simultaneous Confidence Bands: Theory, Implementation, and an Application to SVARs." Journal of Applied Econometrics 34 (1): 1-17.
Stock, James H. and Mark W. Watson. 2016. "Chapter 8---Dynamic Factor Models, Factor-Augmented Vector Autoregressions, and Structural Vector Autoregressions in Macroeconomics." In Handbook of Macroeconomics, Vol. 2A, edited by John B. Taylor and Harald Uhlig, 415-525. Amsterdam: Elsevier.
Owner
- Name: Norman
- Login: junyuan-chen
- Kind: user
- Location: La Jolla, CA
- Twitter: JunyuanChenEcon
- Repositories: 11
- Profile: https://github.com/junyuan-chen
PhD candidate in economics at University of California San Diego
GitHub Events
Total
Last Year
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Norman | n****t@g****m | 8 |
| Norman | 3****n | 2 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 1
- Total pull requests: 3
- Average time to close issues: less than a minute
- Average time to close pull requests: about 12 hours
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 2.0
- Average comments per pull request: 1.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- JuliaTagBot (1)
Pull Request Authors
- junyuan-chen (6)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 3 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
juliahub.com: AutoregressiveModels
Essential toolkits for working with autoregressive models
- Documentation: https://docs.juliahub.com/General/AutoregressiveModels/stable/
- License: MIT
-
Latest release: 0.1.1
published almost 2 years ago