main_testing1/drumb_test6.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Mon, 08 Nov 2021 01:39:00 +0000
changeset 403 ffce7b61b446
parent 402 de59aa20a1dc
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
248
1616d06a0893 updared
Christian Urban <urbanc@in.tum.de>
parents: 199
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: 248
diff changeset
     2
/*
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     3
def myassert(cond : => Boolean) = {
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     4
  try {
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     5
    assert(cond)
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     6
  } catch { 
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     7
    case _ : Throwable => System.exit(1)
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     8
  }
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     9
}
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    10
*/
130
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
281
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    12
val ds_urban = List(List(Some(-0.03573991804411003), Some(0.539974575389325)), 
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    13
                    List(Some(0.10103414222249969), Some(0.24777764141006836)))
130
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
402
de59aa20a1dc updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 347
diff changeset
    17
assert(M1.yearly_yield(ds_urban, 100, 0) == 125)
de59aa20a1dc updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 347
diff changeset
    18
assert(M1.yearly_yield(ds_urban, 100, 1) == 117)