TermStructureModels.jl is a Julia package to estimate the term structure of interest rates. We currently provide a Gaussian affine term structure model that satisfies the No-Arbitrage condition.
The model is the three-factor JSZ(Joslin, Singleton, and Zhu, 2011) model constrained by the AFNS(Christensen, Diebold, and Rudebusch, 2011) restriction. The paper provides theoretical descriptions of the model.
The main features of the package are that it allows for the lag length of the VAR system in the Physical measure to extend beyond one. Additionally, it permits the inclusion of numerous macroeconomic variables as unspanned risks within the Physical measure.
Other features of the package include
- Estimation of the model in the Bayesian framework
- All hyperparameters, including the lag length of the VAR system, are automatically determined by the data
- Yield curve interpolation and fitting
- Decomposition of a bond yield into the expectation hypothesis component and the term premium component
- Conditional Forecasting, including Scenario Analyses, to inspect interactions between bond yields and the macroeconomy
The package also provides the yield-only model and the standard JSZ model with three distinct eigenvalues, not restricted by the AFNS constraint.
Run
using Pkg
Pkg.add("TermStructureModels")Run
using TermStructureModelsto load all functions of the package.
To better understand how to use the package, refer to the script file used for the paper.
If you want to cite this package for your work, cite the paper.