--- a/progs/drumb_sol.scala Fri Nov 18 18:47:50 2016 +0000
+++ b/progs/drumb_sol.scala Mon Nov 21 19:23:37 2016 +0000
@@ -142,3 +142,28 @@
investment(List("FB"), 2011 to 2016, 100) // => 363
+val rs_p = get_prices(rstate_portfolio, 1978 to 2016)
+val bl_p = get_prices(blchip_portfolio, 1978 to 2016)
+
+val rs_d = get_deltas(rs_p)
+val bl_d = get_deltas(bl_p)
+
+rs_p(0)
+ <-
+rs_p(1)
+ <-
+rs_p(2)
+ <-
+rs_p(3)
+
+rs_d(0)
+rs_d(1)
+rs_d(2)
+
+yearly_yield(rs_d, 100, 0)
+yearly_yield(rs_d, 96, 1)
+yearly_yield(rs_d, 95, 2)
+yearly_yield(rs_d, 134, 3)
+yearly_yield(rs_d, 126, 4)
+yearly_yield(rs_d, 169, 5)
+