skfolio 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl
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.
- skfolio/prior/_black_litterman.py +1 -1
- skfolio/prior/_empirical.py +5 -4
- {skfolio-0.2.0.dist-info → skfolio-0.2.1.dist-info}/METADATA +2 -2
- {skfolio-0.2.0.dist-info → skfolio-0.2.1.dist-info}/RECORD +7 -7
- {skfolio-0.2.0.dist-info → skfolio-0.2.1.dist-info}/LICENSE +0 -0
- {skfolio-0.2.0.dist-info → skfolio-0.2.1.dist-info}/WHEEL +0 -0
- {skfolio-0.2.0.dist-info → skfolio-0.2.1.dist-info}/top_level.txt +0 -0
@@ -156,7 +156,7 @@ class BlackLitterman(BasePrior):
|
|
156
156
|
check_type=BasePrior,
|
157
157
|
)
|
158
158
|
# fitting prior estimator
|
159
|
-
self.prior_estimator_.fit(X)
|
159
|
+
self.prior_estimator_.fit(X, y)
|
160
160
|
|
161
161
|
prior_mu = self.prior_estimator_.prior_model_.mu
|
162
162
|
prior_covariance = self.prior_estimator_.prior_model_.covariance
|
skfolio/prior/_empirical.py
CHANGED
@@ -120,11 +120,11 @@ class EmpiricalPrior(BasePrior):
|
|
120
120
|
"`is_log_normal` is `False`"
|
121
121
|
)
|
122
122
|
# Expected returns
|
123
|
-
self.mu_estimator_.fit(X)
|
123
|
+
self.mu_estimator_.fit(X, y)
|
124
124
|
mu = self.mu_estimator_.mu_
|
125
125
|
|
126
126
|
# Covariance
|
127
|
-
self.covariance_estimator_.fit(X)
|
127
|
+
self.covariance_estimator_.fit(X, y)
|
128
128
|
covariance = self.covariance_estimator_.covariance_
|
129
129
|
else:
|
130
130
|
if self.investment_horizon is None:
|
@@ -134,14 +134,15 @@ class EmpiricalPrior(BasePrior):
|
|
134
134
|
)
|
135
135
|
# Convert linear returns to log returns
|
136
136
|
X_log = np.log(1 + X)
|
137
|
+
y_log = np.log(1 + y) if y is not None else None
|
137
138
|
|
138
139
|
# Estimates the moments on the log returns
|
139
140
|
# Expected returns
|
140
|
-
self.mu_estimator_.fit(X_log)
|
141
|
+
self.mu_estimator_.fit(X_log, y_log)
|
141
142
|
mu = self.mu_estimator_.mu_
|
142
143
|
|
143
144
|
# Covariance
|
144
|
-
self.covariance_estimator_.fit(X_log)
|
145
|
+
self.covariance_estimator_.fit(X_log, y_log)
|
145
146
|
covariance = self.covariance_estimator_.covariance_
|
146
147
|
|
147
148
|
# Using the property of aggregation across time we scale this distribution
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: skfolio
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.1
|
4
4
|
Summary: Portfolio optimization built on top of scikit-learn
|
5
5
|
Author-email: Hugo Delatte <delatte.hugo@gmail.com>
|
6
6
|
Maintainer-email: Hugo Delatte <delatte.hugo@gmail.com>
|
@@ -563,7 +563,7 @@ Black & Litterman Factor Model
|
|
563
563
|
------------------------------
|
564
564
|
.. code-block:: python
|
565
565
|
|
566
|
-
factor_views = ["MTUM - QUAL == 0.03 ", "
|
566
|
+
factor_views = ["MTUM - QUAL == 0.03 ", "VLUE == 0.06"]
|
567
567
|
model = MeanRisk(
|
568
568
|
objective_function=ObjectiveFunction.MAXIMIZE_RATIO,
|
569
569
|
prior_estimator=FactorModel(
|
@@ -59,8 +59,8 @@ skfolio/preprocessing/__init__.py,sha256=15A1bzfPsbfxxXgGP1gstf4R0E_347Wn18z5W5j
|
|
59
59
|
skfolio/preprocessing/_returns.py,sha256=_7UtXugQPWitNrrZ3M2dUOAun8aVr0lI45Ms6KFiS94,3826
|
60
60
|
skfolio/prior/__init__.py,sha256=jql8NTiWlykPKJUXTOPdqm531mP8Pul1QAR6hXTXA6c,446
|
61
61
|
skfolio/prior/_base.py,sha256=Dx6rX0X6ymDiieFOI-ik3xMNNFhYEtwLSXOdajf5wZY,1927
|
62
|
-
skfolio/prior/_black_litterman.py,sha256=
|
63
|
-
skfolio/prior/_empirical.py,sha256=
|
62
|
+
skfolio/prior/_black_litterman.py,sha256=sVx8113xeP4B6LA4rICKp0cgw7w3F46aQzIQY_34QwQ,9400
|
63
|
+
skfolio/prior/_empirical.py,sha256=eHBSXVzIEvA2oBAnv6HW9D8iy3xKDxpCN_xsg8j8Ye8,5821
|
64
64
|
skfolio/prior/_factor_model.py,sha256=xC-womM7oC91jRaIQP7MSiRPkwm5b7pkWHi-5mOb2jY,9665
|
65
65
|
skfolio/uncertainty_set/__init__.py,sha256=LlMHtYv9G9fgtM7m4sCSToS9et57Pm2Q2gGchTVrj6c,617
|
66
66
|
skfolio/uncertainty_set/_base.py,sha256=rZ3g2AhDKFQTPajgh6Fz5S5TTf0qM4Ie6RGxPhp32D8,3301
|
@@ -74,8 +74,8 @@ skfolio/utils/stats.py,sha256=IP36nMc5j5Hcqjbg7lvDIsGp1GWRdOh5jU3W6Z8nkYs,13132
|
|
74
74
|
skfolio/utils/tools.py,sha256=xa42f7U3Ki8-CJS6g8w7bKCLI_QMJ8D6LxLBjlEM7Ok,15374
|
75
75
|
skfolio/utils/fixes/__init__.py,sha256=knHau8PRZP07XDHR59CW8VWxkpTP0gdr6RAHJrO-zaA,95
|
76
76
|
skfolio/utils/fixes/_dendrogram.py,sha256=9aIhSnMwpQHJhQx7IpXC3jlw6YJ3H4XQnnx_d4nMllQ,13551
|
77
|
-
skfolio-0.2.
|
78
|
-
skfolio-0.2.
|
79
|
-
skfolio-0.2.
|
80
|
-
skfolio-0.2.
|
81
|
-
skfolio-0.2.
|
77
|
+
skfolio-0.2.1.dist-info/LICENSE,sha256=F6Gi-ZJX5BlVzYK8R9NcvAkAsKa7KO29xB1OScbrH6Q,1526
|
78
|
+
skfolio-0.2.1.dist-info/METADATA,sha256=OzW5QNHb_EG_jHtP5lPqWas8EAMyl6FPgS3XP6CXulQ,19585
|
79
|
+
skfolio-0.2.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
80
|
+
skfolio-0.2.1.dist-info/top_level.txt,sha256=NXEaoS9Ms7t32gxkb867nV0OKlU0KmssL7IJBVo0fJs,8
|
81
|
+
skfolio-0.2.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|