This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import func | |
# These coincide with the choices hardwired into the spreadsheet provided to ISDA, so don't change them | |
ISDA_PERMITTED_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' # Don't change! | |
ISDA_PRIME = 59575553 | |
def _avoidReserved( s ): | |
""" Avoid clash with reserved namespace used by CFTC """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ISDA_PERMITTED_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
ISDA_PRIME = 59575553 | |
def leiHash( lei, permittedChars = ISDA_PERMITTED_CHARS ): | |
""" Shorten 20 character alpha-numeric Legal Entity Identifier into 10 character alpha-numeric "short LEI" that | |
can be used as a Unique Trade Identifier (UTI) prefix. The algorithm is simply the modulo operation lifted from | |
integers to the space of alpha-numeric case-insensitive strings. | |
Argument | |
-------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Compositional { | |
type FunctionOfList[T1] = List[T1] => Option[Double] | |
def convertFunctionOfListToFunctionInf[T1](f: FunctionOfList[T1], support: Set[Integer]): (Stream[T1] => Option[Double]) = { | |
(xs: Stream[T1]) => | |
{ | |
val variablesThatMatter = support.toList.map(i => xs(i)) | |
val fx = f(variablesThatMatter) | |
fx |
NewerOlder