progs/drumb_sol.scala
changeset 64 d6f97b562424
parent 62 2151c77e1e24
child 81 ff8d075842d5
equal deleted inserted replaced
63:d325bce7b692 64:d6f97b562424
   140 investment(List("FB"), 2011 to 2014, 100)  // => 195
   140 investment(List("FB"), 2011 to 2014, 100)  // => 195
   141 investment(List("FB"), 2011 to 2015, 100)  // => 279
   141 investment(List("FB"), 2011 to 2015, 100)  // => 279
   142 investment(List("FB"), 2011 to 2016, 100)  // => 363
   142 investment(List("FB"), 2011 to 2016, 100)  // => 363
   143 
   143 
   144 
   144 
       
   145 val rs_p = get_prices(rstate_portfolio, 1978 to 2016)
       
   146 val bl_p = get_prices(blchip_portfolio, 1978 to 2016)
       
   147 
       
   148 val rs_d = get_deltas(rs_p)
       
   149 val bl_d = get_deltas(bl_p)
       
   150 
       
   151 rs_p(0)
       
   152     <-
       
   153 rs_p(1)
       
   154     <- 
       
   155 rs_p(2)
       
   156     <- 
       
   157 rs_p(3)
       
   158 
       
   159 rs_d(0)
       
   160 rs_d(1)
       
   161 rs_d(2)
       
   162 
       
   163 yearly_yield(rs_d, 100, 0)
       
   164 yearly_yield(rs_d, 96, 1)
       
   165 yearly_yield(rs_d, 95, 2)
       
   166 yearly_yield(rs_d, 134, 3)
       
   167 yearly_yield(rs_d, 126, 4)
       
   168 yearly_yield(rs_d, 169, 5)
       
   169