marking1/drumb_test2.scala
author Christian Urban <urbanc@in.tum.de>
Sat, 03 Nov 2018 11:07:44 +0000
changeset 195 4bacbe753e66
parent 170 3d760b06befa
child 210 34f935e13bdd
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
170
3d760b06befa updated
Christian Urban <urbanc@in.tum.de>
parents: 169
diff changeset
     1
3d760b06befa updated
Christian Urban <urbanc@in.tum.de>
parents: 169
diff changeset
     2
// paste in the actual values
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
169
8a1bd8ddb96c updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
     4
val urban_prices1 = CW6c.get_prices(List("BIDU"), 2004 to 2008)
8a1bd8ddb96c updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
     5
val urban_prices2 = CW6c.get_prices(List("GOOG", "AAPL"), 2010 to 2012)
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
169
8a1bd8ddb96c updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
     8
assert(CW6c.get_deltas(urban_prices1) == 
8a1bd8ddb96c updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
     9
       List(List(None), List(None), 
8a1bd8ddb96c updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    10
	    List(Some(0.9277165354330709)), List(Some(2.119679764725104))))
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
169
8a1bd8ddb96c updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    12
assert(CW6c.get_deltas(urban_prices2) == 
8a1bd8ddb96c updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    13
       List(List(Some(-0.03573992567129673), Some(0.5399749442411563)), 
8a1bd8ddb96c updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    14
	    List(Some(0.10103412653643493), Some(0.2477771728154912))))