class TotalRiskAlphaCalculator {

  public double evaluate(final DoubleTimeSeries<?> assetReturnTS, final DoubleTimeSeries<?> riskFreeReturnTS, final DoubleTimeSeries<?> marketReturnTS) {
    Validate.notNull(assetReturnTS, "asset returns");
    Validate.notNull(riskFreeReturnTS, "risk-free returns");
    Validate.notNull(marketReturnTS, "market returns");
    final double assetReturn = _expectedAssetReturnCalculator.evaluate(assetReturnTS);
    final double marketReturn = _expectedMarketReturnCalculator.evaluate(marketReturnTS);
    final double riskFreeReturn = _expectedRiskFreeReturnCalculator.evaluate(riskFreeReturnTS);
    final double assetStandardDeviation = _assetStandardDeviationCalculator.evaluate(assetReturnTS);
    final double marketStandardDeviation = _marketStandardDeviationCalculator.evaluate(marketReturnTS);
    return assetReturn - (riskFreeReturn + (marketReturn - riskFreeReturn) * assetStandardDeviation / marketStandardDeviation);
  }

  public  TotalRiskAlphaCalculator(final DoubleTimeSeriesStatisticsCalculator expectedAssetReturnCalculator,
      final DoubleTimeSeriesStatisticsCalculator expectedRiskFreeReturnCalculator, final DoubleTimeSeriesStatisticsCalculator expectedMarketReturnCalculator,
      final DoubleTimeSeriesStatisticsCalculator assetStandardDeviationCalculator, final DoubleTimeSeriesStatisticsCalculator marketStandardDeviationCalculator);

}