testing1/drumb_test7.scala
changeset 199 54befaf23648
parent 166 780c40aaad27
child 248 1616d06a0893
equal deleted inserted replaced
198:d59c7995bcb2 199:54befaf23648
       
     1 
       
     2 val urban_prices = List(List(Some(311.349976), Some(27.505054)), 
       
     3 			List(Some(300.222351), Some(42.357094)), 
       
     4 			List(Some(330.555054), Some(52.852215)))
       
     5 
       
     6 
       
     7 assert(CW6c.yearly_yield(CW6c.get_deltas(urban_prices), 100, 0) == 125)
       
     8 
       
     9 
       
    10 val urban_blchip_portfolio = List("GOOG", "AAPL", "MSFT", "IBM", "FB", "AMZN", "BIDU")
       
    11 val urban_rstate_portfolio = List("PLD", "PSA", "AMT", "AIV", "AVB", "BXP", "CCI", 
       
    12                                   "DLR", "EQIX", "EQR", "ESS", "EXR", "FRT", "GGP", "HCP") 
       
    13 
       
    14 val urban_rstate_res = CW6c.investment(urban_rstate_portfolio, 1978 to 2017, 100)
       
    15 val urban_blchip_res = CW6c.investment(urban_blchip_portfolio, 1978 to 2017, 100)
       
    16 
       
    17 // the rstate value is 30895 because of a faulty ESS.cvs file
       
    18 
       
    19 // if you round after each year to a Long you get 30895 and 349597
       
    20 // if you work with doubles until the end and then round to a Long you get 30937 and 355204
       
    21 
       
    22 assert((urban_rstate_res > 30885 && urban_rstate_res < 30905) ||
       
    23        (urban_rstate_res > 30927 && urban_rstate_res < 30947))
       
    24 
       
    25 assert((urban_blchip_res > 349587 && urban_blchip_res < 349607) ||
       
    26        (urban_blchip_res > 355194 && urban_blchip_res < 355214))