marking1/drumb_test6.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Mon, 06 Nov 2023 21:45:03 +0000
changeset 479 6889d9d441ed
parent 281 87b9e3e2c1a7
permissions -rw-r--r--
updated jars
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
260
b4812c877b05 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
//val urban_deltas = get_deltas(get_prices(List("GOOG", "AAPL"), 2010 to 2012))
281
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 268
diff changeset
     2
/*
268
e43f7e92ba26 updated
Christian Urban <urbanc@in.tum.de>
parents: 260
diff changeset
     3
def myassert(cond : => Boolean) = {
e43f7e92ba26 updated
Christian Urban <urbanc@in.tum.de>
parents: 260
diff changeset
     4
  try {
e43f7e92ba26 updated
Christian Urban <urbanc@in.tum.de>
parents: 260
diff changeset
     5
    assert(cond)
e43f7e92ba26 updated
Christian Urban <urbanc@in.tum.de>
parents: 260
diff changeset
     6
  } catch { 
e43f7e92ba26 updated
Christian Urban <urbanc@in.tum.de>
parents: 260
diff changeset
     7
    case _ : Throwable => System.exit(1)
e43f7e92ba26 updated
Christian Urban <urbanc@in.tum.de>
parents: 260
diff changeset
     8
  }
e43f7e92ba26 updated
Christian Urban <urbanc@in.tum.de>
parents: 260
diff changeset
     9
}
281
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 268
diff changeset
    10
*/
268
e43f7e92ba26 updated
Christian Urban <urbanc@in.tum.de>
parents: 260
diff changeset
    11
e43f7e92ba26 updated
Christian Urban <urbanc@in.tum.de>
parents: 260
diff changeset
    12
val ds_urban = List(List(Some(-0.03573991804411003), Some(0.539974575389325)), 
e43f7e92ba26 updated
Christian Urban <urbanc@in.tum.de>
parents: 260
diff changeset
    13
                    List(Some(0.10103414222249969), Some(0.24777764141006836)))
260
b4812c877b05 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
b4812c877b05 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
b4812c877b05 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
281
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 268
diff changeset
    17
assert(CW6b.yearly_yield(ds_urban, 100, 0) == 125)
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 268
diff changeset
    18
assert(CW6b.yearly_yield(ds_urban, 100, 1) == 117)