Commit 99b252c3 authored by wegamekinglc's avatar wegamekinglc

added with new api

parent 2161714e
......@@ -72,7 +72,6 @@ cdef extern from "tvoptimizer.hpp" namespace "pfopt":
double*,
double*,
double,
double,
int,
double*,
double*,
......@@ -96,8 +95,7 @@ cdef class CVOptimizer:
cnp.ndarray[double, ndim=2] cons_matrix=None,
double[:] clbound=None,
double[:] cubound=None,
double target_low=0.0,
double target_high=1.0,
double target_vol=1.0,
cnp.ndarray[double, ndim=2] factor_cov_matrix=None,
cnp.ndarray[double, ndim=2] factor_loading_matrix=None,
double[:] idsync_risk=None):
......@@ -123,8 +121,7 @@ cdef class CVOptimizer:
&cons[0],
&clbound[0],
&cubound[0],
target_low,
target_high,
target_vol,
self.f,
&factor_cov[0] if factor_cov is not None else NULL,
&factor_loading[0] if factor_loading is not None else NULL,
......@@ -139,8 +136,7 @@ cdef class CVOptimizer:
NULL,
NULL,
NULL,
target_low,
target_high,
target_vol,
self.f,
&factor_cov[0] if factor_cov is not None else NULL,
&factor_loading[0] if factor_loading is not None else NULL,
......
Subproject commit ffaf2153dfdce380c3d8aa1a69b328ab77665ad3
Subproject commit b78ad8a55855c448a866f91a3876a271a52d68a1
......@@ -109,7 +109,6 @@ def target_vol_builder(er: np.ndarray,
cons_mat,
clbound,
cubound,
0.,
vol_target,
risk_model['factor_cov'],
risk_model['factor_loading'],
......
This diff is collapsed.
......@@ -116,7 +116,6 @@ class TestOptimizers(unittest.TestCase):
None,
None,
None,
target_vol,
target_vol)
# check against known good result
......@@ -144,7 +143,6 @@ class TestOptimizers(unittest.TestCase):
cons,
clbound,
cubound,
target_vol,
target_vol)
# check against known good result
......@@ -173,7 +171,6 @@ class TestOptimizers(unittest.TestCase):
cons,
clbound,
cubound,
0.,
target_vol,
factor_var,
factor_load,
......@@ -204,7 +201,6 @@ class TestOptimizers(unittest.TestCase):
cons,
clbound,
cubound,
0.,
target_vol)
# check against known good result
......
......@@ -57,6 +57,9 @@ class TestMeanVarianceBuild(unittest.TestCase):
status, _, x = mean_variance_builder(er, model, bm, lbound, ubound, None, None, lam=1)
np.testing.assert_array_almost_equal(x, np.linalg.inv(cov) @ er)
def test_mean_variance_builder_without_constraints_with_factor_model(self):
pass
def test_mean_variance_builder_with_none_unity_lambda(self):
er = np.array([0.01, 0.02, 0.03])
cov = np.array([[0.02, 0.01, 0.02],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment