You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-8Lines changed: 22 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,29 @@ carries all the relevant variables as atributes:
26
26
pip install pyacm
27
27
```
28
28
29
+
# Usage
30
+
```python
31
+
from pyacm import NominalACM
32
+
33
+
acm = NominalACM(
34
+
curve=yield_curve,
35
+
n_factors=5,
36
+
)
37
+
```
38
+
The tricky part of using this model is getting the correct data format. The
39
+
`yield_curve` dataframe in the expression above requires:
40
+
- Annualized log-yields for zero-coupon bonds
41
+
- Observations (index) must be in either monthly or daily frequency
42
+
- Maturities (columns) must be equally spaced in **monthly** frequency and start
43
+
at month 1. This means that you need to construct a bootstraped curve for every
44
+
date and interpolate it at fixed monthly maturities
45
+
- Whichever maturity you want to be the longest, your input data should have one
46
+
column more. For example, if you want term premium estimate up to the 10-year
47
+
yield (120 months), your input data should include maturities up to 121 months.
48
+
This is needed to properly compute the returns.
49
+
29
50
# Examples
51
+
30
52
The estimates for the US are available on the [NY FED website](https://www.newyorkfed.org/research/data_indicators/term-premia-tabs#/overview).
31
53
32
54
The jupyter notebook [`example_br`](https://github.com/gusamarante/pyacm/blob/main/example_br.ipynb)
@@ -50,14 +72,6 @@ but I found an earlier version of the paper on SSRN where the authors go deeper
50
72
- To get daily / real-time estimates, the factor loadings estimated from the monthly frquency are used to transform the daily data
51
73
52
74
53
-
# Usage
54
-
The tricky part of using this model is getting the correct data format:
55
-
- The model works with annualized log-yields for zero-coupon bonds
56
-
- Observations (index) must be in either monthly or daily frequency
57
-
- Maturities (columns) must be equally spaced in **monthly** frequency and start at month 1. This means that you need to construct a bootstraped curve for every date and interpolate it at fixed monthly maturities.
58
-
- Whichever maturity you want to be the longest, your input data should have one column more. For example, if you want term premium estimate up to the 10-year yield (120 months), your input data should include maturities up to 121 months. This is needed to properly compute the returns.
59
-
60
-
61
75
# Observations
62
76
I am not completely sure that computations in the [inferences attributes][inference_atribute]
63
77
are correct. If you find any mistakes, please open a pull request following the contributing
0 commit comments