Convenient method aliases for finmath lib.
A main objective of this project is to build a bridge from a Kotlin project to finmath-lib to allow for cleaner, more concise Kotlin code when using finmath-lib.
For example, since Kotlin allows for method names being symbols like +
or -
instead of add
and sub
, by importing
import net.finmath.kotlin.stochastic.*
you may write Kotlin code like
val underlying = initialValue * exp(drift + diffusion) val payoff = max(underlying - strike, 0.0) val value = expectation(payoff * Math.exp(-riskFreeRate * optionMaturity))
instead of
val underlying = diffusion.add(drift).exp().mult(initialValue) val payoff = underlying.sub(strike).floor(0.0) val value = payoff.mult(Math.exp(-riskFreeRate * optionMaturity)).average()
where diffusion
is an object of type net.finmath.stochastic.RandomVariable
.
finmath-lib-kotlin is distributed through the central Maven repository. It’s coordinates are:
<groupId>net.finmath</groupId> <artifactId>finmath-lib-kotlin</artifactId> <version>5.0.5</version>
The code of “finmath lib”, “finmath experiments” and “finmath lib cuda extensions” and “finmath lib plot extensions” and “finmath lib kotlin” (packages net.finmath.*
) are distributed under the Apache License version 2.0, unless otherwise explicitly stated.