Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type ContingentClaim = [ContingentClaim']
- data ContingentClaim' = ContingentClaim' {
- payoutTime :: Double
- collector :: [Vector Double] -> Vector Double
- observations :: [(Double, Observables -> Vector Double, Double -> Double)]
- data Observables = Observables [Vector Double]
- data ContingentClaimBasket = ContingentClaimBasket ContingentClaim [Double]
- data OptionType
- ccBasket :: ContingentClaim -> ContingentClaimBasket
- vanillaOption :: OptionType -> Double -> Double -> ContingentClaim
- binaryOption :: OptionType -> Double -> Double -> Double -> ContingentClaim
- straddle :: Double -> Double -> ContingentClaim
- arithmeticAsianOption :: OptionType -> Double -> [Double] -> Double -> ContingentClaim
- geometricAsianOption :: OptionType -> Double -> [Double] -> Double -> ContingentClaim
- callSpread :: Double -> Double -> Double -> ContingentClaim
- putSpread :: Double -> Double -> Double -> ContingentClaim
- forwardContract :: Double -> ContingentClaim
- fixed :: Double -> Double -> ContingentClaim
- multiplier :: Double -> ContingentClaim -> ContingentClaim
- short :: ContingentClaim -> ContingentClaim
- combine :: ContingentClaim -> ContingentClaim -> ContingentClaim
- terminalOnly :: Double -> (Double -> Double) -> ContingentClaim
- changeObservableFct :: ContingentClaim -> (Observables -> Vector Double) -> ContingentClaim
- obsNum :: ContingentClaim -> Int -> ContingentClaim
- obsHead :: Observables -> Vector Double
Types for modeling contingent claims.
type ContingentClaim = [ContingentClaim'] Source
ContingentClaim
is just a list of the underlying ContingentClaim'
s.
data ContingentClaim' Source
ContingentClaim'
is the underlying type of contingent claims.
ContingentClaim' | |
|
data Observables Source
Observables are the observables available in a Monte Carlo simulation. Most basic MCs will have one observables (Black-Scholes) whereas more complex ones will have multiple (i.e. Heston-Hull-White).
data ContingentClaimBasket Source
Used to compile claims for the Monte Carlo engine.
ccBasket :: ContingentClaim -> ContingentClaimBasket Source
Converts a ContingentClaim
into a ContingentClaimBasket
for use by the MC engine.
Options and option combinators
vanillaOption :: OptionType -> Double -> Double -> ContingentClaim Source
Takes an OptionType, a strike, and a time to maturity and generates a vanilla option.
binaryOption :: OptionType -> Double -> Double -> Double -> ContingentClaim Source
Takes an OptionType, a strike, a payout amount and a time to maturity and generates a vanilla option.
straddle :: Double -> Double -> ContingentClaim Source
A straddle is a put and a call with the same time to maturity / strike.
arithmeticAsianOption :: OptionType -> Double -> [Double] -> Double -> ContingentClaim Source
Takes an OptionType, a strike, observation times, time to maturity and generates an arithmetic Asian option.
geometricAsianOption :: OptionType -> Double -> [Double] -> Double -> ContingentClaim Source
Takes an OptionType, a strike, observation times, time to maturity and generates a geometric Asian option.
callSpread :: Double -> Double -> Double -> ContingentClaim Source
A call spread is a long position in a low-strike call and a short position in a high strike call.
putSpread :: Double -> Double -> Double -> ContingentClaim Source
A put spread is a long position in a high strike put and a short position in a low strike put.
forwardContract :: Double -> ContingentClaim Source
Takes a time to maturity and generates a forward contract.
fixed :: Double -> Double -> ContingentClaim Source
Takes an amount and a time and generates a fixed cash flow.
multiplier :: Double -> ContingentClaim -> ContingentClaim Source
Scales up a contingent claim by a multiplier.
short :: ContingentClaim -> ContingentClaim Source
Flips the signs in a contingent claim to make it a short position.
combine :: ContingentClaim -> ContingentClaim -> ContingentClaim Source
Just combines two contingent claims into one.
terminalOnly :: Double -> (Double -> Double) -> ContingentClaim Source
Takes a maturity time and a function and generates a ContingentClaim dependent only on the terminal value of the observable.
changeObservableFct :: ContingentClaim -> (Observables -> Vector Double) -> ContingentClaim Source
Offers the ability to change the function on the observable an option is based on. All options default to being based on the first observable.
Utility functions
obsNum :: ContingentClaim -> Int -> ContingentClaim Source
Utility function for when the observable function is just !!
obsHead :: Observables -> Vector Double Source
Utility function to pull the head of a basket of observables.