September 2018
Intermediate to advanced
398 pages
9h 43m
English
For a given month, n, the real return is returnn - inflationRaten, hence the following formula:

We are going to create a new function in Returns that creates VariableReturns using Vector[EquityData] and Vector[InflationData]. Add the following unit test to ReturnsSpec:
"Returns.fromEquityAndInflationData" should { "compute real total returns from equity and inflation data" in { val equities = Vector( EquityData("2117.01", 100.0, 10.0), EquityData("2117.02", 101.0, 12.0), EquityData("2117.03", 102.0, 12.0)) val inflations = Vector( InflationData("2117.01", 100.0), InflationData("2117.02", 102.0), InflationData("2117.03" ...
Read now
Unlock full access