TermStructureModels.jl

TermStructureModels.jl has the below functions.

To use the above functions, an estimation of the model must first be conducted. That is, use posterior_sampler to obtain posterior samples of parameters. The posterior samples are used for the above functions (Statistical inference and Forecasting). For details, refer to the corresponding pages.

Some outputs of our package are not simple arrays. They are

The above outputs contain information about the posterior distributions of objects of interest. Users can use the outputs above to extract posterior samples or calculate descriptive statistics of the posterior distributions.

Our package is based on our paper. Descriptions of our model and the meanings of each variable can be found in the paper. The Notation section details how notations in the paper correspond to variables in our package. Additionally, the example file used in our paper is available in the repository.

Users are encouraged to read the two text boxes below.

Unit of Data

Theoretical term structure models typically describe bond yields as decimals per one time period. However, yield data is typically presented in percent per annum. Therefore, you have to address the issue by using the option data_scale. data_scale represents the scale of the data. Specifically,

`yields_in_data` = `data_scale`*`theoretical_yields_in_the_model`

holds. For example, suppose we have monthly yield data in percent per annum. If we use a monthly term structure model, data_scale=1200. The default value of data_scale is 1200 for all functions.

Functions that have option data_scale are as follows:

Normalization of Data

Our package demeans the principal components of bond yields, which are spanned risk factors in the bond market. Therefore, we recommend using macro data after demeaning it. Of course, demeaning the macro variables is recommended but not mandatory.