{-# LINE 1 "./QuantLib/Process.chs" #-}
{-# LANGUAGE FlexibleInstances #-}
module QuantLib.Process
(
GenStochasticProcess
, StochasticProcess
, GenStochasticProcess1D
, StochasticProcess1D
, GenGeneralizedBlackScholesProcess
, GeneralizedBlackScholesProcess
, BlackProcess
, ExtOUWithJumpsProcess
, ExtendedOrnsteinUhlenbeckProcess
, GJRGARCHProcess
, GenHestonProcess
, HestonProcess
, HestonSLVProcess
, BatesProcess
, G2Process
, G2ForwardProcess
, HybridHestonHullWhiteProcess
, KlugeExtOUProcess
, LiborForwardModelProcess
, StochasticProcessArray
, VarianceGammaProcess
, Merton76Process
, HullWhiteProcess
, HullWhiteForwardProcess
, ProcessDiscretization(..)
, ExtendedBlackScholesMertonProcessDiscretization(..)
, ExtendedOrnsteinUhlenbeckProcessDiscretization(..)
, HestonProcessDiscretization(..)
, GJRGARCHProcessDiscretization(..)
, HybridHestonHullWhiteProcessDiscretization(..)
, asStochasticProcess
, asStochasticProcess1D
, asGeneralizedBlackScholesProcess
, asHestonProcess
, blackProcess
, blackScholesMertonProcess
, blackScholesProcess
, extendedBlackScholesMertonProcess
, garmanKohlhagenProcess
, generalizedBlackScholesProcess
, squareRootProcess
, vegaStressedBlackScholesProcess
, batesProcess
, extOuWithJumpsProcess
, g2ForwardProcess
, g2Process
, gemanRoncoroniProcess
, geometricBrownianMotionProcess
, gjrGarchProcess
, hestonProcess
, hestonSlvProcess
, hullWhiteForwardProcess
, hullWhiteProcess
, hybridHestonHullWhiteProcess
, klugeExtOuProcess
, withExtendedOrnsteinUhlenbeckProcess
, linearSeasonalOrnsteinUhlenbeckProcess
, liborForwardModelProcess
, merton76Process
, ornsteinUhlenbeckProcess
, varianceGammaProcess
, stochasticProcessArray
, HasForwardMeasureTime(..)
, apply
, covariance
, diffusion
, drift
, evolve
, expectation
, stdDeviation
, pdf
, discountBond
, factors
, initialValues
, fixingDates
, fixingTimes
, cashFlows
, index
, accrualTimes
, HasPhi(..)
, HasShortRate(..)
, HasAlpha(..)
, bFunction
, mFunction
, numeraire
, thetaAt
) where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.ForeignPtr as C2HSImp
import qualified Foreign.Marshal.Utils as C2HSImp
import qualified Foreign.Ptr as C2HSImp
import qualified System.IO.Unsafe as C2HSImp
import QuantLib.Internal
import QuantLib.Internal.Type
import Data.List.NonEmpty(NonEmpty, toList)
import Foreign.Ptr(FunPtr)
data ProcessDiscretization = EulerDiscretization
| EndEulerDiscretization
deriving (Int -> ProcessDiscretization -> ShowS
[ProcessDiscretization] -> ShowS
ProcessDiscretization -> String
(Int -> ProcessDiscretization -> ShowS)
-> (ProcessDiscretization -> String)
-> ([ProcessDiscretization] -> ShowS)
-> Show ProcessDiscretization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ProcessDiscretization -> ShowS
showsPrec :: Int -> ProcessDiscretization -> ShowS
$cshow :: ProcessDiscretization -> String
show :: ProcessDiscretization -> String
$cshowList :: [ProcessDiscretization] -> ShowS
showList :: [ProcessDiscretization] -> ShowS
Show,ProcessDiscretization -> ProcessDiscretization -> Bool
(ProcessDiscretization -> ProcessDiscretization -> Bool)
-> (ProcessDiscretization -> ProcessDiscretization -> Bool)
-> Eq ProcessDiscretization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ProcessDiscretization -> ProcessDiscretization -> Bool
== :: ProcessDiscretization -> ProcessDiscretization -> Bool
$c/= :: ProcessDiscretization -> ProcessDiscretization -> Bool
/= :: ProcessDiscretization -> ProcessDiscretization -> Bool
Eq,ReadPrec [ProcessDiscretization]
ReadPrec ProcessDiscretization
Int -> ReadS ProcessDiscretization
ReadS [ProcessDiscretization]
(Int -> ReadS ProcessDiscretization)
-> ReadS [ProcessDiscretization]
-> ReadPrec ProcessDiscretization
-> ReadPrec [ProcessDiscretization]
-> Read ProcessDiscretization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS ProcessDiscretization
readsPrec :: Int -> ReadS ProcessDiscretization
$creadList :: ReadS [ProcessDiscretization]
readList :: ReadS [ProcessDiscretization]
$creadPrec :: ReadPrec ProcessDiscretization
readPrec :: ReadPrec ProcessDiscretization
$creadListPrec :: ReadPrec [ProcessDiscretization]
readListPrec :: ReadPrec [ProcessDiscretization]
Read)
instance Enum ProcessDiscretization where
succ :: ProcessDiscretization -> ProcessDiscretization
succ ProcessDiscretization
EulerDiscretization = ProcessDiscretization
EndEulerDiscretization
succ ProcessDiscretization
EndEulerDiscretization = String -> ProcessDiscretization
forall a. HasCallStack => String -> a
error String
"ProcessDiscretization.succ: EndEulerDiscretization has no successor"
pred :: ProcessDiscretization -> ProcessDiscretization
pred ProcessDiscretization
EndEulerDiscretization = ProcessDiscretization
EulerDiscretization
pred ProcessDiscretization
EulerDiscretization = String -> ProcessDiscretization
forall a. HasCallStack => String -> a
error String
"ProcessDiscretization.pred: EulerDiscretization has no predecessor"
enumFromTo :: ProcessDiscretization
-> ProcessDiscretization -> [ProcessDiscretization]
enumFromTo ProcessDiscretization
from ProcessDiscretization
to = ProcessDiscretization -> [ProcessDiscretization]
forall {t}. Enum t => t -> [t]
go ProcessDiscretization
from
where
end :: Int
end = ProcessDiscretization -> Int
forall a. Enum a => a -> Int
fromEnum ProcessDiscretization
to
go :: t -> [t]
go t
v = case Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
compare (t -> Int
forall a. Enum a => a -> Int
fromEnum t
v) Int
end of
Ordering
LT -> t
v t -> [t] -> [t]
forall a. a -> [a] -> [a]
: t -> [t]
go (t -> t
forall a. Enum a => a -> a
succ t
v)
Ordering
EQ -> [t
v]
Ordering
GT -> []
enumFrom :: ProcessDiscretization -> [ProcessDiscretization]
enumFrom ProcessDiscretization
from = ProcessDiscretization
-> ProcessDiscretization -> [ProcessDiscretization]
forall a. Enum a => a -> a -> [a]
enumFromTo ProcessDiscretization
from ProcessDiscretization
EndEulerDiscretization
fromEnum :: ProcessDiscretization -> Int
fromEnum ProcessDiscretization
EulerDiscretization = Int
0
fromEnum ProcessDiscretization
EndEulerDiscretization = Int
1
toEnum :: Int -> ProcessDiscretization
toEnum Int
0 = ProcessDiscretization
EulerDiscretization
toEnum Int
1 = ProcessDiscretization
EndEulerDiscretization
toEnum Int
unmatched = String -> ProcessDiscretization
forall a. HasCallStack => String -> a
error (String
"ProcessDiscretization.toEnum: Cannot match " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
unmatched)
{-# LINE 120 "./QuantLib/Process.chs" #-}
data ExtendedBlackScholesMertonProcessDiscretization = ExtendedBSMEuler
| Milstein
| PredictorCorrector
deriving (Enum,Show,Eq,Read)
{-# LINE 121 "./QuantLib/Process.chs" #-}
data ExtendedOrnsteinUhlenbeckProcessDiscretization = MidPoint
| Trapezodial
| GaussLobatto
deriving (Enum,Show,Eq,Read)
{-# LINE 122 "./QuantLib/Process.chs" #-}
data HestonProcessDiscretization = HestonPartialTruncation
| HestonFullTruncation
| HestonReflection
| NonCentralChiSquareVariance
| QuadraticExponential
| QuadraticExponentialMartingale
| BroadieKayaExactSchemeLobatto
| BroadieKayaExactSchemeLaguerre
| BroadieKayaExactSchemeTrapezoidal
deriving (Enum,Show,Eq,Read)
{-# LINE 123 "./QuantLib/Process.chs" #-}
data GJRGARCHProcessDiscretization = GJRGARCHPartialTruncation
| GJRGARCHFullTruncation
| GJRGARCHReflection
deriving (Enum,Show,Eq,Read)
{-# LINE 124 "./QuantLib/Process.chs" #-}
data HybridHestonHullWhiteProcessDiscretization = HybridHestonHullWhiteEuler
| BSMHullWhite
deriving (Enum,Show,Eq,Read)
{-# LINE 125 "./QuantLib/Process.chs" #-}
{-# LINE 127 "./QuantLib/Process.chs" #-}
{-# LINE 128 "./QuantLib/Process.chs" #-}
{-# LINE 129 "./QuantLib/Process.chs" #-}
{-# LINE 130 "./QuantLib/Process.chs" #-}
{-# LINE 131 "./QuantLib/Process.chs" #-}
{-# LINE 132 "./QuantLib/Process.chs" #-}
{-# LINE 133 "./QuantLib/Process.chs" #-}
{-# LINE 134 "./QuantLib/Process.chs" #-}
{-# LINE 135 "./QuantLib/Process.chs" #-}
{-# LINE 136 "./QuantLib/Process.chs" #-}
{-# LINE 137 "./QuantLib/Process.chs" #-}
{-# LINE 138 "./QuantLib/Process.chs" #-}
{-# LINE 139 "./QuantLib/Process.chs" #-}
{-# LINE 140 "./QuantLib/Process.chs" #-}
{-# LINE 141 "./QuantLib/Process.chs" #-}
{-# LINE 142 "./QuantLib/Process.chs" #-}
{-# LINE 143 "./QuantLib/Process.chs" #-}
{-# LINE 144 "./QuantLib/Process.chs" #-}
{-# LINE 145 "./QuantLib/Process.chs" #-}
{-# LINE 146 "./QuantLib/Process.chs" #-}
{-# LINE 147 "./QuantLib/Process.chs" #-}
{-# LINE 148 "./QuantLib/Process.chs" #-}
{-# LINE 149 "./QuantLib/Process.chs" #-}
{-# LINE 150 "./QuantLib/Process.chs" #-}
{-# LINE 151 "./QuantLib/Process.chs" #-}
{-# LINE 152 "./QuantLib/Process.chs" #-}
blackProcess :: (GenQuote q)
-> (GenYieldTermStructure y)
-> (GenBlackVolTermStructure bv)
-> (ProcessDiscretization) -> (Bool)
-> IO ((BlackProcess))
blackProcess :: forall q y bv.
GenQuote q
-> GenYieldTermStructure y
-> GenBlackVolTermStructure bv
-> ProcessDiscretization
-> Bool
-> IO BlackProcess
blackProcess GenQuote q
a1 GenYieldTermStructure y
a2 GenBlackVolTermStructure bv
a3 ProcessDiscretization
a4 Bool
a5 =
GenQuote q -> (Ptr CQuote' -> IO BlackProcess) -> IO BlackProcess
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q
a1 ((Ptr CQuote' -> IO BlackProcess) -> IO BlackProcess)
-> (Ptr CQuote' -> IO BlackProcess) -> IO BlackProcess
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a1' ->
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO BlackProcess) -> IO BlackProcess
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y
a2 ((Ptr CYieldTermStructure' -> IO BlackProcess) -> IO BlackProcess)
-> (Ptr CYieldTermStructure' -> IO BlackProcess) -> IO BlackProcess
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a2' ->
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO BlackProcess)
-> IO BlackProcess
forall bv b.
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withBlackVolTermStructure GenBlackVolTermStructure bv
a3 ((Ptr CBlackVolTermStructure' -> IO BlackProcess)
-> IO BlackProcess)
-> (Ptr CBlackVolTermStructure' -> IO BlackProcess)
-> IO BlackProcess
forall a b. (a -> b) -> a -> b
$ \Ptr CBlackVolTermStructure'
a3' ->
let {a4' :: CInt
a4' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (ProcessDiscretization -> Int) -> ProcessDiscretization -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ProcessDiscretization -> Int
forall a. Enum a => a -> Int
fromEnum) ProcessDiscretization
a4} in
let {a5' :: CInt
a5' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a5} in
(Ptr (Ptr CChar) -> IO BlackProcess) -> IO BlackProcess
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO BlackProcess) -> IO BlackProcess)
-> (Ptr (Ptr CChar) -> IO BlackProcess) -> IO BlackProcess
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a6' ->
Ptr CQuote'
-> Ptr CYieldTermStructure'
-> Ptr CBlackVolTermStructure'
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CBlackProcess')
blackProcess'_ Ptr CQuote'
a1' Ptr CYieldTermStructure'
a2' Ptr CBlackVolTermStructure'
a3' CInt
a4' CInt
a5' Ptr (Ptr CChar)
a6' IO (Ptr CBlackProcess')
-> (Ptr CBlackProcess' -> IO BlackProcess) -> IO BlackProcess
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CBlackProcess'
res ->
Ptr CBlackProcess' -> IO BlackProcess
peekBlackProcess Ptr CBlackProcess'
res IO BlackProcess
-> (BlackProcess -> IO BlackProcess) -> IO BlackProcess
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \BlackProcess
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a6'IO () -> IO BlackProcess -> IO BlackProcess
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
BlackProcess -> IO BlackProcess
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (BlackProcess
res')
{-# LINE 160 "./QuantLib/Process.chs" #-}
blackScholesMertonProcess :: (GenQuote q)
-> (GenYieldTermStructure y1)
-> (GenYieldTermStructure y2)
-> (GenBlackVolTermStructure bv)
-> (ProcessDiscretization) -> (Bool)
-> IO ((GeneralizedBlackScholesProcess))
blackScholesMertonProcess a1 a2 a3 a4 a5 a6 =
withQuote a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
withYieldTermStructure a3 $ \a3' ->
withBlackVolTermStructure a4 $ \a4' ->
let {a5' = (fromIntegral . fromEnum) a5} in
let {a6' = C2HSImp.fromBool a6} in
preErrorCheck $ \a7' ->
blackScholesMertonProcess'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekGeneralizedBlackScholesProcess res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 170 "./QuantLib/Process.chs" #-}
blackScholesProcess :: (GenQuote q)
-> (GenYieldTermStructure y)
-> (GenBlackVolTermStructure bv)
-> (ProcessDiscretization) -> (Bool)
-> IO ((GeneralizedBlackScholesProcess))
blackScholesProcess a1 a2 a3 a4 a5 =
withQuote a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
withBlackVolTermStructure a3 $ \a3' ->
let {a4' = (fromIntegral . fromEnum) a4} in
let {a5' = C2HSImp.fromBool a5} in
preErrorCheck $ \a6' ->
blackScholesProcess'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekGeneralizedBlackScholesProcess res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 178 "./QuantLib/Process.chs" #-}
extendedBlackScholesMertonProcess :: (GenQuote q)
-> (GenYieldTermStructure y1)
-> (GenYieldTermStructure y2)
-> (GenBlackVolTermStructure bv)
-> (ProcessDiscretization) -> (ExtendedBlackScholesMertonProcessDiscretization) -> IO ((GeneralizedBlackScholesProcess))
extendedBlackScholesMertonProcess a1 a2 a3 a4 a5 a6 =
withQuote a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
withYieldTermStructure a3 $ \a3' ->
withBlackVolTermStructure a4 $ \a4' ->
let {a5' = (fromIntegral . fromEnum) a5} in
let {a6' = (fromIntegral . fromEnum) a6} in
preErrorCheck $ \a7' ->
extendedBlackScholesMertonProcess'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekGeneralizedBlackScholesProcess res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 186 "./QuantLib/Process.chs" #-}
garmanKohlhagenProcess :: (GenQuote q)
-> (GenYieldTermStructure y1)
-> (GenYieldTermStructure y2)
-> (GenBlackVolTermStructure bv)
-> (ProcessDiscretization) -> (Bool)
-> IO ((GeneralizedBlackScholesProcess))
garmanKohlhagenProcess a1 a2 a3 a4 a5 a6 =
withQuote a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
withYieldTermStructure a3 $ \a3' ->
withBlackVolTermStructure a4 $ \a4' ->
let {a5' = (fromIntegral . fromEnum) a5} in
let {a6' = C2HSImp.fromBool a6} in
preErrorCheck $ \a7' ->
garmanKohlhagenProcess'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekGeneralizedBlackScholesProcess res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 195 "./QuantLib/Process.chs" #-}
generalizedBlackScholesProcess :: (GenQuote q)
-> (GenYieldTermStructure y1)
-> (GenYieldTermStructure y2)
-> (GenBlackVolTermStructure bv)
-> (ProcessDiscretization) -> (Bool)
-> IO ((GeneralizedBlackScholesProcess))
generalizedBlackScholesProcess a1 a2 a3 a4 a5 a6 =
withQuote a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
withYieldTermStructure a3 $ \a3' ->
withBlackVolTermStructure a4 $ \a4' ->
let {a5' = (fromIntegral . fromEnum) a5} in
let {a6' = C2HSImp.fromBool a6} in
preErrorCheck $ \a7' ->
generalizedBlackScholesProcess'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekGeneralizedBlackScholesProcess res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 205 "./QuantLib/Process.chs" #-}
squareRootProcess :: (Double)
-> (Double)
-> (Double)
-> (Double)
-> (ProcessDiscretization) -> IO ((StochasticProcess1D))
squareRootProcess a1 a2 a3 a4 a5 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = (fromIntegral . fromEnum) a5} in
preErrorCheck $ \a6' ->
squareRootProcess'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekStochasticProcess1D res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 212 "./QuantLib/Process.chs" #-}
vegaStressedBlackScholesProcess :: (GenQuote q)
-> (GenYieldTermStructure y1)
-> (GenYieldTermStructure y2)
-> (GenBlackVolTermStructure bv)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (ProcessDiscretization) -> IO ((GeneralizedBlackScholesProcess))
vegaStressedBlackScholesProcess :: forall q y1 y2 bv.
GenQuote q
-> GenYieldTermStructure y1
-> GenYieldTermStructure y2
-> GenBlackVolTermStructure bv
-> Double
-> Double
-> Double
-> Double
-> Double
-> ProcessDiscretization
-> IO GeneralizedBlackScholesProcess
vegaStressedBlackScholesProcess GenQuote q
a1 GenYieldTermStructure y1
a2 GenYieldTermStructure y2
a3 GenBlackVolTermStructure bv
a4 Double
a5 Double
a6 Double
a7 Double
a8 Double
a9 ProcessDiscretization
a10 =
GenQuote q
-> (Ptr CQuote' -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q
a1 ((Ptr CQuote' -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess)
-> (Ptr CQuote' -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a1' ->
GenYieldTermStructure y1
-> (Ptr CYieldTermStructure' -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y1
a2 ((Ptr CYieldTermStructure' -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess)
-> (Ptr CYieldTermStructure' -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a2' ->
GenYieldTermStructure y2
-> (Ptr CYieldTermStructure' -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y2
a3 ((Ptr CYieldTermStructure' -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess)
-> (Ptr CYieldTermStructure' -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a3' ->
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure'
-> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall bv b.
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withBlackVolTermStructure GenBlackVolTermStructure bv
a4 ((Ptr CBlackVolTermStructure' -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess)
-> (Ptr CBlackVolTermStructure'
-> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall a b. (a -> b) -> a -> b
$ \Ptr CBlackVolTermStructure'
a4' ->
let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in
let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in
let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in
let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in
let {a9' :: CDouble
a9' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a9} in
let {a10' :: CInt
a10' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (ProcessDiscretization -> Int) -> ProcessDiscretization -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ProcessDiscretization -> Int
forall a. Enum a => a -> Int
fromEnum) ProcessDiscretization
a10} in
(Ptr (Ptr CChar) -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess)
-> (Ptr (Ptr CChar) -> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a11' ->
Ptr CQuote'
-> Ptr CYieldTermStructure'
-> Ptr CYieldTermStructure'
-> Ptr CBlackVolTermStructure'
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CGeneralizedBlackScholesProcess')
vegaStressedBlackScholesProcess'_ Ptr CQuote'
a1' Ptr CYieldTermStructure'
a2' Ptr CYieldTermStructure'
a3' Ptr CBlackVolTermStructure'
a4' CDouble
a5' CDouble
a6' CDouble
a7' CDouble
a8' CDouble
a9' CInt
a10' Ptr (Ptr CChar)
a11' IO (Ptr CGeneralizedBlackScholesProcess')
-> (Ptr CGeneralizedBlackScholesProcess'
-> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CGeneralizedBlackScholesProcess'
res ->
Ptr CGeneralizedBlackScholesProcess'
-> IO GeneralizedBlackScholesProcess
peekGeneralizedBlackScholesProcess Ptr CGeneralizedBlackScholesProcess'
res IO GeneralizedBlackScholesProcess
-> (GeneralizedBlackScholesProcess
-> IO GeneralizedBlackScholesProcess)
-> IO GeneralizedBlackScholesProcess
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \GeneralizedBlackScholesProcess
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a11'IO ()
-> IO GeneralizedBlackScholesProcess
-> IO GeneralizedBlackScholesProcess
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
GeneralizedBlackScholesProcess -> IO GeneralizedBlackScholesProcess
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (GeneralizedBlackScholesProcess
res')
{-# LINE 225 "./QuantLib/Process.chs" #-}
batesProcess :: (GenYieldTermStructure y1)
-> (GenYieldTermStructure y2)
-> (GenQuote q)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (HestonProcessDiscretization) -> IO ((BatesProcess))
batesProcess a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 =
withYieldTermStructure a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
withQuote a3 $ \a3' ->
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
let {a7' = realToFrac a7} in
let {a8' = realToFrac a8} in
let {a9' = realToFrac a9} in
let {a10' = realToFrac a10} in
let {a11' = realToFrac a11} in
let {a12' = (fromIntegral . fromEnum) a12} in
preErrorCheck $ \a13' ->
batesProcess'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' >>= \res ->
peekBatesProcess res >>= \res' ->
errorCheck a13'>>
return (res')
{-# LINE 240 "./QuantLib/Process.chs" #-}
qlExtendedOrnsteinUhlenbeckProcess :: (Double)
-> (Double)
-> (Double)
-> (FunPtr PayoffFun) -> (ExtendedOrnsteinUhlenbeckProcessDiscretization) -> (Double)
-> IO ((ExtendedOrnsteinUhlenbeckProcess))
qlExtendedOrnsteinUhlenbeckProcess a1 a2 a3 a4 a5 a6 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = id a4} in
let {a5' = (fromIntegral . fromEnum) a5} in
let {a6' = realToFrac a6} in
preErrorCheck $ \a7' ->
qlExtendedOrnsteinUhlenbeckProcess'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekExtendedOrnsteinUhlenbeckProcess res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 249 "./QuantLib/Process.chs" #-}
withExtendedOrnsteinUhlenbeckProcess :: Double
-> Double
-> Double
-> (Double -> Double)
-> ExtendedOrnsteinUhlenbeckProcessDiscretization
-> Double
-> (ExtendedOrnsteinUhlenbeckProcess -> IO a) -> IO a
withExtendedOrnsteinUhlenbeckProcess :: forall a.
Double
-> Double
-> Double
-> (Double -> Double)
-> ExtendedOrnsteinUhlenbeckProcessDiscretization
-> Double
-> (ExtendedOrnsteinUhlenbeckProcess -> IO a)
-> IO a
withExtendedOrnsteinUhlenbeckProcess Double
speed Double
sigma Double
x0 Double -> Double
b ExtendedOrnsteinUhlenbeckProcessDiscretization
d Double
intEps ExtendedOrnsteinUhlenbeckProcess -> IO a
k =
(Double -> Double) -> (FunPtr PayoffFun -> IO a) -> IO a
forall b. (Double -> Double) -> (FunPtr PayoffFun -> IO b) -> IO b
withPayoffFun Double -> Double
b (\FunPtr PayoffFun
fp -> Double
-> Double
-> Double
-> FunPtr PayoffFun
-> ExtendedOrnsteinUhlenbeckProcessDiscretization
-> Double
-> IO ExtendedOrnsteinUhlenbeckProcess
qlExtendedOrnsteinUhlenbeckProcess Double
speed Double
sigma Double
x0 FunPtr PayoffFun
fp ExtendedOrnsteinUhlenbeckProcessDiscretization
d Double
intEps IO ExtendedOrnsteinUhlenbeckProcess
-> (ExtendedOrnsteinUhlenbeckProcess -> IO a) -> IO a
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ExtendedOrnsteinUhlenbeckProcess -> IO a
k)
linearSeasonalOrnsteinUhlenbeckProcess :: (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (ExtendedOrnsteinUhlenbeckProcessDiscretization) -> (Double)
-> IO ((ExtendedOrnsteinUhlenbeckProcess))
linearSeasonalOrnsteinUhlenbeckProcess :: Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> ExtendedOrnsteinUhlenbeckProcessDiscretization
-> Double
-> IO ExtendedOrnsteinUhlenbeckProcess
linearSeasonalOrnsteinUhlenbeckProcess Double
a1 Double
a2 Double
a3 Double
a4 Double
a5 Double
a6 Double
a7 ExtendedOrnsteinUhlenbeckProcessDiscretization
a8 Double
a9 =
let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in
let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in
let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in
let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in
let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in
let {a8' :: CInt
a8' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (ExtendedOrnsteinUhlenbeckProcessDiscretization -> Int)
-> ExtendedOrnsteinUhlenbeckProcessDiscretization
-> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ExtendedOrnsteinUhlenbeckProcessDiscretization -> Int
forall a. Enum a => a -> Int
fromEnum) ExtendedOrnsteinUhlenbeckProcessDiscretization
a8} in
let {a9' :: CDouble
a9' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a9} in
(Ptr (Ptr CChar) -> IO ExtendedOrnsteinUhlenbeckProcess)
-> IO ExtendedOrnsteinUhlenbeckProcess
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO ExtendedOrnsteinUhlenbeckProcess)
-> IO ExtendedOrnsteinUhlenbeckProcess)
-> (Ptr (Ptr CChar) -> IO ExtendedOrnsteinUhlenbeckProcess)
-> IO ExtendedOrnsteinUhlenbeckProcess
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a10' ->
CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CInt
-> CDouble
-> Ptr (Ptr CChar)
-> IO (Ptr CExtendedOrnsteinUhlenbeckProcess')
linearSeasonalOrnsteinUhlenbeckProcess'_ CDouble
a1' CDouble
a2' CDouble
a3' CDouble
a4' CDouble
a5' CDouble
a6' CDouble
a7' CInt
a8' CDouble
a9' Ptr (Ptr CChar)
a10' IO (Ptr CExtendedOrnsteinUhlenbeckProcess')
-> (Ptr CExtendedOrnsteinUhlenbeckProcess'
-> IO ExtendedOrnsteinUhlenbeckProcess)
-> IO ExtendedOrnsteinUhlenbeckProcess
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CExtendedOrnsteinUhlenbeckProcess'
res ->
peekExtendedOrnsteinUhlenbeckProcess res >>= \res' ->
errorCheck a10'>>
return (res')
{-# LINE 278 "./QuantLib/Process.chs" #-}
extOuWithJumpsProcess :: (ExtendedOrnsteinUhlenbeckProcess) -> (Double)
-> (Double)
-> (Double)
-> (Double)
-> IO ((ExtOUWithJumpsProcess))
extOuWithJumpsProcess a1 a2 a3 a4 a5 =
withGenStochasticProcess1D a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
preErrorCheck $ \a6' ->
extOuWithJumpsProcess'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekExtOUWithJumpsProcess res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 287 "./QuantLib/Process.chs" #-}
g2ForwardProcess :: (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Maybe (GenYieldTermStructure y))
-> IO ((G2ForwardProcess))
g2ForwardProcess a1 a2 a3 a4 a5 a6 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
withMaybeYieldTermStructure a6 $ \a6' ->
preErrorCheck $ \a7' ->
g2ForwardProcess'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekG2ForwardProcess res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 297 "./QuantLib/Process.chs" #-}
g2Process :: (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Maybe (GenYieldTermStructure y))
-> IO ((G2Process))
g2Process a1 a2 a3 a4 a5 a6 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
withMaybeYieldTermStructure a6 $ \a6' ->
preErrorCheck $ \a7' ->
g2Process'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekG2Process res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 307 "./QuantLib/Process.chs" #-}
qlG2ProcessPhi :: (G2Process) -> (Double)
-> IO ((Double))
qlG2ProcessPhi a1 a2 =
withGenStochasticProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
qlG2ProcessPhi'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 312 "./QuantLib/Process.chs" #-}
qlG2ProcessShortRate :: (G2Process) -> (Double)
-> (Double)
-> (Double)
-> (Double)
qlG2ProcessShortRate a1 a2 a3 a4 =
C2HSImp.unsafePerformIO $
withGenStochasticProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
qlG2ProcessShortRate'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 319 "./QuantLib/Process.chs" #-}
qlG2ForwardProcessPhi :: (G2ForwardProcess) -> (Double)
-> IO ((Double))
qlG2ForwardProcessPhi a1 a2 =
withGenStochasticProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
qlG2ForwardProcessPhi'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 324 "./QuantLib/Process.chs" #-}
qlG2ForwardProcessShortRate :: (G2ForwardProcess) -> (Double)
-> (Double)
-> (Double)
-> (Double)
qlG2ForwardProcessShortRate a1 a2 a3 a4 =
C2HSImp.unsafePerformIO $
withGenStochasticProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
qlG2ForwardProcessShortRate'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 331 "./QuantLib/Process.chs" #-}
class HasPhi a where
phi :: a -> Double -> IO Double
instance HasPhi G2Process where
phi = qlG2ProcessPhi
instance HasPhi G2ForwardProcess where
phi = qlG2ForwardProcessPhi
class HasShortRate a where
shortRate :: a -> Double -> Double -> Double -> Double
instance HasShortRate G2Process where
shortRate :: G2Process -> Double -> Double -> Double -> Double
shortRate = G2Process -> Double -> Double -> Double -> Double
qlG2ProcessShortRate
instance HasShortRate G2ForwardProcess where
shortRate :: G2ForwardProcess -> Double -> Double -> Double -> Double
shortRate = G2ForwardProcess -> Double -> Double -> Double -> Double
qlG2ForwardProcessShortRate
class HasForwardMeasureTime a where
setForwardMeasureTime :: a -> Double -> IO ()
instance HasForwardMeasureTime HullWhiteForwardProcess where
setForwardMeasureTime :: HullWhiteForwardProcess -> Double -> IO ()
setForwardMeasureTime = HullWhiteForwardProcess -> Double -> IO ()
qlHullWhiteForwardProcessSetForwardMeasureTime
instance HasForwardMeasureTime G2ForwardProcess where
setForwardMeasureTime :: G2ForwardProcess -> Double -> IO ()
setForwardMeasureTime = G2ForwardProcess -> Double -> IO ()
qlG2ForwardProcessSetForwardMeasureTime
class HasAlpha a where
alpha :: a -> Double -> IO Double
instance HasAlpha HullWhiteProcess where
alpha :: HullWhiteProcess -> Double -> IO Double
alpha = HullWhiteProcess -> Double -> IO Double
qlHullWhiteProcessAlpha
instance HasAlpha HullWhiteForwardProcess where
alpha :: HullWhiteForwardProcess -> Double -> IO Double
alpha = HullWhiteForwardProcess -> Double -> IO Double
qlHullWhiteForwardProcessAlpha
factors :: (GenStochasticProcess p) -> IO ((Word))
factors :: forall p. GenStochasticProcess p -> IO Word
factors GenStochasticProcess p
a1 =
GenStochasticProcess p
-> (Ptr CStochasticProcess' -> IO Word) -> IO Word
forall p b.
GenStochasticProcess p -> (Ptr CStochasticProcess' -> IO b) -> IO b
withStochasticProcess GenStochasticProcess p
a1 ((Ptr CStochasticProcess' -> IO Word) -> IO Word)
-> (Ptr CStochasticProcess' -> IO Word) -> IO Word
forall a b. (a -> b) -> a -> b
$ \Ptr CStochasticProcess'
a1' ->
(Ptr (Ptr CChar) -> IO Word) -> IO Word
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Word) -> IO Word)
-> (Ptr (Ptr CChar) -> IO Word) -> IO Word
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a2' ->
Ptr CStochasticProcess' -> Ptr (Ptr CChar) -> IO CUInt
factors'_ Ptr CStochasticProcess'
a1' Ptr (Ptr CChar)
a2' IO CUInt -> (CUInt -> IO Word) -> IO Word
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CUInt
res ->
let {res' :: Word
res' = CUInt -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
res} in
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a2'IO () -> IO Word -> IO Word
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Word -> IO Word
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Word
res')
{-# LINE 368 "./QuantLib/Process.chs" #-}
initialValues :: (GenStochasticProcess p) -> IO (([Double]))
initialValues a1 =
withStochasticProcess a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
initialValues'_ a1' a2'1 a2'2 a3' >>
peekDoubleArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 372 "./QuantLib/Process.chs" #-}
drift :: (GenStochasticProcess p) -> (Double)
-> ([Double])
-> IO (([Double]))
drift a1 a2 a3 =
withStochasticProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
withDoubleArray a3 $ \(a3'1, a3'2) ->
preArray $ \(a4'1, a4'2) ->
preErrorCheck $ \a5' ->
drift'_ a1' a2' a3'1 a3'2 a4'1 a4'2 a5' >>
peekDoubleArray a4'1 a4'2>>= \a4'' ->
errorCheck a5'>>
return (a4'')
{-# LINE 380 "./QuantLib/Process.chs" #-}
toMatrixDouble :: (Word, Word, [Double]) -> Matrix Double
toMatrixDouble (r, c, d) = Matrix r c d
diffusion :: GenStochasticProcess p -> Double -> [Double] -> IO (Matrix Double)
diffusion p t x = toMatrixDouble <$> qlStochasticProcessDiffusion p t x
qlStochasticProcessDiffusion :: (GenStochasticProcess p) -> (Double)
-> ([Double])
-> IO ((Word), (Word), ([Double]))
qlStochasticProcessDiffusion :: forall p.
GenStochasticProcess p
-> Double -> [Double] -> IO (Word, Word, [Double])
qlStochasticProcessDiffusion GenStochasticProcess p
a1 Double
a2 [Double]
a3 =
GenStochasticProcess p
-> (Ptr CStochasticProcess' -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall p b.
GenStochasticProcess p -> (Ptr CStochasticProcess' -> IO b) -> IO b
withStochasticProcess GenStochasticProcess p
a1 ((Ptr CStochasticProcess' -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> (Ptr CStochasticProcess' -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr CStochasticProcess'
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
[Double]
-> ((CUInt, Ptr CDouble) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a3 (((CUInt, Ptr CDouble) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> ((CUInt, Ptr CDouble) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CDouble
a3'2) ->
(Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. Storable a => (Ptr a -> IO b) -> IO b
prePtr ((Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> (Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr CUInt
a4' ->
(Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. Storable a => (Ptr a -> IO b) -> IO b
prePtr ((Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> (Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr CUInt
a5' ->
((Ptr CUInt, Ptr (Ptr CDouble)) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. ((Ptr CUInt, Ptr (Ptr a)) -> IO b) -> IO b
preArray (((Ptr CUInt, Ptr (Ptr CDouble)) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a6'1, Ptr (Ptr CDouble)
a6'2) ->
(Ptr (Ptr CChar) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> (Ptr (Ptr CChar) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a7' ->
Ptr CStochasticProcess'
-> CDouble
-> CUInt
-> Ptr CDouble
-> Ptr CUInt
-> Ptr CUInt
-> Ptr CUInt
-> Ptr (Ptr CDouble)
-> Ptr (Ptr CChar)
-> IO ()
qlStochasticProcessDiffusion'_ Ptr CStochasticProcess'
a1' CDouble
a2' CUInt
a3'1 Ptr CDouble
a3'2 Ptr CUInt
a4' Ptr CUInt
a5' Ptr CUInt
a6'1 Ptr (Ptr CDouble)
a6'2 Ptr (Ptr CChar)
a7' IO () -> IO Word -> IO Word
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Ptr CUInt -> IO Word
peekWord Ptr CUInt
a4'IO Word
-> (Word -> IO (Word, Word, [Double])) -> IO (Word, Word, [Double])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Word
a4'' ->
Ptr CUInt -> IO Word
peekWord Ptr CUInt
a5'IO Word
-> (Word -> IO (Word, Word, [Double])) -> IO (Word, Word, [Double])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Word
a5'' ->
Ptr CUInt -> Ptr (Ptr CDouble) -> IO [Double]
peekDoubleArray Ptr CUInt
a6'1 Ptr (Ptr CDouble)
a6'2IO [Double]
-> ([Double] -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \[Double]
a6'' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a7'IO () -> IO (Word, Word, [Double]) -> IO (Word, Word, [Double])
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
(Word, Word, [Double]) -> IO (Word, Word, [Double])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Word
a4'', Word
a5'', [Double]
a6'')
{-# LINE 393 "./QuantLib/Process.chs" #-}
expectation :: (GenStochasticProcess p) -> (Double)
-> ([Double])
-> (Double)
-> IO (([Double]))
expectation a1 a2 a3 a4 =
withStochasticProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
withDoubleArray a3 $ \(a3'1, a3'2) ->
let {a4' = realToFrac a4} in
preArray $ \(a5'1, a5'2) ->
preErrorCheck $ \a6' ->
expectation'_ a1' a2' a3'1 a3'2 a4' a5'1 a5'2 a6' >>
peekDoubleArray a5'1 a5'2>>= \a5'' ->
errorCheck a6'>>
return (a5'')
{-# LINE 401 "./QuantLib/Process.chs" #-}
stdDeviation :: GenStochasticProcess p -> Double -> [Double] -> Double -> IO (Matrix Double)
stdDeviation p t0 x0 dt = toMatrixDouble <$> qlStochasticProcessStdDeviation p t0 x0 dt
qlStochasticProcessStdDeviation :: (GenStochasticProcess p) -> (Double)
-> ([Double])
-> (Double)
-> IO ((Word), (Word), ([Double]))
qlStochasticProcessStdDeviation :: forall p.
GenStochasticProcess p
-> Double -> [Double] -> Double -> IO (Word, Word, [Double])
qlStochasticProcessStdDeviation GenStochasticProcess p
a1 Double
a2 [Double]
a3 Double
a4 =
GenStochasticProcess p
-> (Ptr CStochasticProcess' -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall p b.
GenStochasticProcess p -> (Ptr CStochasticProcess' -> IO b) -> IO b
withStochasticProcess GenStochasticProcess p
a1 ((Ptr CStochasticProcess' -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> (Ptr CStochasticProcess' -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr CStochasticProcess'
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
[Double]
-> ((CUInt, Ptr CDouble) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a3 (((CUInt, Ptr CDouble) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> ((CUInt, Ptr CDouble) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CDouble
a3'2) ->
let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in
(Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. Storable a => (Ptr a -> IO b) -> IO b
prePtr ((Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> (Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr CUInt
a5' ->
(Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. Storable a => (Ptr a -> IO b) -> IO b
prePtr ((Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> (Ptr CUInt -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr CUInt
a6' ->
((Ptr CUInt, Ptr (Ptr CDouble)) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. ((Ptr CUInt, Ptr (Ptr a)) -> IO b) -> IO b
preArray (((Ptr CUInt, Ptr (Ptr CDouble)) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a7'1, Ptr (Ptr CDouble)
a7'2) ->
(Ptr (Ptr CChar) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> (Ptr (Ptr CChar) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a8' ->
Ptr CStochasticProcess'
-> CDouble
-> CUInt
-> Ptr CDouble
-> CDouble
-> Ptr CUInt
-> Ptr CUInt
-> Ptr CUInt
-> Ptr (Ptr CDouble)
-> Ptr (Ptr CChar)
-> IO ()
qlStochasticProcessStdDeviation'_ Ptr CStochasticProcess'
a1' CDouble
a2' CUInt
a3'1 Ptr CDouble
a3'2 CDouble
a4' Ptr CUInt
a5' Ptr CUInt
a6' Ptr CUInt
a7'1 Ptr (Ptr CDouble)
a7'2 Ptr (Ptr CChar)
a8' IO () -> IO Word -> IO Word
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Ptr CUInt -> IO Word
peekWord Ptr CUInt
a5'IO Word
-> (Word -> IO (Word, Word, [Double])) -> IO (Word, Word, [Double])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Word
a5'' ->
Ptr CUInt -> IO Word
peekWord Ptr CUInt
a6'IO Word
-> (Word -> IO (Word, Word, [Double])) -> IO (Word, Word, [Double])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Word
a6'' ->
Ptr CUInt -> Ptr (Ptr CDouble) -> IO [Double]
peekDoubleArray Ptr CUInt
a7'1 Ptr (Ptr CDouble)
a7'2IO [Double]
-> ([Double] -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \[Double]
a7'' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a8'IO () -> IO (Word, Word, [Double]) -> IO (Word, Word, [Double])
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
(Word, Word, [Double]) -> IO (Word, Word, [Double])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Word
a5'', Word
a6'', [Double]
a7'')
{-# LINE 414 "./QuantLib/Process.chs" #-}
covariance :: GenStochasticProcess p -> Double -> [Double] -> Double -> IO (Matrix Double)
covariance p t0 x0 dt = toMatrixDouble <$> qlStochasticProcessCovariance p t0 x0 dt
qlStochasticProcessCovariance :: (GenStochasticProcess p) -> (Double)
-> ([Double])
-> (Double)
-> IO ((Word), (Word), ([Double]))
qlStochasticProcessCovariance a1 a2 a3 a4 =
withStochasticProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
withDoubleArray a3 $ \(a3'1, a3'2) ->
let {a4' = realToFrac a4} in
prePtr $ \a5' ->
prePtr $ \a6' ->
preArray $ \(a7'1, a7'2) ->
preErrorCheck $ \a8' ->
qlStochasticProcessCovariance'_ a1' a2' a3'1 a3'2 a4' a5' a6' a7'1 a7'2 a8' >>
peekWord a5'>>= \a5'' ->
peekWord a6'>>= \a6'' ->
peekDoubleArray a7'1 a7'2>>= \a7'' ->
errorCheck a8'>>
return (a5'', a6'', a7'')
{-# LINE 425 "./QuantLib/Process.chs" #-}
apply :: (GenStochasticProcess p) -> ([Double])
-> ([Double])
-> IO (([Double]))
apply a1 a2 a3 =
withStochasticProcess a1 $ \a1' ->
withDoubleArray a2 $ \(a2'1, a2'2) ->
withDoubleArray a3 $ \(a3'1, a3'2) ->
preArray $ \(a4'1, a4'2) ->
preErrorCheck $ \a5' ->
apply'_ a1' a2'1 a2'2 a3'1 a3'2 a4'1 a4'2 a5' >>
peekDoubleArray a4'1 a4'2>>= \a4'' ->
errorCheck a5'>>
return (a4'')
{-# LINE 434 "./QuantLib/Process.chs" #-}
evolve :: (GenStochasticProcess p) -> (Double)
-> ([Double])
-> (Double)
-> ([Double])
-> IO (([Double]))
evolve :: forall p.
GenStochasticProcess p
-> Double -> [Double] -> Double -> [Double] -> IO [Double]
evolve GenStochasticProcess p
a1 Double
a2 [Double]
a3 Double
a4 [Double]
a5 =
GenStochasticProcess p
-> (Ptr CStochasticProcess' -> IO [Double]) -> IO [Double]
forall p b.
GenStochasticProcess p -> (Ptr CStochasticProcess' -> IO b) -> IO b
withStochasticProcess GenStochasticProcess p
a1 ((Ptr CStochasticProcess' -> IO [Double]) -> IO [Double])
-> (Ptr CStochasticProcess' -> IO [Double]) -> IO [Double]
forall a b. (a -> b) -> a -> b
$ \Ptr CStochasticProcess'
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
[Double] -> ((CUInt, Ptr CDouble) -> IO [Double]) -> IO [Double]
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a3 (((CUInt, Ptr CDouble) -> IO [Double]) -> IO [Double])
-> ((CUInt, Ptr CDouble) -> IO [Double]) -> IO [Double]
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CDouble
a3'2) ->
let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in
[Double] -> ((CUInt, Ptr CDouble) -> IO [Double]) -> IO [Double]
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a5 (((CUInt, Ptr CDouble) -> IO [Double]) -> IO [Double])
-> ((CUInt, Ptr CDouble) -> IO [Double]) -> IO [Double]
forall a b. (a -> b) -> a -> b
$ \(CUInt
a5'1, Ptr CDouble
a5'2) ->
((Ptr CUInt, Ptr (Ptr CDouble)) -> IO [Double]) -> IO [Double]
forall a b. ((Ptr CUInt, Ptr (Ptr a)) -> IO b) -> IO b
preArray (((Ptr CUInt, Ptr (Ptr CDouble)) -> IO [Double]) -> IO [Double])
-> ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO [Double]) -> IO [Double]
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a6'1, Ptr (Ptr CDouble)
a6'2) ->
(Ptr (Ptr CChar) -> IO [Double]) -> IO [Double]
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO [Double]) -> IO [Double])
-> (Ptr (Ptr CChar) -> IO [Double]) -> IO [Double]
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a7' ->
Ptr CStochasticProcess'
-> CDouble
-> CUInt
-> Ptr CDouble
-> CDouble
-> CUInt
-> Ptr CDouble
-> Ptr CUInt
-> Ptr (Ptr CDouble)
-> Ptr (Ptr CChar)
-> IO ()
evolve'_ Ptr CStochasticProcess'
a1' CDouble
a2' CUInt
a3'1 Ptr CDouble
a3'2 CDouble
a4' CUInt
a5'1 Ptr CDouble
a5'2 Ptr CUInt
a6'1 Ptr (Ptr CDouble)
a6'2 Ptr (Ptr CChar)
a7' IO () -> IO [Double] -> IO [Double]
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Ptr CUInt -> Ptr (Ptr CDouble) -> IO [Double]
peekDoubleArray Ptr CUInt
a6'1 Ptr (Ptr CDouble)
a6'2IO [Double] -> ([Double] -> IO [Double]) -> IO [Double]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \[Double]
a6'' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a7'IO () -> IO [Double] -> IO [Double]
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
[Double] -> IO [Double]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ([Double]
a6'')
{-# LINE 450 "./QuantLib/Process.chs" #-}
gemanRoncoroniProcess :: (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> IO ((StochasticProcess1D))
gemanRoncoroniProcess :: Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> IO StochasticProcess1D
gemanRoncoroniProcess Double
a1 Double
a2 Double
a3 Double
a4 Double
a5 Double
a6 Double
a7 Double
a8 Double
a9 Double
a10 Double
a11 Double
a12 Double
a13 Double
a14 Double
a15 Double
a16 Double
a17 =
let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in
let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in
let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in
let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in
let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in
let {a2' :: CDouble
a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8 :: Double
a2 :: Double
a8} in
let {a3' :: CDouble
a9' :: CDouble
a9' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a9 :: Double
a3 :: Double
a9} in
let {a10' = realToFrac a10} in
let {a11' = realToFrac a11} in
let {a12' = realToFrac a12} in
let {a13' = realToFrac a13} in
let {a14' = realToFrac a14} in
let {a15' = realToFrac a15} in
let {a16' = realToFrac a16} in
let {a17' = realToFrac a17} in
preErrorCheck $ \a18' ->
gemanRoncoroniProcess'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' a16' a17' a18' >>= \res ->
peekStochasticProcess1D res >>= \res' ->
errorCheck a18'>>
return (res')
{-# LINE 471 "./QuantLib/Process.chs" #-}
geometricBrownianMotionProcess :: (Double)
-> (Double)
-> (Double)
-> IO ((StochasticProcess1D))
geometricBrownianMotionProcess a1 a2 a3 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
preErrorCheck $ \a4' ->
geometricBrownianMotionProcess'_ a1' a2' a3' a4' >>= \res ->
peekStochasticProcess1D res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 477 "./QuantLib/Process.chs" #-}
gjrGarchProcess :: (GenYieldTermStructure y1)
-> (GenYieldTermStructure y2)
-> (GenQuote q)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (GJRGARCHProcessDiscretization) -> IO ((GJRGARCHProcess))
gjrGarchProcess a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
withYieldTermStructure a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
withQuote a3 $ \a3' ->
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
let {a7' = realToFrac a7} in
let {a8' = realToFrac a8} in
let {a9' = realToFrac a9} in
let {a10' = realToFrac a10} in
let {a11' = (fromIntegral . fromEnum) a11} in
preErrorCheck $ \a12' ->
gjrGarchProcess'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
peekGJRGARCHProcess res >>= \res' ->
errorCheck a12'>>
return (res')
{-# LINE 491 "./QuantLib/Process.chs" #-}
hestonProcess :: (GenYieldTermStructure y1)
-> (Maybe (GenYieldTermStructure y2))
-> (GenQuote q)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (HestonProcessDiscretization) -> IO ((HestonProcess))
hestonProcess a1 a2 a3 a4 a5 a6 a7 a8 a9 =
withYieldTermStructure a1 $ \a1' ->
withMaybeYieldTermStructure a2 $ \a2' ->
withQuote a3 $ \a3' ->
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
let {a7' = realToFrac a7} in
let {a8' = realToFrac a8} in
let {a9' = (fromIntegral . fromEnum) a9} in
preErrorCheck $ \a10' ->
hestonProcess'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' >>= \res ->
peekHestonProcess res >>= \res' ->
errorCheck a10'>>
return (res')
{-# LINE 504 "./QuantLib/Process.chs" #-}
pdf :: (GenHestonProcess hp)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> IO ((Double))
pdf a1 a2 a3 a4 a5 =
withHestonProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
preErrorCheck $ \a6' ->
pdf'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = realToFrac res} in
errorCheck a6'>>
return (res')
{-# LINE 514 "./QuantLib/Process.chs" #-}
hestonSlvProcess :: (GenHestonProcess hp)
-> (GenLocalVolTermStructure lv)
-> (Double)
-> IO ((HestonSLVProcess))
hestonSlvProcess a1 a2 a3 =
withHestonProcess a1 $ \a1' ->
withGenLocalVolTermStructure a2 $ \a2' ->
let {a3' = realToFrac a3} in
preErrorCheck $ \a4' ->
hestonSlvProcess'_ a1' a2' a3' a4' >>= \res ->
peekHestonSLVProcess res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 522 "./QuantLib/Process.chs" #-}
hullWhiteForwardProcess :: (GenYieldTermStructure y)
-> (Double)
-> (Double)
-> IO ((HullWhiteForwardProcess))
hullWhiteForwardProcess a1 a2 a3 =
withYieldTermStructure a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
preErrorCheck $ \a4' ->
hullWhiteForwardProcess'_ a1' a2' a3' a4' >>= \res ->
peekHullWhiteForwardProcess res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 528 "./QuantLib/Process.chs" #-}
qlHullWhiteForwardProcessSetForwardMeasureTime :: (HullWhiteForwardProcess) -> (Double)
-> IO ()
qlHullWhiteForwardProcessSetForwardMeasureTime a1 a2 =
withGenStochasticProcess1D a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
qlHullWhiteForwardProcessSetForwardMeasureTime'_ a1' a2' a3' >>
errorCheck a3'>>
return ()
{-# LINE 536 "./QuantLib/Process.chs" #-}
qlG2ForwardProcessSetForwardMeasureTime :: (G2ForwardProcess) -> (Double)
-> IO ()
qlG2ForwardProcessSetForwardMeasureTime :: G2ForwardProcess -> Double -> IO ()
qlG2ForwardProcessSetForwardMeasureTime G2ForwardProcess
a1 Double
a2 =
G2ForwardProcess -> (Ptr CG2ForwardProcess' -> IO ()) -> IO ()
forall p b.
GenStochasticProcess (ForeignPtr p) -> (Ptr p -> IO b) -> IO b
withGenStochasticProcess G2ForwardProcess
a1 ((Ptr CG2ForwardProcess' -> IO ()) -> IO ())
-> (Ptr CG2ForwardProcess' -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr CG2ForwardProcess'
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
(Ptr (Ptr CChar) -> IO ()) -> IO ()
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO ()) -> IO ())
-> (Ptr (Ptr CChar) -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a3' ->
Ptr CG2ForwardProcess' -> CDouble -> Ptr (Ptr CChar) -> IO ()
qlG2ForwardProcessSetForwardMeasureTime'_ Ptr CG2ForwardProcess'
a1' CDouble
a2' Ptr (Ptr CChar)
a3' IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a3'IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
{-# LINE 547 "./QuantLib/Process.chs" #-}
qlHullWhiteProcessAlpha :: (HullWhiteProcess) -> (Double)
-> IO ((Double))
qlHullWhiteProcessAlpha a1 a2 =
withGenStochasticProcess1D a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
qlHullWhiteProcessAlpha'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 553 "./QuantLib/Process.chs" #-}
qlHullWhiteForwardProcessAlpha :: (HullWhiteForwardProcess) -> (Double)
-> IO ((Double))
qlHullWhiteForwardProcessAlpha a1 a2 =
withGenStochasticProcess1D a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
qlHullWhiteForwardProcessAlpha'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 557 "./QuantLib/Process.chs" #-}
bFunction :: (HullWhiteForwardProcess) -> (Double)
-> (Double)
-> IO ((Double))
bFunction a1 a2 a3 =
withGenStochasticProcess1D a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
preErrorCheck $ \a4' ->
bFunction'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 563 "./QuantLib/Process.chs" #-}
mFunction :: (HullWhiteForwardProcess) -> (Double)
-> (Double)
-> (Double)
-> IO ((Double))
mFunction a1 a2 a3 a4 =
withGenStochasticProcess1D a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
preErrorCheck $ \a5' ->
mFunction'_ a1' a2' a3' a4' a5' >>= \res ->
let {res' = realToFrac res} in
errorCheck a5'>>
return (res')
{-# LINE 570 "./QuantLib/Process.chs" #-}
numeraire :: (HybridHestonHullWhiteProcess) -> (Double)
-> ([Double])
-> IO ((Double))
numeraire :: HybridHestonHullWhiteProcess -> Double -> [Double] -> IO Double
numeraire HybridHestonHullWhiteProcess
a1 Double
a2 [Double]
a3 =
HybridHestonHullWhiteProcess
-> (Ptr CHybridHestonHullWhiteProcess' -> IO Double) -> IO Double
forall p b.
GenStochasticProcess (ForeignPtr p) -> (Ptr p -> IO b) -> IO b
withGenStochasticProcess HybridHestonHullWhiteProcess
a1 ((Ptr CHybridHestonHullWhiteProcess' -> IO Double) -> IO Double)
-> (Ptr CHybridHestonHullWhiteProcess' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CHybridHestonHullWhiteProcess'
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
[Double] -> ((CUInt, Ptr CDouble) -> IO Double) -> IO Double
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a3 (((CUInt, Ptr CDouble) -> IO Double) -> IO Double)
-> ((CUInt, Ptr CDouble) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CDouble
a3'2) ->
(Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' ->
Ptr CHybridHestonHullWhiteProcess'
-> CDouble -> CUInt -> Ptr CDouble -> Ptr (Ptr CChar) -> IO CDouble
numeraire'_ Ptr CHybridHestonHullWhiteProcess'
a1' CDouble
a2' CUInt
a3'1 Ptr CDouble
a3'2 Ptr (Ptr CChar)
a4' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a4'IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')
{-# LINE 587 "./QuantLib/Process.chs" #-}
hullWhiteProcess :: (GenYieldTermStructure y)
-> (Double)
-> (Double)
-> IO ((HullWhiteProcess))
hullWhiteProcess a1 a2 a3 =
withYieldTermStructure a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
preErrorCheck $ \a4' ->
hullWhiteProcess'_ a1' a2' a3' a4' >>= \res ->
peekHullWhiteProcess res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 593 "./QuantLib/Process.chs" #-}
hybridHestonHullWhiteProcess :: (GenHestonProcess hp) -> (HullWhiteForwardProcess) -> (Double)
-> (HybridHestonHullWhiteProcessDiscretization) -> IO ((HybridHestonHullWhiteProcess))
hybridHestonHullWhiteProcess a1 a2 a3 a4 =
withHestonProcess a1 $ \a1' ->
withGenStochasticProcess1D a2 $ \a2' ->
let {a3' = realToFrac a3} in
let {a4' = (fromIntegral . fromEnum) a4} in
preErrorCheck $ \a5' ->
hybridHestonHullWhiteProcess'_ a1' a2' a3' a4' a5' >>= \res ->
peekHybridHestonHullWhiteProcess res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 599 "./QuantLib/Process.chs" #-}
klugeExtOuProcess :: (Double)
-> (ExtOUWithJumpsProcess) -> (ExtendedOrnsteinUhlenbeckProcess) -> IO ((KlugeExtOUProcess))
klugeExtOuProcess a1 a2 a3 =
let {a1' = realToFrac a1} in
withGenStochasticProcess a2 $ \a2' ->
withGenStochasticProcess1D a3 $ \a3' ->
preErrorCheck $ \a4' ->
klugeExtOuProcess'_ a1' a2' a3' a4' >>= \res ->
peekKlugeExtOUProcess res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 604 "./QuantLib/Process.chs" #-}
liborForwardModelProcess :: (Word)
-> (GenIborIndex ibor) -> IO ((LiborForwardModelProcess))
liborForwardModelProcess a1 a2 =
let {a1' = fromIntegral a1} in
withIborIndex a2 $ \a2' ->
preErrorCheck $ \a3' ->
liborForwardModelProcess'_ a1' a2' a3' >>= \res ->
peekLiborForwardModelProcess res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 609 "./QuantLib/Process.chs" #-}
fixingDates :: (LiborForwardModelProcess) -> IO (([Day]))
fixingDates a1 =
withGenStochasticProcess a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
fixingDates'_ a1' a2'1 a2'2 a3' >>
peekDayArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 613 "./QuantLib/Process.chs" #-}
fixingTimes :: (LiborForwardModelProcess) -> IO (([Double]))
fixingTimes a1 =
withGenStochasticProcess a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
fixingTimes'_ a1' a2'1 a2'2 a3' >>
peekDoubleArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 618 "./QuantLib/Process.chs" #-}
cashFlows :: (LiborForwardModelProcess) -> (Double)
-> IO ((Leg))
cashFlows a1 a2 =
withGenStochasticProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
cashFlows'_ a1' a2' a3' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 624 "./QuantLib/Process.chs" #-}
index :: (LiborForwardModelProcess) -> IO ((IborIndex))
index a1 =
withGenStochasticProcess a1 $ \a1' ->
preErrorCheck $ \a2' ->
index'_ a1' a2' >>= \res ->
peekIborIndex res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 628 "./QuantLib/Process.chs" #-}
discountBond :: (LiborForwardModelProcess) -> ([Double])
-> IO (([Double]))
discountBond a1 a2 =
withGenStochasticProcess a1 $ \a1' ->
withDoubleArray a2 $ \(a2'1, a2'2) ->
preArray $ \(a3'1, a3'2) ->
preErrorCheck $ \a4' ->
discountBond'_ a1' a2'1 a2'2 a3'1 a3'2 a4' >>
peekDoubleArray a3'1 a3'2>>= \a3'' ->
errorCheck a4'>>
return (a3'')
{-# LINE 637 "./QuantLib/Process.chs" #-}
accrualTimes :: LiborForwardModelProcess -> IO [(Double, Double)]
accrualTimes p = uncurry zip <$> qlLiborForwardModelProcessAccrualTimes p
qlLiborForwardModelProcessAccrualTimes :: (LiborForwardModelProcess) -> IO (([Double]), ([Double]))
qlLiborForwardModelProcessAccrualTimes a1 =
withGenStochasticProcess a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preArray $ \(a3'1, a3'2) ->
preErrorCheck $ \a4' ->
qlLiborForwardModelProcessAccrualTimes'_ a1' a2'1 a2'2 a3'1 a3'2 a4' >>
peekDoubleArray a2'1 a2'2>>= \a2'' ->
peekDoubleArray a3'1 a3'2>>= \a3'' ->
errorCheck a4'>>
return (a2'', a3'')
{-# LINE 647 "./QuantLib/Process.chs" #-}
merton76Process :: (GenQuote q1)
-> (GenYieldTermStructure y1)
-> (GenYieldTermStructure y2)
-> (GenBlackVolTermStructure bv)
-> (GenQuote q2)
-> (GenQuote q3)
-> (GenQuote q4)
-> (ProcessDiscretization) -> IO ((Merton76Process))
merton76Process :: forall q1 y1 y2 bv q2 q3 q4.
GenQuote q1
-> GenYieldTermStructure y1
-> GenYieldTermStructure y2
-> GenBlackVolTermStructure bv
-> GenQuote q2
-> GenQuote q3
-> GenQuote q4
-> ProcessDiscretization
-> IO Merton76Process
merton76Process GenQuote q1
a1 GenYieldTermStructure y1
a2 GenYieldTermStructure y2
a3 GenBlackVolTermStructure bv
a4 GenQuote q2
a5 GenQuote q3
a6 GenQuote q4
a7 ProcessDiscretization
a8 =
GenQuote q1
-> (Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q1
a1 ((Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process)
-> (Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a1' ->
GenYieldTermStructure y1
-> (Ptr CYieldTermStructure' -> IO Merton76Process)
-> IO Merton76Process
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y1
a2 ((Ptr CYieldTermStructure' -> IO Merton76Process)
-> IO Merton76Process)
-> (Ptr CYieldTermStructure' -> IO Merton76Process)
-> IO Merton76Process
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a2' ->
GenYieldTermStructure y2
-> (Ptr CYieldTermStructure' -> IO Merton76Process)
-> IO Merton76Process
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y2
a3 ((Ptr CYieldTermStructure' -> IO Merton76Process)
-> IO Merton76Process)
-> (Ptr CYieldTermStructure' -> IO Merton76Process)
-> IO Merton76Process
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a3' ->
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO Merton76Process)
-> IO Merton76Process
forall bv b.
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withBlackVolTermStructure GenBlackVolTermStructure bv
a4 ((Ptr CBlackVolTermStructure' -> IO Merton76Process)
-> IO Merton76Process)
-> (Ptr CBlackVolTermStructure' -> IO Merton76Process)
-> IO Merton76Process
forall a b. (a -> b) -> a -> b
$ \Ptr CBlackVolTermStructure'
a4' ->
GenQuote q2
-> (Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q2
a5 ((Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process)
-> (Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a5' ->
GenQuote q3
-> (Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q3
a6 ((Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process)
-> (Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a6' ->
GenQuote q4
-> (Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q4
a7 ((Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process)
-> (Ptr CQuote' -> IO Merton76Process) -> IO Merton76Process
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a7' ->
let {a8' :: CInt
a8' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (ProcessDiscretization -> Int) -> ProcessDiscretization -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ProcessDiscretization -> Int
forall a. Enum a => a -> Int
fromEnum) ProcessDiscretization
a8} in
(Ptr (Ptr CChar) -> IO Merton76Process) -> IO Merton76Process
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Merton76Process) -> IO Merton76Process)
-> (Ptr (Ptr CChar) -> IO Merton76Process) -> IO Merton76Process
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a9' ->
Ptr CQuote'
-> Ptr CYieldTermStructure'
-> Ptr CYieldTermStructure'
-> Ptr CBlackVolTermStructure'
-> Ptr CQuote'
-> Ptr CQuote'
-> Ptr CQuote'
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CMerton76Process')
merton76Process'_ Ptr CQuote'
a1' Ptr CYieldTermStructure'
a2' Ptr CYieldTermStructure'
a3' Ptr CBlackVolTermStructure'
a4' Ptr CQuote'
a5' Ptr CQuote'
a6' Ptr CQuote'
a7' CInt
a8' Ptr (Ptr CChar)
a9' IO (Ptr CMerton76Process')
-> (Ptr CMerton76Process' -> IO Merton76Process)
-> IO Merton76Process
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CMerton76Process'
res ->
Ptr CMerton76Process' -> IO Merton76Process
peekMerton76Process Ptr CMerton76Process'
res IO Merton76Process
-> (Merton76Process -> IO Merton76Process) -> IO Merton76Process
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Merton76Process
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a9'IO () -> IO Merton76Process -> IO Merton76Process
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Merton76Process -> IO Merton76Process
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Merton76Process
res')
{-# LINE 658 "./QuantLib/Process.chs" #-}
ornsteinUhlenbeckProcess :: (Double)
-> (Double)
-> (Double)
-> (Double)
-> IO ((StochasticProcess1D))
ornsteinUhlenbeckProcess a1 a2 a3 a4 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
preErrorCheck $ \a5' ->
ornsteinUhlenbeckProcess'_ a1' a2' a3' a4' a5' >>= \res ->
peekStochasticProcess1D res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 665 "./QuantLib/Process.chs" #-}
varianceGammaProcess :: (GenQuote q)
-> (GenYieldTermStructure y1)
-> (GenYieldTermStructure y2)
-> (Double)
-> (Double)
-> (Double)
-> IO ((VarianceGammaProcess))
varianceGammaProcess a1 a2 a3 a4 a5 a6 =
withQuote a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
withYieldTermStructure a3 $ \a3' ->
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
preErrorCheck $ \a7' ->
varianceGammaProcess'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekVarianceGammaProcess res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 675 "./QuantLib/Process.chs" #-}
stochasticProcessArray :: NonEmpty (GenStochasticProcess1D p1d) -> Matrix Double
-> IO StochasticProcessArray
stochasticProcessArray a (Matrix mr mc md) = qlStochasticProcessArray (toList a) mr mc md
qlStochasticProcessArray :: ([GenStochasticProcess1D p1d]) -> (Word) -> (Word) -> ([Double]) -> IO ((StochasticProcessArray))
qlStochasticProcessArray a1 a2 a3 a4 =
withStochasticProcess1DArray a1 $ \(a1'1, a1'2) ->
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
withDoubleArrayRaw a4 $ \a4' ->
preErrorCheck $ \a5' ->
qlStochasticProcessArray'_ a1'1 a1'2 a2' a3' a4' a5' >>= \res ->
peekStochasticProcessArray res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 681 "./QuantLib/Process.chs" #-}
thetaAt :: (GeneralizedBlackScholesProcess) -> (Double)
-> (Double)
-> (Double)
-> IO ((Double))
thetaAt a1 a2 a3 a4 =
withGeneralizedBlackScholesProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
preErrorCheck $ \a5' ->
thetaAt'_ a1' a2' a3' a4' a5' >>= \res ->
let {res' = realToFrac res} in
errorCheck a5'>>
return (res')
{-# LINE 687 "./QuantLib/Process.chs" #-}
foreign import ccall safe "QuantLib/Process.chs.h qlBlackProcess"
blackProcess'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBlackProcess')))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlBlackScholesMertonProcess"
blackScholesMertonProcess'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CGeneralizedBlackScholesProcess'))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlBlackScholesProcess"
blackScholesProcess'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CGeneralizedBlackScholesProcess')))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlExtendedBlackScholesMertonProcess"
extendedBlackScholesMertonProcess'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CGeneralizedBlackScholesProcess'))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlGarmanKohlhagenProcess"
garmanKohlhagenProcess'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CGeneralizedBlackScholesProcess'))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlGeneralizedBlackScholesProcess"
generalizedBlackScholesProcess'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CGeneralizedBlackScholesProcess'))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlSquareRootProcess"
squareRootProcess'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CStochasticProcess1D')))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlVegaStressedBlackScholesProcess"
vegaStressedBlackScholesProcess'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CGeneralizedBlackScholesProcess'))))))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlBatesProcess"
batesProcess'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBatesProcess'))))))))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlExtendedOrnsteinUhlenbeckProcess"
qlExtendedOrnsteinUhlenbeckProcess'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.FunPtr (C2HSImp.CDouble -> (IO C2HSImp.CDouble))) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CExtendedOrnsteinUhlenbeckProcess'))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlLinearSeasonalOrnsteinUhlenbeckProcess"
linearSeasonalOrnsteinUhlenbeckProcess'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CExtendedOrnsteinUhlenbeckProcess')))))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlExtOUWithJumpsProcess"
extOuWithJumpsProcess'_ :: ((C2HSImp.Ptr (CExtendedOrnsteinUhlenbeckProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CExtOUWithJumpsProcess')))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlG2ForwardProcess"
g2ForwardProcess'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CG2ForwardProcess'))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlG2Process"
g2Process'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CG2Process'))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlG2ProcessPhi"
qlG2ProcessPhi'_ :: ((C2HSImp.Ptr (CG2Process')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/Process.chs.h qlG2ProcessShortRate"
qlG2ProcessShortRate'_ :: ((C2HSImp.Ptr (CG2Process')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/Process.chs.h qlG2ForwardProcessPhi"
qlG2ForwardProcessPhi'_ :: ((C2HSImp.Ptr (CG2ForwardProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/Process.chs.h qlG2ForwardProcessShortRate"
qlG2ForwardProcessShortRate'_ :: ((C2HSImp.Ptr (CG2ForwardProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/Process.chs.h qlStochasticProcessFactors"
factors'_ :: ((C2HSImp.Ptr (CStochasticProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CUInt)))
foreign import ccall safe "QuantLib/Process.chs.h qlStochasticProcessInitialValues"
initialValues'_ :: ((C2HSImp.Ptr (CStochasticProcess')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/Process.chs.h qlStochasticProcessDrift"
drift'_ :: ((C2HSImp.Ptr (CStochasticProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlStochasticProcessDiffusion"
qlStochasticProcessDiffusion'_ :: ((C2HSImp.Ptr (CStochasticProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlStochasticProcessExpectation"
expectation'_ :: ((C2HSImp.Ptr (CStochasticProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlStochasticProcessStdDeviation"
qlStochasticProcessStdDeviation'_ :: ((C2HSImp.Ptr (CStochasticProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlStochasticProcessCovariance"
qlStochasticProcessCovariance'_ :: ((C2HSImp.Ptr (CStochasticProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlStochasticProcessApply"
apply'_ :: ((C2HSImp.Ptr (CStochasticProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlStochasticProcessEvolve"
evolve'_ :: ((C2HSImp.Ptr (CStochasticProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlGemanRoncoroniProcess"
gemanRoncoroniProcess'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CStochasticProcess1D')))))))))))))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlGeometricBrownianMotionProcess"
geometricBrownianMotionProcess'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CStochasticProcess1D')))))))
foreign import ccall safe "QuantLib/Process.chs.h qlGJRGARCHProcess"
gjrGarchProcess'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CGJRGARCHProcess')))))))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlHestonProcess"
hestonProcess'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CHestonProcess')))))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlHestonProcessPdf"
pdf'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/Process.chs.h qlHestonSLVProcess"
hestonSlvProcess'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> ((C2HSImp.Ptr (CLocalVolTermStructure')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CHestonSLVProcess')))))))
foreign import ccall safe "QuantLib/Process.chs.h qlHullWhiteForwardProcess"
hullWhiteForwardProcess'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CHullWhiteForwardProcess')))))))
foreign import ccall safe "QuantLib/Process.chs.h qlHullWhiteForwardProcessSetForwardMeasureTime"
qlHullWhiteForwardProcessSetForwardMeasureTime'_ :: ((C2HSImp.Ptr (CHullWhiteForwardProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))
foreign import ccall safe "QuantLib/Process.chs.h qlG2ForwardProcessSetForwardMeasureTime"
qlG2ForwardProcessSetForwardMeasureTime'_ :: ((C2HSImp.Ptr (CG2ForwardProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))
foreign import ccall safe "QuantLib/Process.chs.h qlHullWhiteProcessAlpha"
qlHullWhiteProcessAlpha'_ :: ((C2HSImp.Ptr (CHullWhiteProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/Process.chs.h qlHullWhiteForwardProcessAlpha"
qlHullWhiteForwardProcessAlpha'_ :: ((C2HSImp.Ptr (CHullWhiteForwardProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/Process.chs.h qlHullWhiteForwardProcessB"
bFunction'_ :: ((C2HSImp.Ptr (CHullWhiteForwardProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/Process.chs.h qlHullWhiteForwardProcessMT"
mFunction'_ :: ((C2HSImp.Ptr (CHullWhiteForwardProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))
foreign import ccall safe "QuantLib/Process.chs.h qlHybridHestonHullWhiteProcessNumeraire"
numeraire'_ :: ((C2HSImp.Ptr (CHybridHestonHullWhiteProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))
foreign import ccall safe "QuantLib/Process.chs.h qlHullWhiteProcess"
hullWhiteProcess'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CHullWhiteProcess')))))))
foreign import ccall safe "QuantLib/Process.chs.h qlHybridHestonHullWhiteProcess"
hybridHestonHullWhiteProcess'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> ((C2HSImp.Ptr (CHullWhiteForwardProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CHybridHestonHullWhiteProcess'))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlKlugeExtOUProcess"
klugeExtOuProcess'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CExtOUWithJumpsProcess')) -> ((C2HSImp.Ptr (CExtendedOrnsteinUhlenbeckProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CKlugeExtOUProcess')))))))
foreign import ccall safe "QuantLib/Process.chs.h qlLiborForwardModelProcess"
liborForwardModelProcess'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr (CIborIndex')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLiborForwardModelProcess'))))))
foreign import ccall safe "QuantLib/Process.chs.h qlLiborForwardModelProcessFixingDates"
fixingDates'_ :: ((C2HSImp.Ptr (CLiborForwardModelProcess')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/Process.chs.h qlLiborForwardModelProcessFixingTimes"
fixingTimes'_ :: ((C2HSImp.Ptr (CLiborForwardModelProcess')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/Process.chs.h qlLiborForwardModelProcessCashFlows"
cashFlows'_ :: ((C2HSImp.Ptr (CLiborForwardModelProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg'))))))
foreign import ccall safe "QuantLib/Process.chs.h qlLiborForwardModelProcessIndex"
index'_ :: ((C2HSImp.Ptr (CLiborForwardModelProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CIborIndex')))))
foreign import ccall safe "QuantLib/Process.chs.h qlLiborForwardModelProcessDiscountBond"
discountBond'_ :: ((C2HSImp.Ptr (CLiborForwardModelProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))
foreign import ccall safe "QuantLib/Process.chs.h qlLiborForwardModelProcessAccrualTimes"
qlLiborForwardModelProcessAccrualTimes'_ :: ((C2HSImp.Ptr (CLiborForwardModelProcess')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))
foreign import ccall safe "QuantLib/Process.chs.h qlMerton76Process"
merton76Process'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CMerton76Process'))))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlOrnsteinUhlenbeckProcess"
ornsteinUhlenbeckProcess'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CStochasticProcess1D'))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlVarianceGammaProcess"
varianceGammaProcess'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CVarianceGammaProcess'))))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlStochasticProcessArray"
qlStochasticProcessArray'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CStochasticProcess1D'))) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CStochasticProcessArray')))))))))
foreign import ccall safe "QuantLib/Process.chs.h qlQuantLibBlackScholesTheta"
thetaAt'_ :: ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))