MAINT: Use numpy for risk period returns.

Following the lead of the RiskMetricsBatch conversion to use
more pandas and numpy.
Bringing the iterative and batch versions closer together as we
work towards folding them into one.
This commit is contained in:
Eddie Hebert
2013-03-28 18:59:39 -04:00
parent c6f8f430d7
commit 702e6f00d2
+2 -7
View File
@@ -591,13 +591,8 @@ algorithm_returns ({algo_count}) in range {start} : {end}"
)
def calculate_period_returns(self, returns):
period_returns = 1.0
for r in returns:
period_returns *= (1.0 + r)
period_returns -= 1.0
return period_returns
returns = np.array(returns)
return (1. + returns).prod() - 1
def update_current_max(self):
if len(self.compounded_log_returns) == 0: