Pca, 特徵篩選, 歷史回測, 投資組合.
eigen_port_returns = np.dot(X_train.loc[:,eigen_port.index],eigen_port["weights"]) eigen_port_returns = pd.Series(eigen_port_returns.squeeze(), index = X_train.index) ar,vol,sharpe = sharpe_ratio(eigen_port_returns) annualized_ret[i] = ar annualized_vol[i] = vol sharpe_metric[i] = sharpe