testing1/drumb_test3.scala
author Christian Urban <urbanc@in.tum.de>
Sat, 16 Jun 2018 15:13:48 +0100
changeset 183 f3767098552b
parent 166 780c40aaad27
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
130
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
val urban_prices = List(List(Some(311.349976), Some(27.505054)), 
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
			List(Some(300.222351), Some(42.357094)), 
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
			List(Some(330.555054), Some(52.852215)))
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
assert(CW6c.yearly_yield(CW6c.get_deltas(urban_prices), 100, 0) == 125)
135
077e63e96287 updated
Christian Urban <urbanc@in.tum.de>
parents: 130
diff changeset
     8
077e63e96287 updated
Christian Urban <urbanc@in.tum.de>
parents: 130
diff changeset
     9
137
53c769a78a1e updated
Christian Urban <urbanc@in.tum.de>
parents: 135
diff changeset
    10
val urban_blchip_portfolio = List("GOOG", "AAPL", "MSFT", "IBM", "FB", "AMZN", "BIDU")
53c769a78a1e updated
Christian Urban <urbanc@in.tum.de>
parents: 135
diff changeset
    11
val urban_rstate_portfolio = List("PLD", "PSA", "AMT", "AIV", "AVB", "BXP", "CCI", 
53c769a78a1e updated
Christian Urban <urbanc@in.tum.de>
parents: 135
diff changeset
    12
                                  "DLR", "EQIX", "EQR", "ESS", "EXR", "FRT", "GGP", "HCP") 
135
077e63e96287 updated
Christian Urban <urbanc@in.tum.de>
parents: 130
diff changeset
    13
138
7415ff9c91f4 updated
Christian Urban <urbanc@in.tum.de>
parents: 137
diff changeset
    14
val urban_rstate_res = CW6c.investment(urban_rstate_portfolio, 1978 to 2017, 100)
7415ff9c91f4 updated
Christian Urban <urbanc@in.tum.de>
parents: 137
diff changeset
    15
val urban_blchip_res = CW6c.investment(urban_blchip_portfolio, 1978 to 2017, 100)
135
077e63e96287 updated
Christian Urban <urbanc@in.tum.de>
parents: 130
diff changeset
    16
138
7415ff9c91f4 updated
Christian Urban <urbanc@in.tum.de>
parents: 137
diff changeset
    17
// the rstate value is 30895 because of a faulty ESS.cvs file
7415ff9c91f4 updated
Christian Urban <urbanc@in.tum.de>
parents: 137
diff changeset
    18
166
780c40aaad27 updated
Christian Urban <urbanc@in.tum.de>
parents: 144
diff changeset
    19
// if you round after each year to a Long you get 30895 and 349597
780c40aaad27 updated
Christian Urban <urbanc@in.tum.de>
parents: 144
diff changeset
    20
// if you work with doubles until the end and then round to a Long you get 30937 and 355204
780c40aaad27 updated
Christian Urban <urbanc@in.tum.de>
parents: 144
diff changeset
    21
780c40aaad27 updated
Christian Urban <urbanc@in.tum.de>
parents: 144
diff changeset
    22
assert((urban_rstate_res > 30885 && urban_rstate_res < 30905) ||
780c40aaad27 updated
Christian Urban <urbanc@in.tum.de>
parents: 144
diff changeset
    23
       (urban_rstate_res > 30927 && urban_rstate_res < 30947))
780c40aaad27 updated
Christian Urban <urbanc@in.tum.de>
parents: 144
diff changeset
    24
780c40aaad27 updated
Christian Urban <urbanc@in.tum.de>
parents: 144
diff changeset
    25
assert((urban_blchip_res > 349587 && urban_blchip_res < 349607) ||
780c40aaad27 updated
Christian Urban <urbanc@in.tum.de>
parents: 144
diff changeset
    26
       (urban_blchip_res > 355194 && urban_blchip_res < 355214))