pyacm 0.2__tar.gz → 0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyacm-0.2 → pyacm-0.4}/PKG-INFO +34 -9
- {pyacm-0.2 → pyacm-0.4}/README.md +33 -8
- {pyacm-0.2 → pyacm-0.4}/pyacm/acm.py +1 -1
- {pyacm-0.2 → pyacm-0.4}/pyacm.egg-info/PKG-INFO +34 -9
- {pyacm-0.2 → pyacm-0.4}/setup.py +1 -1
- {pyacm-0.2 → pyacm-0.4}/LICENSE +0 -0
- {pyacm-0.2 → pyacm-0.4}/pyacm/__init__.py +0 -0
- {pyacm-0.2 → pyacm-0.4}/pyacm/utils.py +0 -0
- {pyacm-0.2 → pyacm-0.4}/pyacm.egg-info/SOURCES.txt +0 -0
- {pyacm-0.2 → pyacm-0.4}/pyacm.egg-info/dependency_links.txt +0 -0
- {pyacm-0.2 → pyacm-0.4}/pyacm.egg-info/requires.txt +0 -0
- {pyacm-0.2 → pyacm-0.4}/pyacm.egg-info/top_level.txt +0 -0
- {pyacm-0.2 → pyacm-0.4}/setup.cfg +0 -0
{pyacm-0.2 → pyacm-0.4}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyacm
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4
|
|
4
4
|
Summary: ACM Term Premium
|
|
5
5
|
Author: Tobias Adrian, Richard K. Crump, Emanuel Moench
|
|
6
6
|
Maintainer: Gustavo Amarante
|
|
@@ -33,6 +33,7 @@ carries all the relevant variables as atributes:
|
|
|
33
33
|
- Yields fitted by the model
|
|
34
34
|
- Risk-neutral yields
|
|
35
35
|
- Term premium
|
|
36
|
+
- Historical in-sample expected returns
|
|
36
37
|
- Expected return loadings
|
|
37
38
|
- Hypothesis testing (Not sure if correct, more info observations below)
|
|
38
39
|
|
|
@@ -42,6 +43,38 @@ carries all the relevant variables as atributes:
|
|
|
42
43
|
pip install pyacm
|
|
43
44
|
```
|
|
44
45
|
|
|
46
|
+
# Usage
|
|
47
|
+
```python
|
|
48
|
+
from pyacm import NominalACM
|
|
49
|
+
|
|
50
|
+
acm = NominalACM(
|
|
51
|
+
curve=yield_curve,
|
|
52
|
+
n_factors=5,
|
|
53
|
+
)
|
|
54
|
+
```
|
|
55
|
+
The tricky part of using this model is getting the correct data format. The
|
|
56
|
+
`yield_curve` dataframe in the expression above requires:
|
|
57
|
+
- Annualized log-yields for zero-coupon bonds
|
|
58
|
+
- Observations (index) must be in either monthly or daily frequency
|
|
59
|
+
- Maturities (columns) must be equally spaced in **monthly** frequency and start
|
|
60
|
+
at month 1. This means that you need to construct a bootstraped curve for every
|
|
61
|
+
date and interpolate it at fixed monthly maturities
|
|
62
|
+
- Whichever maturity you want to be the longest, your input data should have one
|
|
63
|
+
column more. For example, if you want term premium estimate up to the 10-year
|
|
64
|
+
yield (120 months), your input data should include maturities up to 121 months.
|
|
65
|
+
This is needed to properly compute the returns.
|
|
66
|
+
|
|
67
|
+
# Examples
|
|
68
|
+
|
|
69
|
+
The estimates for the US are available on the [NY FED website](https://www.newyorkfed.org/research/data_indicators/term-premia-tabs#/overview).
|
|
70
|
+
|
|
71
|
+
The jupyter notebook [`example_br`](https://github.com/gusamarante/pyacm/blob/main/example_br.ipynb)
|
|
72
|
+
contains an example application to the Brazilian DI futures curve that showcases all the available methods.
|
|
73
|
+
|
|
74
|
+
<p align="center">
|
|
75
|
+
<img src="https://raw.githubusercontent.com/gusamarante/pyacm/refs/heads/main/images/DI%20term%20premium.png" alt="DI Term Premium"/>
|
|
76
|
+
<img src="https://raw.githubusercontent.com/gusamarante/pyacm/refs/heads/main/images/DI%20observed%20vs%20risk%20neutral.png" alt="Observed VS Risk Neutral"/>
|
|
77
|
+
</p>
|
|
45
78
|
|
|
46
79
|
# Original Article
|
|
47
80
|
> Adrian, Tobias and Crump, Richard K. and Moench, Emanuel,
|
|
@@ -56,14 +89,6 @@ but I found an earlier version of the paper on SSRN where the authors go deeper
|
|
|
56
89
|
- To get daily / real-time estimates, the factor loadings estimated from the monthly frquency are used to transform the daily data
|
|
57
90
|
|
|
58
91
|
|
|
59
|
-
# Usage
|
|
60
|
-
The tricky part of using this model is getting the correct data format:
|
|
61
|
-
- The model works with annualized log-yields for zero-coupon bonds
|
|
62
|
-
- Observations (index) must be in either monthly or daily frequency
|
|
63
|
-
- 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.
|
|
64
|
-
- 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.
|
|
65
|
-
|
|
66
|
-
|
|
67
92
|
# Observations
|
|
68
93
|
I am not completely sure that computations in the [inferences attributes][inference_atribute]
|
|
69
94
|
are correct. If you find any mistakes, please open a pull request following the contributing
|
|
@@ -16,6 +16,7 @@ carries all the relevant variables as atributes:
|
|
|
16
16
|
- Yields fitted by the model
|
|
17
17
|
- Risk-neutral yields
|
|
18
18
|
- Term premium
|
|
19
|
+
- Historical in-sample expected returns
|
|
19
20
|
- Expected return loadings
|
|
20
21
|
- Hypothesis testing (Not sure if correct, more info observations below)
|
|
21
22
|
|
|
@@ -25,6 +26,38 @@ carries all the relevant variables as atributes:
|
|
|
25
26
|
pip install pyacm
|
|
26
27
|
```
|
|
27
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
|
+
|
|
50
|
+
# Examples
|
|
51
|
+
|
|
52
|
+
The estimates for the US are available on the [NY FED website](https://www.newyorkfed.org/research/data_indicators/term-premia-tabs#/overview).
|
|
53
|
+
|
|
54
|
+
The jupyter notebook [`example_br`](https://github.com/gusamarante/pyacm/blob/main/example_br.ipynb)
|
|
55
|
+
contains an example application to the Brazilian DI futures curve that showcases all the available methods.
|
|
56
|
+
|
|
57
|
+
<p align="center">
|
|
58
|
+
<img src="https://raw.githubusercontent.com/gusamarante/pyacm/refs/heads/main/images/DI%20term%20premium.png" alt="DI Term Premium"/>
|
|
59
|
+
<img src="https://raw.githubusercontent.com/gusamarante/pyacm/refs/heads/main/images/DI%20observed%20vs%20risk%20neutral.png" alt="Observed VS Risk Neutral"/>
|
|
60
|
+
</p>
|
|
28
61
|
|
|
29
62
|
# Original Article
|
|
30
63
|
> Adrian, Tobias and Crump, Richard K. and Moench, Emanuel,
|
|
@@ -39,14 +72,6 @@ but I found an earlier version of the paper on SSRN where the authors go deeper
|
|
|
39
72
|
- To get daily / real-time estimates, the factor loadings estimated from the monthly frquency are used to transform the daily data
|
|
40
73
|
|
|
41
74
|
|
|
42
|
-
# Usage
|
|
43
|
-
The tricky part of using this model is getting the correct data format:
|
|
44
|
-
- The model works with annualized log-yields for zero-coupon bonds
|
|
45
|
-
- Observations (index) must be in either monthly or daily frequency
|
|
46
|
-
- 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.
|
|
47
|
-
- 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.
|
|
48
|
-
|
|
49
|
-
|
|
50
75
|
# Observations
|
|
51
76
|
I am not completely sure that computations in the [inferences attributes][inference_atribute]
|
|
52
77
|
are correct. If you find any mistakes, please open a pull request following the contributing
|
|
@@ -130,7 +130,7 @@ class NominalACM:
|
|
|
130
130
|
|
|
131
131
|
self.n_factors = n_factors
|
|
132
132
|
self.curve = curve
|
|
133
|
-
self.curve_monthly = curve.resample('
|
|
133
|
+
self.curve_monthly = curve.resample('M').mean()
|
|
134
134
|
self.t = self.curve_monthly.shape[0] - 1
|
|
135
135
|
self.n = self.curve_monthly.shape[1]
|
|
136
136
|
self.rx_m, self.rf_m = self._get_excess_returns()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyacm
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4
|
|
4
4
|
Summary: ACM Term Premium
|
|
5
5
|
Author: Tobias Adrian, Richard K. Crump, Emanuel Moench
|
|
6
6
|
Maintainer: Gustavo Amarante
|
|
@@ -33,6 +33,7 @@ carries all the relevant variables as atributes:
|
|
|
33
33
|
- Yields fitted by the model
|
|
34
34
|
- Risk-neutral yields
|
|
35
35
|
- Term premium
|
|
36
|
+
- Historical in-sample expected returns
|
|
36
37
|
- Expected return loadings
|
|
37
38
|
- Hypothesis testing (Not sure if correct, more info observations below)
|
|
38
39
|
|
|
@@ -42,6 +43,38 @@ carries all the relevant variables as atributes:
|
|
|
42
43
|
pip install pyacm
|
|
43
44
|
```
|
|
44
45
|
|
|
46
|
+
# Usage
|
|
47
|
+
```python
|
|
48
|
+
from pyacm import NominalACM
|
|
49
|
+
|
|
50
|
+
acm = NominalACM(
|
|
51
|
+
curve=yield_curve,
|
|
52
|
+
n_factors=5,
|
|
53
|
+
)
|
|
54
|
+
```
|
|
55
|
+
The tricky part of using this model is getting the correct data format. The
|
|
56
|
+
`yield_curve` dataframe in the expression above requires:
|
|
57
|
+
- Annualized log-yields for zero-coupon bonds
|
|
58
|
+
- Observations (index) must be in either monthly or daily frequency
|
|
59
|
+
- Maturities (columns) must be equally spaced in **monthly** frequency and start
|
|
60
|
+
at month 1. This means that you need to construct a bootstraped curve for every
|
|
61
|
+
date and interpolate it at fixed monthly maturities
|
|
62
|
+
- Whichever maturity you want to be the longest, your input data should have one
|
|
63
|
+
column more. For example, if you want term premium estimate up to the 10-year
|
|
64
|
+
yield (120 months), your input data should include maturities up to 121 months.
|
|
65
|
+
This is needed to properly compute the returns.
|
|
66
|
+
|
|
67
|
+
# Examples
|
|
68
|
+
|
|
69
|
+
The estimates for the US are available on the [NY FED website](https://www.newyorkfed.org/research/data_indicators/term-premia-tabs#/overview).
|
|
70
|
+
|
|
71
|
+
The jupyter notebook [`example_br`](https://github.com/gusamarante/pyacm/blob/main/example_br.ipynb)
|
|
72
|
+
contains an example application to the Brazilian DI futures curve that showcases all the available methods.
|
|
73
|
+
|
|
74
|
+
<p align="center">
|
|
75
|
+
<img src="https://raw.githubusercontent.com/gusamarante/pyacm/refs/heads/main/images/DI%20term%20premium.png" alt="DI Term Premium"/>
|
|
76
|
+
<img src="https://raw.githubusercontent.com/gusamarante/pyacm/refs/heads/main/images/DI%20observed%20vs%20risk%20neutral.png" alt="Observed VS Risk Neutral"/>
|
|
77
|
+
</p>
|
|
45
78
|
|
|
46
79
|
# Original Article
|
|
47
80
|
> Adrian, Tobias and Crump, Richard K. and Moench, Emanuel,
|
|
@@ -56,14 +89,6 @@ but I found an earlier version of the paper on SSRN where the authors go deeper
|
|
|
56
89
|
- To get daily / real-time estimates, the factor loadings estimated from the monthly frquency are used to transform the daily data
|
|
57
90
|
|
|
58
91
|
|
|
59
|
-
# Usage
|
|
60
|
-
The tricky part of using this model is getting the correct data format:
|
|
61
|
-
- The model works with annualized log-yields for zero-coupon bonds
|
|
62
|
-
- Observations (index) must be in either monthly or daily frequency
|
|
63
|
-
- 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.
|
|
64
|
-
- 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.
|
|
65
|
-
|
|
66
|
-
|
|
67
92
|
# Observations
|
|
68
93
|
I am not completely sure that computations in the [inferences attributes][inference_atribute]
|
|
69
94
|
are correct. If you find any mistakes, please open a pull request following the contributing
|
{pyacm-0.2 → pyacm-0.4}/setup.py
RENAMED
{pyacm-0.2 → pyacm-0.4}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|