diff --git a/experiments/backtest.py b/experiments/backtest.py index 1b412d1..8917411 100644 --- a/experiments/backtest.py +++ b/experiments/backtest.py @@ -268,7 +268,7 @@ def daily_turnover(self) -> pd.Series: prices = load_data()[0].loc[self.history] valuation_trades = trades * prices relative_trades = valuation_trades.div(self.portfolio_value, axis=0) - return relative_trades.abs().sum(axis=1) + return relative_trades.abs().sum(axis=1) / 2 @property def turnover(self) -> float: diff --git a/experiments/scaling_large.py b/experiments/scaling_large.py index 0880edc..83002d3 100644 --- a/experiments/scaling_large.py +++ b/experiments/scaling_large.py @@ -6,7 +6,7 @@ def main(): - fitting = False + fitting = True scenarios = get_scenarios(fitting=fitting) res = [] for n_assets, n_factors in scenarios: @@ -151,11 +151,13 @@ def get_scenarios(fitting=False): (2000, 100), (10000, 50), (10000, 100), + (50_000, 200), + (50_000, 500), ] else: # fine grid for fitting - assets = np.logspace(3, 3.5, 10, dtype=int) - factors = np.logspace(3, 3.5, 10, dtype=int) + assets = np.logspace(3, 4.7, 10, dtype=int) + factors = np.logspace(3, 4, 10, dtype=int) pairs = [(a, f) for a in assets for f in factors if a >= f] return pairs