{-# LINE 1 "./QuantLib/Model.chs" #-}
{-# LANGUAGE FlexibleInstances #-}
module QuantLib.Model
(
GenCalibratedModel
, CalibratedModel
, GenShortRateModel
, ShortRateModel
, GenOneFactorAffineModel
, OneFactorAffineModel
, HullWhite
, G2
, GenHestonModel
, HestonModel
, RoughHestonModel
, PiecewiseTimeDependentHestonModel
, GenBatesModel
, BatesModel
, BatesDetJumpModel
, GenBatesDoubleExpModel
, BatesDoubleExpModel
, BatesDoubleExpDetJumpModel
, GJRGARCHModel
, Gaussian1dModel
, Gsr
, MarkovFunctional
, LiborForwardModel
, HestonSLVMCModel
, HestonSLVFDMModel
, AffineModel
, ShortRateDynamics
, Garch11
, Garch11Mode(..)
, GenCalibrationHelper
, CalibrationHelper
, GenBlackCalibrationHelper
, BlackCalibrationHelper
, SwaptionHelper
, BrownianGeneratorFactory
, CalibrationErrorType(..)
, SobolBrownianOrdering(..)
, HestonSLVGreensAlgorithm(..)
, HestonSLVVarianceTransformation(..)
, HestonSLVFokkerPlanckFdmParams(..)
, HestonSLVFDMLogEntry(..)
, LfmHullWhiteParameterization
, LmCorrelationModel(..)
, LmVolatilityModel(..)
, SwaptionSpan(..)
, AsAffineModel(..)
, AsGaussian1dModel(..)
, asCalibratedModel
, asHestonModel
, asShortRateModel
, asOneFactorAffineModel
, asBatesModel
, asBatesDoubleExpModel
, asCalibrationHelper
, asBlackCalibrationHelper
, batesModel
, blackKarasinski
, coxIngersollRoss
, extendedCoxIngersollRoss
, g2
, generalizedHullWhite
, gjrGarchModel
, hestonModel
, roughHestonModel
, mtBrownianGeneratorFactory
, sobolBrownianGeneratorFactory
, hestonSlvMcModel
, hestonSlvFdmModel
, hullWhite
, varianceGammaModel
, vasicek
, liborForwardModel
, lfmHullWhiteParameterization
, gsr
, gsrWithReversions
, markovFunctional
, markovFunctionalCaplet
, garch11
, garch11Calibrated
, capHelper
, hestonModelHelper
, swaptionHelper
, setCovarParam
, calibrate
, calibrateVolatilitiesIterative
, calibrateReversionsIterative
, moveVolatility
, moveReversion
, setPricingEngine
, setParams
, discount
, discountBond
, discountBondOption
, convexityBias
, numeraire
, gaussian1dZerobond
, gaussian1dZerobondOption
, gaussian1dCompoundedRate
, gaussian1dForwardRate
, gaussian1dSwapRate
, gaussian1dSwapAnnuity
, gaussian1dYGrid
, lfmHullWhiteCovariance
, liborForwardModelS0
, blackPrice
, impliedVolatility
, roughHestonTheta
, roughHestonKappa
, roughHestonSigma
, roughHestonRho
, roughHestonV0
, roughHestonHurst
, roughHestonProcess
, HasLeverageFunction(..)
, HasVolatilities(..)
, reversions
, HasHelperUnderlying(..)
, g2Dynamics
, shortRate
, stateProcess
, hestonSlvFdmLogEntries
, helperSwaption
, times
, fixedReversion
, params
, value
, calibrationError
, marketValue
, modelValue
, volatility
, forecast
, calculate
, garmanKlassSimpleSigma
, garmanKlassSigma1
, parkinsonSigma
, garmanKlassSigma3
, garmanKlassSigma4
, garmanKlassSigma5
, garmanKlassSigma6
, constantVolatilityEstimator
, simpleLocalVolatilityEstimator
, alpha
, beta
, omega
, longTermVolatility
, logLikelihood
) 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
{-# LINE 189 "./QuantLib/Model.chs" #-}
import QuantLib.Internal
import QuantLib.Time.Schedule(Frequency)
import QuantLib.InterestRate(VolatilityType)
import QuantLib.CashFlow(RateAveragingType)
import QuantLib.Internal.Type
import QuantLib.Internal.Common
import QuantLib.TermStructure(HasHelperUnderlying(..))
import QuantLib.Math(SobolDirectionIntegers)
import Data.List(genericTake)
import Data.List.NonEmpty(NonEmpty, toList)
import Data.Maybe(fromMaybe)
data CalibrationErrorType = RelativePriceError
| PriceError
| ImpliedVolError
deriving (Int -> CalibrationErrorType
CalibrationErrorType -> Int
CalibrationErrorType -> [CalibrationErrorType]
CalibrationErrorType -> CalibrationErrorType
CalibrationErrorType
-> CalibrationErrorType -> [CalibrationErrorType]
CalibrationErrorType
-> CalibrationErrorType
-> CalibrationErrorType
-> [CalibrationErrorType]
(CalibrationErrorType -> CalibrationErrorType)
-> (CalibrationErrorType -> CalibrationErrorType)
-> (Int -> CalibrationErrorType)
-> (CalibrationErrorType -> Int)
-> (CalibrationErrorType -> [CalibrationErrorType])
-> (CalibrationErrorType
-> CalibrationErrorType -> [CalibrationErrorType])
-> (CalibrationErrorType
-> CalibrationErrorType -> [CalibrationErrorType])
-> (CalibrationErrorType
-> CalibrationErrorType
-> CalibrationErrorType
-> [CalibrationErrorType])
-> Enum CalibrationErrorType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: CalibrationErrorType -> CalibrationErrorType
succ :: CalibrationErrorType -> CalibrationErrorType
$cpred :: CalibrationErrorType -> CalibrationErrorType
pred :: CalibrationErrorType -> CalibrationErrorType
$ctoEnum :: Int -> CalibrationErrorType
toEnum :: Int -> CalibrationErrorType
$cfromEnum :: CalibrationErrorType -> Int
fromEnum :: CalibrationErrorType -> Int
$cenumFrom :: CalibrationErrorType -> [CalibrationErrorType]
enumFrom :: CalibrationErrorType -> [CalibrationErrorType]
$cenumFromThen :: CalibrationErrorType
-> CalibrationErrorType -> [CalibrationErrorType]
enumFromThen :: CalibrationErrorType
-> CalibrationErrorType -> [CalibrationErrorType]
$cenumFromTo :: CalibrationErrorType
-> CalibrationErrorType -> [CalibrationErrorType]
enumFromTo :: CalibrationErrorType
-> CalibrationErrorType -> [CalibrationErrorType]
$cenumFromThenTo :: CalibrationErrorType
-> CalibrationErrorType
-> CalibrationErrorType
-> [CalibrationErrorType]
enumFromThenTo :: CalibrationErrorType
-> CalibrationErrorType
-> CalibrationErrorType
-> [CalibrationErrorType]
Enum,Int -> CalibrationErrorType -> ShowS
[CalibrationErrorType] -> ShowS
CalibrationErrorType -> String
(Int -> CalibrationErrorType -> ShowS)
-> (CalibrationErrorType -> String)
-> ([CalibrationErrorType] -> ShowS)
-> Show CalibrationErrorType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CalibrationErrorType -> ShowS
showsPrec :: Int -> CalibrationErrorType -> ShowS
$cshow :: CalibrationErrorType -> String
show :: CalibrationErrorType -> String
$cshowList :: [CalibrationErrorType] -> ShowS
showList :: [CalibrationErrorType] -> ShowS
Show,CalibrationErrorType -> CalibrationErrorType -> Bool
(CalibrationErrorType -> CalibrationErrorType -> Bool)
-> (CalibrationErrorType -> CalibrationErrorType -> Bool)
-> Eq CalibrationErrorType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CalibrationErrorType -> CalibrationErrorType -> Bool
== :: CalibrationErrorType -> CalibrationErrorType -> Bool
$c/= :: CalibrationErrorType -> CalibrationErrorType -> Bool
/= :: CalibrationErrorType -> CalibrationErrorType -> Bool
Eq,ReadPrec [CalibrationErrorType]
ReadPrec CalibrationErrorType
Int -> ReadS CalibrationErrorType
ReadS [CalibrationErrorType]
(Int -> ReadS CalibrationErrorType)
-> ReadS [CalibrationErrorType]
-> ReadPrec CalibrationErrorType
-> ReadPrec [CalibrationErrorType]
-> Read CalibrationErrorType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CalibrationErrorType
readsPrec :: Int -> ReadS CalibrationErrorType
$creadList :: ReadS [CalibrationErrorType]
readList :: ReadS [CalibrationErrorType]
$creadPrec :: ReadPrec CalibrationErrorType
readPrec :: ReadPrec CalibrationErrorType
$creadListPrec :: ReadPrec [CalibrationErrorType]
readListPrec :: ReadPrec [CalibrationErrorType]
Read)
{-# LINE 203 "./QuantLib/Model.chs" #-}
data Garch11Mode = MomentMatchingGuess
| GammaGuess
| BestOfTwo
| DoubleOptimization
deriving (Int -> Garch11Mode
Garch11Mode -> Int
Garch11Mode -> [Garch11Mode]
Garch11Mode -> Garch11Mode
Garch11Mode -> Garch11Mode -> [Garch11Mode]
Garch11Mode -> Garch11Mode -> Garch11Mode -> [Garch11Mode]
(Garch11Mode -> Garch11Mode)
-> (Garch11Mode -> Garch11Mode)
-> (Int -> Garch11Mode)
-> (Garch11Mode -> Int)
-> (Garch11Mode -> [Garch11Mode])
-> (Garch11Mode -> Garch11Mode -> [Garch11Mode])
-> (Garch11Mode -> Garch11Mode -> [Garch11Mode])
-> (Garch11Mode -> Garch11Mode -> Garch11Mode -> [Garch11Mode])
-> Enum Garch11Mode
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: Garch11Mode -> Garch11Mode
succ :: Garch11Mode -> Garch11Mode
$cpred :: Garch11Mode -> Garch11Mode
pred :: Garch11Mode -> Garch11Mode
$ctoEnum :: Int -> Garch11Mode
toEnum :: Int -> Garch11Mode
$cfromEnum :: Garch11Mode -> Int
fromEnum :: Garch11Mode -> Int
$cenumFrom :: Garch11Mode -> [Garch11Mode]
enumFrom :: Garch11Mode -> [Garch11Mode]
$cenumFromThen :: Garch11Mode -> Garch11Mode -> [Garch11Mode]
enumFromThen :: Garch11Mode -> Garch11Mode -> [Garch11Mode]
$cenumFromTo :: Garch11Mode -> Garch11Mode -> [Garch11Mode]
enumFromTo :: Garch11Mode -> Garch11Mode -> [Garch11Mode]
$cenumFromThenTo :: Garch11Mode -> Garch11Mode -> Garch11Mode -> [Garch11Mode]
enumFromThenTo :: Garch11Mode -> Garch11Mode -> Garch11Mode -> [Garch11Mode]
Enum,Int -> Garch11Mode -> ShowS
[Garch11Mode] -> ShowS
Garch11Mode -> String
(Int -> Garch11Mode -> ShowS)
-> (Garch11Mode -> String)
-> ([Garch11Mode] -> ShowS)
-> Show Garch11Mode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Garch11Mode -> ShowS
showsPrec :: Int -> Garch11Mode -> ShowS
$cshow :: Garch11Mode -> String
show :: Garch11Mode -> String
$cshowList :: [Garch11Mode] -> ShowS
showList :: [Garch11Mode] -> ShowS
Show,Garch11Mode -> Garch11Mode -> Bool
(Garch11Mode -> Garch11Mode -> Bool)
-> (Garch11Mode -> Garch11Mode -> Bool) -> Eq Garch11Mode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Garch11Mode -> Garch11Mode -> Bool
== :: Garch11Mode -> Garch11Mode -> Bool
$c/= :: Garch11Mode -> Garch11Mode -> Bool
/= :: Garch11Mode -> Garch11Mode -> Bool
Eq,ReadPrec [Garch11Mode]
ReadPrec Garch11Mode
Int -> ReadS Garch11Mode
ReadS [Garch11Mode]
(Int -> ReadS Garch11Mode)
-> ReadS [Garch11Mode]
-> ReadPrec Garch11Mode
-> ReadPrec [Garch11Mode]
-> Read Garch11Mode
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Garch11Mode
readsPrec :: Int -> ReadS Garch11Mode
$creadList :: ReadS [Garch11Mode]
readList :: ReadS [Garch11Mode]
$creadPrec :: ReadPrec Garch11Mode
readPrec :: ReadPrec Garch11Mode
$creadListPrec :: ReadPrec [Garch11Mode]
readListPrec :: ReadPrec [Garch11Mode]
Read)
{-# LINE 204 "./QuantLib/Model.chs" #-}
data SobolBrownianOrdering = Factors | Steps | Diagonal deriving (Show, Eq, Read, Enum, Bounded)
data HestonSLVGreensAlgorithm = ZeroCorrelation | Gaussian | SemiAnalytical deriving (Show, Eq, Read, Enum, Bounded)
data HestonSLVVarianceTransformation = Plain | Power | Log deriving (Int -> HestonSLVVarianceTransformation -> ShowS
[HestonSLVVarianceTransformation] -> ShowS
HestonSLVVarianceTransformation -> String
(Int -> HestonSLVVarianceTransformation -> ShowS)
-> (HestonSLVVarianceTransformation -> String)
-> ([HestonSLVVarianceTransformation] -> ShowS)
-> Show HestonSLVVarianceTransformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HestonSLVVarianceTransformation -> ShowS
showsPrec :: Int -> HestonSLVVarianceTransformation -> ShowS
$cshow :: HestonSLVVarianceTransformation -> String
show :: HestonSLVVarianceTransformation -> String
$cshowList :: [HestonSLVVarianceTransformation] -> ShowS
showList :: [HestonSLVVarianceTransformation] -> ShowS
Show, HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation -> Bool
(HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation -> Bool)
-> (HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation -> Bool)
-> Eq HestonSLVVarianceTransformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation -> Bool
== :: HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation -> Bool
$c/= :: HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation -> Bool
/= :: HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation -> Bool
Eq, ReadPrec [HestonSLVVarianceTransformation]
ReadPrec HestonSLVVarianceTransformation
Int -> ReadS HestonSLVVarianceTransformation
ReadS [HestonSLVVarianceTransformation]
(Int -> ReadS HestonSLVVarianceTransformation)
-> ReadS [HestonSLVVarianceTransformation]
-> ReadPrec HestonSLVVarianceTransformation
-> ReadPrec [HestonSLVVarianceTransformation]
-> Read HestonSLVVarianceTransformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS HestonSLVVarianceTransformation
readsPrec :: Int -> ReadS HestonSLVVarianceTransformation
$creadList :: ReadS [HestonSLVVarianceTransformation]
readList :: ReadS [HestonSLVVarianceTransformation]
$creadPrec :: ReadPrec HestonSLVVarianceTransformation
readPrec :: ReadPrec HestonSLVVarianceTransformation
$creadListPrec :: ReadPrec [HestonSLVVarianceTransformation]
readListPrec :: ReadPrec [HestonSLVVarianceTransformation]
Read, Int -> HestonSLVVarianceTransformation
HestonSLVVarianceTransformation -> Int
HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
HestonSLVVarianceTransformation -> HestonSLVVarianceTransformation
HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
(HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation)
-> (HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation)
-> (Int -> HestonSLVVarianceTransformation)
-> (HestonSLVVarianceTransformation -> Int)
-> (HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation])
-> (HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation])
-> (HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation])
-> (HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation])
-> Enum HestonSLVVarianceTransformation
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: HestonSLVVarianceTransformation -> HestonSLVVarianceTransformation
succ :: HestonSLVVarianceTransformation -> HestonSLVVarianceTransformation
$cpred :: HestonSLVVarianceTransformation -> HestonSLVVarianceTransformation
pred :: HestonSLVVarianceTransformation -> HestonSLVVarianceTransformation
$ctoEnum :: Int -> HestonSLVVarianceTransformation
toEnum :: Int -> HestonSLVVarianceTransformation
$cfromEnum :: HestonSLVVarianceTransformation -> Int
fromEnum :: HestonSLVVarianceTransformation -> Int
$cenumFrom :: HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
enumFrom :: HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
$cenumFromThen :: HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
enumFromThen :: HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
$cenumFromTo :: HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
enumFromTo :: HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
$cenumFromThenTo :: HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
enumFromThenTo :: HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> [HestonSLVVarianceTransformation]
Enum, HestonSLVVarianceTransformation
HestonSLVVarianceTransformation
-> HestonSLVVarianceTransformation
-> Bounded HestonSLVVarianceTransformation
forall a. a -> a -> Bounded a
$cminBound :: HestonSLVVarianceTransformation
minBound :: HestonSLVVarianceTransformation
$cmaxBound :: HestonSLVVarianceTransformation
maxBound :: HestonSLVVarianceTransformation
Bounded)
data HestonSLVFokkerPlanckFdmParams = HestonSLVFokkerPlanckFdmParams
{ HestonSLVFokkerPlanckFdmParams -> Word
hestonSlvXGrid :: !Word, HestonSLVFokkerPlanckFdmParams -> Word
hestonSlvVGrid :: !Word
, HestonSLVFokkerPlanckFdmParams -> Word
hestonSlvTMaxStepsPerYear :: !Word, HestonSLVFokkerPlanckFdmParams -> Word
hestonSlvTMinStepsPerYear :: !Word, HestonSLVFokkerPlanckFdmParams -> Double
hestonSlvTStepNumberDecay :: !Double
, HestonSLVFokkerPlanckFdmParams -> Word
hestonSlvNRannacherTimeSteps :: !Word, HestonSLVFokkerPlanckFdmParams -> Word
hestonSlvPredictionCorrectionSteps :: !Word
, HestonSLVFokkerPlanckFdmParams -> Double
hestonSlvX0Density :: !Double, HestonSLVFokkerPlanckFdmParams -> Double
hestonSlvLocalVolEpsProb :: !Double, HestonSLVFokkerPlanckFdmParams -> Word
hestonSlvMaxIntegrationIterations :: !Word
, HestonSLVFokkerPlanckFdmParams -> Double
hestonSlvVLowerEps :: !Double, HestonSLVFokkerPlanckFdmParams -> Double
hestonSlvVUpperEps :: !Double, HestonSLVFokkerPlanckFdmParams -> Double
hestonSlvVMin :: !Double
, HestonSLVFokkerPlanckFdmParams -> Double
hestonSlvV0Density :: !Double, HestonSLVFokkerPlanckFdmParams -> Double
hestonSlvVLowerBoundDensity :: !Double, HestonSLVFokkerPlanckFdmParams -> Double
hestonSlvVUpperBoundDensity :: !Double
, HestonSLVFokkerPlanckFdmParams -> Double
hestonSlvLeverageFctPropEps :: !Double, HestonSLVFokkerPlanckFdmParams -> HestonSLVGreensAlgorithm
hestonSlvGreensAlgorithm :: !HestonSLVGreensAlgorithm
, HestonSLVFokkerPlanckFdmParams -> HestonSLVVarianceTransformation
hestonSlvVarianceTransformation :: !HestonSLVVarianceTransformation, HestonSLVFokkerPlanckFdmParams -> FdmScheme
hestonSlvSchemeDesc :: !FdmScheme
}
data HestonSLVFDMLogEntry = HestonSLVFDMLogEntry
{ HestonSLVFDMLogEntry -> Double
hestonSlvLogTime :: !Double, HestonSLVFDMLogEntry -> RealVector
hestonSlvLogSpotCoordinates :: !RealVector
, HestonSLVFDMLogEntry -> RealVector
hestonSlvLogVarianceCoordinates :: !RealVector, HestonSLVFDMLogEntry -> RealMatrix
hestonSlvLogDensity :: !RealMatrix
} deriving (Int -> HestonSLVFDMLogEntry -> ShowS
[HestonSLVFDMLogEntry] -> ShowS
HestonSLVFDMLogEntry -> String
(Int -> HestonSLVFDMLogEntry -> ShowS)
-> (HestonSLVFDMLogEntry -> String)
-> ([HestonSLVFDMLogEntry] -> ShowS)
-> Show HestonSLVFDMLogEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HestonSLVFDMLogEntry -> ShowS
showsPrec :: Int -> HestonSLVFDMLogEntry -> ShowS
$cshow :: HestonSLVFDMLogEntry -> String
show :: HestonSLVFDMLogEntry -> String
$cshowList :: [HestonSLVFDMLogEntry] -> ShowS
showList :: [HestonSLVFDMLogEntry] -> ShowS
Show, HestonSLVFDMLogEntry -> HestonSLVFDMLogEntry -> Bool
(HestonSLVFDMLogEntry -> HestonSLVFDMLogEntry -> Bool)
-> (HestonSLVFDMLogEntry -> HestonSLVFDMLogEntry -> Bool)
-> Eq HestonSLVFDMLogEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HestonSLVFDMLogEntry -> HestonSLVFDMLogEntry -> Bool
== :: HestonSLVFDMLogEntry -> HestonSLVFDMLogEntry -> Bool
$c/= :: HestonSLVFDMLogEntry -> HestonSLVFDMLogEntry -> Bool
/= :: HestonSLVFDMLogEntry -> HestonSLVFDMLogEntry -> Bool
Eq)
{-# LINE 235 "./QuantLib/Model.chs" #-}
{-# LINE 236 "./QuantLib/Model.chs" #-}
{-# LINE 237 "./QuantLib/Model.chs" #-}
{-# LINE 238 "./QuantLib/Model.chs" #-}
{-# LINE 239 "./QuantLib/Model.chs" #-}
{-# LINE 240 "./QuantLib/Model.chs" #-}
{-# LINE 241 "./QuantLib/Model.chs" #-}
{-# LINE 242 "./QuantLib/Model.chs" #-}
{-# LINE 243 "./QuantLib/Model.chs" #-}
{-# LINE 244 "./QuantLib/Model.chs" #-}
{-# LINE 245 "./QuantLib/Model.chs" #-}
{-# LINE 246 "./QuantLib/Model.chs" #-}
{-# LINE 247 "./QuantLib/Model.chs" #-}
{-# LINE 248 "./QuantLib/Model.chs" #-}
{-# LINE 249 "./QuantLib/Model.chs" #-}
{-# LINE 250 "./QuantLib/Model.chs" #-}
{-# LINE 251 "./QuantLib/Model.chs" #-}
{-# LINE 252 "./QuantLib/Model.chs" #-}
{-# LINE 253 "./QuantLib/Model.chs" #-}
{-# LINE 254 "./QuantLib/Model.chs" #-}
{-# LINE 255 "./QuantLib/Model.chs" #-}
{-# LINE 256 "./QuantLib/Model.chs" #-}
{-# LINE 257 "./QuantLib/Model.chs" #-}
{-# LINE 258 "./QuantLib/Model.chs" #-}
{-# LINE 259 "./QuantLib/Model.chs" #-}
{-# LINE 260 "./QuantLib/Model.chs" #-}
{-# LINE 261 "./QuantLib/Model.chs" #-}
{-# LINE 262 "./QuantLib/Model.chs" #-}
{-# LINE 263 "./QuantLib/Model.chs" #-}
{-# LINE 264 "./QuantLib/Model.chs" #-}
{-# LINE 265 "./QuantLib/Model.chs" #-}
{-# LINE 266 "./QuantLib/Model.chs" #-}
{-# LINE 267 "./QuantLib/Model.chs" #-}
{-# LINE 268 "./QuantLib/Model.chs" #-}
{-# LINE 269 "./QuantLib/Model.chs" #-}
{-# LINE 270 "./QuantLib/Model.chs" #-}
{-# LINE 271 "./QuantLib/Model.chs" #-}
{-# LINE 272 "./QuantLib/Model.chs" #-}
{-# LINE 273 "./QuantLib/Model.chs" #-}
{-# LINE 274 "./QuantLib/Model.chs" #-}
batesModel :: (BatesProcess) -> IO ((BatesModel))
batesModel :: BatesProcess -> IO BatesModel
batesModel BatesProcess
a1 =
BatesProcess
-> (Ptr CBatesProcess' -> IO BatesModel) -> IO BatesModel
forall b. BatesProcess -> (Ptr CBatesProcess' -> IO b) -> IO b
withBatesProcess BatesProcess
a1 ((Ptr CBatesProcess' -> IO BatesModel) -> IO BatesModel)
-> (Ptr CBatesProcess' -> IO BatesModel) -> IO BatesModel
forall a b. (a -> b) -> a -> b
$ \Ptr CBatesProcess'
a1' ->
(Ptr (Ptr ()) -> IO BatesModel) -> IO BatesModel
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO BatesModel) -> IO BatesModel)
-> (Ptr (Ptr ()) -> IO BatesModel) -> IO BatesModel
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a2' ->
Ptr CBatesProcess' -> Ptr (Ptr ()) -> IO (Ptr CBatesModel')
batesModel'_ Ptr CBatesProcess'
a1' Ptr (Ptr ())
a2' IO (Ptr CBatesModel')
-> (Ptr CBatesModel' -> IO BatesModel) -> IO BatesModel
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CBatesModel'
res ->
Ptr CBatesModel' -> IO BatesModel
peekBatesModel Ptr CBatesModel'
res IO BatesModel -> (BatesModel -> IO BatesModel) -> IO BatesModel
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \BatesModel
res' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a2'IO () -> IO BatesModel -> IO BatesModel
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
BatesModel -> IO BatesModel
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (BatesModel
res')
{-# LINE 277 "./QuantLib/Model.chs" #-}
blackKarasinski :: (GenYieldTermStructure y) -> (Double)
-> (Double)
-> IO ((ShortRateModel))
blackKarasinski a1 a2 a3 =
withYieldTermStructure a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
preErrorCheck $ \a4' ->
blackKarasinski'_ a1' a2' a3' a4' >>= \res ->
peekShortRateModel res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 282 "./QuantLib/Model.chs" #-}
coxIngersollRoss :: (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Bool)
-> IO ((OneFactorAffineModel))
coxIngersollRoss 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' = C2HSImp.fromBool a5} in
preErrorCheck $ \a6' ->
coxIngersollRoss'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekOneFactorAffineModel res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 290 "./QuantLib/Model.chs" #-}
extendedCoxIngersollRoss :: (GenYieldTermStructure y) -> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Bool)
-> IO ((OneFactorAffineModel))
extendedCoxIngersollRoss a1 a2 a3 a4 a5 a6 =
withYieldTermStructure a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = C2HSImp.fromBool a6} in
preErrorCheck $ \a7' ->
extendedCoxIngersollRoss'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekOneFactorAffineModel res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 298 "./QuantLib/Model.chs" #-}
g2 :: (GenYieldTermStructure y) -> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> IO ((G2))
g2 a1 a2 a3 a4 a5 a6 =
withYieldTermStructure a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
preErrorCheck $ \a7' ->
g2'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekG2 res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 306 "./QuantLib/Model.chs" #-}
g2Dynamics :: (G2) -> IO ((ShortRateDynamics))
g2Dynamics a1 =
withG2 a1 $ \a1' ->
preErrorCheck $ \a2' ->
g2Dynamics'_ a1' a2' >>= \res ->
peekStandalone res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 309 "./QuantLib/Model.chs" #-}
shortRate :: (ShortRateDynamics) -> (Double)
-> (Double)
-> (Double)
-> IO ((Double))
shortRate a1 a2 a3 a4 =
withStandalone a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
preErrorCheck $ \a5' ->
shortRate'_ a1' a2' a3' a4' a5' >>= \res ->
let {res' = realToFrac res} in
errorCheck a5'>>
return (res')
{-# LINE 316 "./QuantLib/Model.chs" #-}
generalizedHullWhite :: GenYieldTermStructure y -> NonEmpty (Day, Double)
-> NonEmpty (Day, Double)
-> IO ShortRateModel
generalizedHullWhite ts s v = qlGeneralizedHullWhite ts sd vd sq vq where {(sd, sq) = unzip (toList s); (vd, vq) = unzip (toList v)}
qlGeneralizedHullWhite :: (GenYieldTermStructure y) -> ([Day]) -> ([Day]) -> ([Double]) -> ([Double]) -> IO ((ShortRateModel))
qlGeneralizedHullWhite a1 a2 a3 a4 a5 =
withYieldTermStructure a1 $ \a1' ->
withDayArray a2 $ \(a2'1, a2'2) ->
withDayArray a3 $ \(a3'1, a3'2) ->
withDoubleArray a4 $ \(a4'1, a4'2) ->
withDoubleArray a5 $ \(a5'1, a5'2) ->
preErrorCheck $ \a6' ->
qlGeneralizedHullWhite'_ a1' a2'1 a2'2 a3'1 a3'2 a4'1 a4'2 a5'1 a5'2 a6' >>= \res ->
peekShortRateModel res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 323 "./QuantLib/Model.chs" #-}
gjrGarchModel :: (GJRGARCHProcess) -> IO ((GJRGARCHModel))
gjrGarchModel a1 =
withGenStochasticProcess a1 $ \a1' ->
preErrorCheck $ \a2' ->
gjrGarchModel'_ a1' a2' >>= \res ->
peekGJRGARCHModel res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 326 "./QuantLib/Model.chs" #-}
hestonModel :: (GenHestonProcess hp) -> IO ((HestonModel))
hestonModel a1 =
withHestonProcess a1 $ \a1' ->
preErrorCheck $ \a2' ->
hestonModel'_ a1' a2' >>= \res ->
peekHestonModel res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 329 "./QuantLib/Model.chs" #-}
mtBrownianGeneratorFactory :: (Word)
-> IO ((BrownianGeneratorFactory))
mtBrownianGeneratorFactory a1 =
let {a1' = fromIntegral a1} in
preErrorCheck $ \a2' ->
mtBrownianGeneratorFactory'_ a1' a2' >>= \res ->
peekBrownianGeneratorFactory res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 334 "./QuantLib/Model.chs" #-}
sobolBrownianGeneratorFactory :: (SobolBrownianOrdering)
-> (Word)
-> (SobolDirectionIntegers)
-> IO ((BrownianGeneratorFactory))
sobolBrownianGeneratorFactory a1 a2 a3 =
let {a1' = fromEnumC a1} in
let {a2' = fromIntegral a2} in
let {a3' = fromEnumC a3} in
preErrorCheck $ \a4' ->
sobolBrownianGeneratorFactory'_ a1' a2' a3' a4' >>= \res ->
peekBrownianGeneratorFactory res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 341 "./QuantLib/Model.chs" #-}
hestonSlvMcModel :: (GenLocalVolTermStructure lv)
-> (GenHestonModel hm)
-> (BrownianGeneratorFactory)
-> (Day)
-> (Word)
-> (Word)
-> (Word)
-> ([Day])
-> (Double)
-> IO ((HestonSLVMCModel))
hestonSlvMcModel :: forall lv hm.
GenLocalVolTermStructure lv
-> GenHestonModel hm
-> BrownianGeneratorFactory
-> Day
-> Word
-> Word
-> Word
-> [Day]
-> Double
-> IO HestonSLVMCModel
hestonSlvMcModel GenLocalVolTermStructure lv
a1 GenHestonModel hm
a2 BrownianGeneratorFactory
a3 Day
a4 Word
a5 Word
a6 Word
a7 [Day]
a8 Double
a9 =
GenLocalVolTermStructure lv
-> (Ptr CLocalVolTermStructure' -> IO HestonSLVMCModel)
-> IO HestonSLVMCModel
forall lv b.
GenLocalVolTermStructure lv
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withGenLocalVolTermStructure GenLocalVolTermStructure lv
a1 ((Ptr CLocalVolTermStructure' -> IO HestonSLVMCModel)
-> IO HestonSLVMCModel)
-> (Ptr CLocalVolTermStructure' -> IO HestonSLVMCModel)
-> IO HestonSLVMCModel
forall a b. (a -> b) -> a -> b
$ \Ptr CLocalVolTermStructure'
a1' ->
GenHestonModel hm
-> (Ptr CHestonModel' -> IO HestonSLVMCModel)
-> IO HestonSLVMCModel
forall hm b.
GenHestonModel hm -> (Ptr CHestonModel' -> IO b) -> IO b
withHestonModel GenHestonModel hm
a2 ((Ptr CHestonModel' -> IO HestonSLVMCModel) -> IO HestonSLVMCModel)
-> (Ptr CHestonModel' -> IO HestonSLVMCModel)
-> IO HestonSLVMCModel
forall a b. (a -> b) -> a -> b
$ \Ptr CHestonModel'
a2' ->
BrownianGeneratorFactory
-> (Ptr CBrownianGeneratorFactory' -> IO HestonSLVMCModel)
-> IO HestonSLVMCModel
forall b.
BrownianGeneratorFactory
-> (Ptr CBrownianGeneratorFactory' -> IO b) -> IO b
withBrownianGeneratorFactory BrownianGeneratorFactory
a3 ((Ptr CBrownianGeneratorFactory' -> IO HestonSLVMCModel)
-> IO HestonSLVMCModel)
-> (Ptr CBrownianGeneratorFactory' -> IO HestonSLVMCModel)
-> IO HestonSLVMCModel
forall a b. (a -> b) -> a -> b
$ \Ptr CBrownianGeneratorFactory'
a3' ->
Day -> (CInt -> IO HestonSLVMCModel) -> IO HestonSLVMCModel
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a4 ((CInt -> IO HestonSLVMCModel) -> IO HestonSLVMCModel)
-> (CInt -> IO HestonSLVMCModel) -> IO HestonSLVMCModel
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral a5} in
let {a6' = fromIntegral a6} in
let {a7' = fromIntegral a7} in
withDayArray a8 $ \(a8'1, a8'2) ->
let {a9' = realToFrac a9} in
preErrorCheck $ \a10' ->
hestonSlvMcModel'_ a1' a2' a3' a4' a5' a6' a7' a8'1 a8'2 a9' a10' >>= \res ->
peekHestonSLVMCModel res >>= \res' ->
errorCheck a10'>>
return (res')
{-# LINE 355 "./QuantLib/Model.chs" #-}
qlHestonSLVMCModelLeverageFunction :: (HestonSLVMCModel)
-> IO ((LocalVolTermStructure))
qlHestonSLVMCModelLeverageFunction a1 =
withHestonSLVMCModel a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlHestonSLVMCModelLeverageFunction'_ a1' a2' >>= \res ->
peekLocalVolTermStructure res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 359 "./QuantLib/Model.chs" #-}
hestonSlvFdmModel :: GenLocalVolTermStructure lv -> GenHestonModel hm -> Day
-> HestonSLVFokkerPlanckFdmParams -> Bool -> [Day] -> Double -> IO HestonSLVFDMModel
hestonSlvFdmModel localVol model endDate p logging mandatoryDates mixingFactor =
hestonSlvFdmModelRaw localVol model endDate
(hestonSlvXGrid p) (hestonSlvVGrid p) (hestonSlvTMaxStepsPerYear p) (hestonSlvTMinStepsPerYear p)
(hestonSlvTStepNumberDecay p) (hestonSlvNRannacherTimeSteps p) (hestonSlvPredictionCorrectionSteps p)
(hestonSlvX0Density p) (hestonSlvLocalVolEpsProb p) (hestonSlvMaxIntegrationIterations p)
(hestonSlvVLowerEps p) (hestonSlvVUpperEps p) (hestonSlvVMin p) (hestonSlvV0Density p)
(hestonSlvVLowerBoundDensity p) (hestonSlvVUpperBoundDensity p) (hestonSlvLeverageFctPropEps p)
(hestonSlvGreensAlgorithm p) (hestonSlvVarianceTransformation p) (hestonSlvSchemeDesc p)
logging mandatoryDates mixingFactor
hestonSlvFdmModelRaw :: (GenLocalVolTermStructure lv)
-> (GenHestonModel hm)
-> (Day)
-> (Word)
-> (Word)
-> (Word)
-> (Word)
-> (Double)
-> (Word)
-> (Word)
-> (Double)
-> (Double)
-> (Word)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> (HestonSLVGreensAlgorithm)
-> (HestonSLVVarianceTransformation)
-> (FdmScheme)
-> (Bool)
-> ([Day])
-> (Double)
-> IO ((HestonSLVFDMModel))
hestonSlvFdmModelRaw :: forall lv hm.
GenLocalVolTermStructure lv
-> GenHestonModel hm
-> Day
-> Word
-> Word
-> Word
-> Word
-> Double
-> Word
-> Word
-> Double
-> Double
-> Word
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> HestonSLVGreensAlgorithm
-> HestonSLVVarianceTransformation
-> FdmScheme
-> Bool
-> [Day]
-> Double
-> IO HestonSLVFDMModel
hestonSlvFdmModelRaw GenLocalVolTermStructure lv
a1 GenHestonModel hm
a2 Day
a3 Word
a4 Word
a5 Word
a6 Word
a7 Double
a8 Word
a9 Word
a10 Double
a11 Double
a12 Word
a13 Double
a14 Double
a15 Double
a16 Double
a17 Double
a18 Double
a19 Double
a20 HestonSLVGreensAlgorithm
a21 HestonSLVVarianceTransformation
a22 FdmScheme
a23 Bool
a24 [Day]
a25 Double
a26 =
GenLocalVolTermStructure lv
-> (Ptr CLocalVolTermStructure' -> IO HestonSLVFDMModel)
-> IO HestonSLVFDMModel
forall lv b.
GenLocalVolTermStructure lv
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withGenLocalVolTermStructure GenLocalVolTermStructure lv
a1 ((Ptr CLocalVolTermStructure' -> IO HestonSLVFDMModel)
-> IO HestonSLVFDMModel)
-> (Ptr CLocalVolTermStructure' -> IO HestonSLVFDMModel)
-> IO HestonSLVFDMModel
forall a b. (a -> b) -> a -> b
$ \Ptr CLocalVolTermStructure'
a1' ->
GenHestonModel hm
-> (Ptr CHestonModel' -> IO HestonSLVFDMModel)
-> IO HestonSLVFDMModel
forall hm b.
GenHestonModel hm -> (Ptr CHestonModel' -> IO b) -> IO b
withHestonModel GenHestonModel hm
a2 ((Ptr CHestonModel' -> IO HestonSLVFDMModel)
-> IO HestonSLVFDMModel)
-> (Ptr CHestonModel' -> IO HestonSLVFDMModel)
-> IO HestonSLVFDMModel
forall a b. (a -> b) -> a -> b
$ \Ptr CHestonModel'
a2' ->
Day -> (CInt -> IO HestonSLVFDMModel) -> IO HestonSLVFDMModel
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO HestonSLVFDMModel) -> IO HestonSLVFDMModel)
-> (CInt -> IO HestonSLVFDMModel) -> IO HestonSLVFDMModel
forall a b. (a -> b) -> a -> b
$ \CInt
a3' ->
let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in
let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in
let {a6' = fromIntegral a6} in
let {a7' = fromIntegral a7} in
let {a8' = realToFrac a8} in
let {a9' = fromIntegral a9} in
let {a10' = fromIntegral a10} in
let {a11' = realToFrac a11} in
let {a12' = realToFrac a12} in
let {a13' = fromIntegral a13} in
let {a14' = realToFrac a14} in
let {a15' = realToFrac a15} in
let {a16' = realToFrac a16} in
let {a17' = realToFrac a17} in
let {a18' = realToFrac a18} in
let {a19' = realToFrac a19} in
let {a20' = realToFrac a20} in
let {a21' = fromEnumC a21} in
let {a22' = fromEnumC a22} in
withFdmSchemeDesc a23 $ \a23' ->
let {a24' = C2HSImp.fromBool a24} in
withDayArray a25 $ \(a25'1, a25'2) ->
let {a26' = realToFrac a26} in
preErrorCheck $ \a27' ->
hestonSlvFdmModelRaw'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' a16' a17' a18' a19' a20' a21' a22' a23' a24' a25'1 a25'2 a26' a27' >>= \res ->
peekHestonSLVFDMModel res >>= \res' ->
errorCheck a27'>>
return (res')
{-# LINE 401 "./QuantLib/Model.chs" #-}
qlHestonSLVFDMModelLeverageFunction :: (HestonSLVFDMModel)
-> IO ((LocalVolTermStructure))
qlHestonSLVFDMModelLeverageFunction a1 =
withHestonSLVFDMModel a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlHestonSLVFDMModelLeverageFunction'_ a1' a2' >>= \res ->
peekLocalVolTermStructure res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 405 "./QuantLib/Model.chs" #-}
hestonSlvFdmLogEntries :: HestonSLVFDMModel -> IO [HestonSLVFDMLogEntry]
hestonSlvFdmLogEntries model = do
snapshot <- hestonSlvFdmLogEntriesSnapshot model
let n = hestonSlvFdmLogEntriesSize snapshot
mapM (hestonSlvFdmLogEntry snapshot) (genericTake n [0 ..])
hestonSlvFdmLogEntry :: HestonSLVFDMLogEntries -> Word -> IO HestonSLVFDMLogEntry
hestonSlvFdmLogEntry snapshot i = do
t <- hestonSlvFdmLogEntriesTime snapshot i
x <- hestonSlvFdmLogEntriesSpotGrid snapshot i
v <- hestonSlvFdmLogEntriesVarianceGrid snapshot i
(r, c, d) <- hestonSlvFdmLogEntriesDensity snapshot i
pure $ HestonSLVFDMLogEntry t x v (RealMatrix r c d)
hestonSlvFdmLogEntriesSnapshot :: (HestonSLVFDMModel) -> IO ((HestonSLVFDMLogEntries))
hestonSlvFdmLogEntriesSnapshot a1 =
withHestonSLVFDMModel a1 $ \a1' ->
preErrorCheck $ \a2' ->
hestonSlvFdmLogEntriesSnapshot'_ a1' a2' >>= \res ->
peekHestonSLVFDMLogEntries res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 424 "./QuantLib/Model.chs" #-}
hestonSlvFdmLogEntriesSize :: (HestonSLVFDMLogEntries) -> (Word)
hestonSlvFdmLogEntriesSize a1 =
C2HSImp.unsafePerformIO $
withHestonSLVFDMLogEntries a1 $ \a1' ->
hestonSlvFdmLogEntriesSize'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
{-# LINE 425 "./QuantLib/Model.chs" #-}
hestonSlvFdmLogEntriesTime :: (HestonSLVFDMLogEntries) -> (Word) -> IO ((Double))
hestonSlvFdmLogEntriesTime a1 a2 =
withHestonSLVFDMLogEntries a1 $ \a1' ->
let {a2' = fromIntegral a2} in
preErrorCheck $ \a3' ->
hestonSlvFdmLogEntriesTime'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 426 "./QuantLib/Model.chs" #-}
hestonSlvFdmLogEntriesSpotGrid :: (HestonSLVFDMLogEntries) -> (Word) -> IO ((RealVector))
hestonSlvFdmLogEntriesSpotGrid a1 a2 =
withHestonSLVFDMLogEntries a1 $ \a1' ->
let {a2' = fromIntegral a2} in
preDoubleArray $ \(a3'1, a3'2) ->
preErrorCheck $ \a4' ->
hestonSlvFdmLogEntriesSpotGrid'_ a1' a2' a3'1 a3'2 a4' >>
peekRealVector a3'1 a3'2>>= \a3'' ->
errorCheck a4'>>
return (a3'')
{-# LINE 427 "./QuantLib/Model.chs" #-}
hestonSlvFdmLogEntriesVarianceGrid :: (HestonSLVFDMLogEntries) -> (Word) -> IO ((RealVector))
hestonSlvFdmLogEntriesVarianceGrid a1 a2 =
withHestonSLVFDMLogEntries a1 $ \a1' ->
let {a2' = fromIntegral a2} in
preDoubleArray $ \(a3'1, a3'2) ->
preErrorCheck $ \a4' ->
hestonSlvFdmLogEntriesVarianceGrid'_ a1' a2' a3'1 a3'2 a4' >>
peekRealVector a3'1 a3'2>>= \a3'' ->
errorCheck a4'>>
return (a3'')
{-# LINE 428 "./QuantLib/Model.chs" #-}
hestonSlvFdmLogEntriesDensity :: (HestonSLVFDMLogEntries) -> (Word) -> IO ((Word), (Word), (RealVector))
hestonSlvFdmLogEntriesDensity a1 a2 =
withHestonSLVFDMLogEntries a1 $ \a1' ->
let {a2' = fromIntegral a2} in
prePtr $ \a3' ->
prePtr $ \a4' ->
preDoubleArray $ \(a5'1, a5'2) ->
preErrorCheck $ \a6' ->
hestonSlvFdmLogEntriesDensity'_ a1' a2' a3' a4' a5'1 a5'2 a6' >>
peekWord a3'>>= \a3'' ->
peekWord a4'>>= \a4'' ->
peekRealVector a5'1 a5'2>>= \a5'' ->
errorCheck a6'>>
return (a3'', a4'', a5'')
{-# LINE 429 "./QuantLib/Model.chs" #-}
hullWhite :: (GenYieldTermStructure y) -> (Double)
-> (Double)
-> IO ((HullWhite))
hullWhite a1 a2 a3 =
withYieldTermStructure a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
preErrorCheck $ \a4' ->
hullWhite'_ a1' a2' a3' a4' >>= \res ->
peekHullWhite res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 434 "./QuantLib/Model.chs" #-}
convexityBias :: (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> IO ((Double))
convexityBias :: Double -> Double -> Double -> Double -> Double -> IO Double
convexityBias Double
a1 Double
a2 Double
a3 Double
a4 Double
a5 =
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' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
preErrorCheck $ \a6' ->
convexityBias'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = realToFrac res} in
errorCheck a6'>>
return (res')
{-# LINE 445 "./QuantLib/Model.chs" #-}
fixedReversion :: [Bool]
fixedReversion = [True, False]
gsr :: GenYieldTermStructure y -> GenQuote q1 -> [(Day, GenQuote q1)] -> GenQuote q2 -> Double -> IO Gsr
gsr ts initialVol subsequentVols reversion horizon =
qlGsr ts dates (initialVol : vols) [reversion] horizon
where (dates, vols) = unzip subsequentVols
gsrWithReversions :: GenYieldTermStructure y -> (GenQuote q1, GenQuote q2) -> [(Day, (GenQuote q1, GenQuote q2))]
-> Double -> IO Gsr
gsrWithReversions :: forall y q1 q2.
GenYieldTermStructure y
-> (GenQuote q1, GenQuote q2)
-> [(Day, (GenQuote q1, GenQuote q2))]
-> Double
-> IO Gsr
gsrWithReversions GenYieldTermStructure y
ts (GenQuote q1
initialVol, GenQuote q2
initialReversion) [(Day, (GenQuote q1, GenQuote q2))]
steps Double
horizon =
GenYieldTermStructure y
-> [Day] -> [GenQuote q1] -> [GenQuote q2] -> Double -> IO Gsr
forall y q1 q2.
GenYieldTermStructure y
-> [Day] -> [GenQuote q1] -> [GenQuote q2] -> Double -> IO Gsr
qlGsr GenYieldTermStructure y
ts [Day]
dates (GenQuote q1
initialVol GenQuote q1 -> [GenQuote q1] -> [GenQuote q1]
forall a. a -> [a] -> [a]
: [GenQuote q1]
vols) (GenQuote q2
initialReversion GenQuote q2 -> [GenQuote q2] -> [GenQuote q2]
forall a. a -> [a] -> [a]
: [GenQuote q2]
reversions') Double
horizon
where ([Day]
dates, [(GenQuote q1, GenQuote q2)]
pairs) = [(Day, (GenQuote q1, GenQuote q2))]
-> ([Day], [(GenQuote q1, GenQuote q2)])
forall a b. [(a, b)] -> ([a], [b])
unzip [(Day, (GenQuote q1, GenQuote q2))]
steps
([GenQuote q1]
vols, [GenQuote q2]
reversions') = [(GenQuote q1, GenQuote q2)] -> ([GenQuote q1], [GenQuote q2])
forall a b. [(a, b)] -> ([a], [b])
unzip [(GenQuote q1, GenQuote q2)]
pairs
qlGsr :: (GenYieldTermStructure y) -> ([Day])
-> ([GenQuote q1])
-> ([GenQuote q2])
-> (Double)
-> IO ((Gsr))
qlGsr :: forall y q1 q2.
GenYieldTermStructure y
-> [Day] -> [GenQuote q1] -> [GenQuote q2] -> Double -> IO Gsr
qlGsr GenYieldTermStructure y
a1 [Day]
a2 [GenQuote q1]
a3 [GenQuote q2]
a4 Double
a5 =
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO Gsr) -> IO Gsr
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y
a1 ((Ptr CYieldTermStructure' -> IO Gsr) -> IO Gsr)
-> (Ptr CYieldTermStructure' -> IO Gsr) -> IO Gsr
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a1' ->
[Day] -> ((CUInt, Ptr CInt) -> IO Gsr) -> IO Gsr
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a2 (((CUInt, Ptr CInt) -> IO Gsr) -> IO Gsr)
-> ((CUInt, Ptr CInt) -> IO Gsr) -> IO Gsr
forall a b. (a -> b) -> a -> b
$ \(CUInt
a2'1, Ptr CInt
a2'2) ->
withQuoteArray a3 $ \(a3'1, a3'2) ->
withQuoteArray a4 $ \(a4'1, a4'2) ->
let {a5' = realToFrac a5} in
preErrorCheck $ \a6' ->
qlGsr'_ a1' a2'1 a2'2 a3'1 a3'2 a4'1 a4'2 a5' a6' >>= \res ->
peekGsr res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 472 "./QuantLib/Model.chs" #-}
qlGsrVolatility :: (Gsr) -> IO (([Double]))
qlGsrVolatility a1 =
withGenCalibratedModel a1 $ \a1' ->
preDoubleArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
qlGsrVolatility'_ a1' a2'1 a2'2 a3' >>
peekDoubleArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 475 "./QuantLib/Model.chs" #-}
reversions :: (Gsr) -> IO (([Double]))
reversions a1 =
withGenCalibratedModel a1 $ \a1' ->
preDoubleArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
reversions'_ a1' a2'1 a2'2 a3' >>
peekDoubleArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 479 "./QuantLib/Model.chs" #-}
moveVolatility :: (Gsr) -> (Word)
-> IO (([Bool]))
moveVolatility a1 a2 =
withGenCalibratedModel a1 $ \a1' ->
let {a2' = fromIntegral a2} in
preIntArray $ \(a3'1, a3'2) ->
preErrorCheck $ \a4' ->
moveVolatility'_ a1' a2' a3'1 a3'2 a4' >>
peekBoolArray a3'1 a3'2>>= \a3'' ->
errorCheck a4'>>
return (a3'')
{-# LINE 486 "./QuantLib/Model.chs" #-}
moveReversion :: (Gsr) -> (Word)
-> IO (([Bool]))
moveReversion a1 a2 =
withGenCalibratedModel a1 $ \a1' ->
let {a2' = fromIntegral a2} in
preIntArray $ \(a3'1, a3'2) ->
preErrorCheck $ \a4' ->
moveReversion'_ a1' a2' a3'1 a3'2 a4' >>
peekBoolArray a3'1 a3'2>>= \a3'' ->
errorCheck a4'>>
return (a3'')
{-# LINE 493 "./QuantLib/Model.chs" #-}
calibrateVolatilitiesIterative :: (Gsr) -> ([GenBlackCalibrationHelper bch]) -> (OptimizationMethod) -> (EndCriteria) -> (Maybe Constraint) -> ([Double]) -> IO ()
calibrateVolatilitiesIterative a1 a2 a3 a4 a5 a6 =
withGenCalibratedModel a1 $ \a1' ->
withBlackCalibrationHelperArray a2 $ \(a2'1, a2'2) ->
withOptimizationMethod a3 $ \a3' ->
withEndCriteria a4 $ \a4' ->
withMaybeConstraint a5 $ \a5' ->
withDoubleArray a6 $ \(a6'1, a6'2) ->
preErrorCheck $ \a7' ->
calibrateVolatilitiesIterative'_ a1' a2'1 a2'2 a3' a4' a5' a6'1 a6'2 a7' >>
errorCheck a7'>>
return ()
{-# LINE 499 "./QuantLib/Model.chs" #-}
calibrateReversionsIterative :: (Gsr) -> ([GenBlackCalibrationHelper bch]) -> (OptimizationMethod) -> (EndCriteria) -> (Maybe Constraint) -> ([Double]) -> IO ()
calibrateReversionsIterative a1 a2 a3 a4 a5 a6 =
withGenCalibratedModel a1 $ \a1' ->
withBlackCalibrationHelperArray a2 $ \(a2'1, a2'2) ->
withOptimizationMethod a3 $ \a3' ->
withEndCriteria a4 $ \a4' ->
withMaybeConstraint a5 $ \a5' ->
withDoubleArray a6 $ \(a6'1, a6'2) ->
preErrorCheck $ \a7' ->
calibrateReversionsIterative'_ a1' a2'1 a2'2 a3' a4' a5' a6'1 a6'2 a7' >>
errorCheck a7'>>
return ()
{-# LINE 511 "./QuantLib/Model.chs" #-}
markovFunctional :: GenYieldTermStructure y -> Double
-> Double
-> [(Day, Double)]
-> GenSwaptionVolatilityStructure sv
-> NonEmpty (Day, (Word, TimeUnit))
-> GenSwapIndex sidx
-> Word
-> IO MarkovFunctional
markovFunctional :: forall y sv sidx.
GenYieldTermStructure y
-> Double
-> Double
-> [(Day, Double)]
-> GenSwaptionVolatilityStructure sv
-> NonEmpty (Day, (Word, TimeUnit))
-> GenSwapIndex sidx
-> Word
-> IO MarkovFunctional
markovFunctional GenYieldTermStructure y
ts Double
reversion Double
initialVol [(Day, Double)]
steps GenSwaptionVolatilityStructure sv
svol NonEmpty (Day, (Word, TimeUnit))
points = GenYieldTermStructure y
-> Double
-> [Day]
-> [Double]
-> GenSwaptionVolatilityStructure sv
-> [Day]
-> [Word]
-> [TimeUnit]
-> GenSwapIndex sidx
-> Word
-> IO MarkovFunctional
forall y sv sidx.
GenYieldTermStructure y
-> Double
-> [Day]
-> [Double]
-> GenSwaptionVolatilityStructure sv
-> [Day]
-> [Word]
-> [TimeUnit]
-> GenSwapIndex sidx
-> Word
-> IO MarkovFunctional
qlMarkovFunctional GenYieldTermStructure y
ts Double
reversion [Day]
dates (Double
initialVol Double -> [Double] -> [Double]
forall a. a -> [a] -> [a]
: [Double]
vols) GenSwaptionVolatilityStructure sv
svol [Day]
expiries [Word]
tq [TimeUnit]
tu
where ([Day]
dates, [Double]
vols) = [(Day, Double)] -> ([Day], [Double])
forall a b. [(a, b)] -> ([a], [b])
unzip [(Day, Double)]
steps
([Day]
expiries, [(Word, TimeUnit)]
tenors) = [(Day, (Word, TimeUnit))] -> ([Day], [(Word, TimeUnit)])
forall a b. [(a, b)] -> ([a], [b])
unzip (NonEmpty (Day, (Word, TimeUnit)) -> [(Day, (Word, TimeUnit))]
forall a. NonEmpty a -> [a]
toList NonEmpty (Day, (Word, TimeUnit))
points)
([Word]
tq, [TimeUnit]
tu) = [(Word, TimeUnit)] -> ([Word], [TimeUnit])
forall a b. [(a, b)] -> ([a], [b])
unzip [(Word, TimeUnit)]
tenors
qlMarkovFunctional :: (GenYieldTermStructure y) -> (Double) -> ([Day]) -> ([Double]) -> (GenSwaptionVolatilityStructure sv) -> ([Day]) -> ([Word]) -> ([TimeUnit]) -> (GenSwapIndex sidx) -> (Word) -> IO ((MarkovFunctional))
qlMarkovFunctional :: forall y sv sidx.
GenYieldTermStructure y
-> Double
-> [Day]
-> [Double]
-> GenSwaptionVolatilityStructure sv
-> [Day]
-> [Word]
-> [TimeUnit]
-> GenSwapIndex sidx
-> Word
-> IO MarkovFunctional
qlMarkovFunctional GenYieldTermStructure y
a1 Double
a2 [Day]
a3 [Double]
a4 GenSwaptionVolatilityStructure sv
a5 [Day]
a6 [Word]
a7 [TimeUnit]
a8 GenSwapIndex sidx
a9 Word
a10 =
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y
a1 ((Ptr CYieldTermStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional)
-> (Ptr CYieldTermStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
[Day]
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a3 (((CUInt, Ptr CInt) -> IO MarkovFunctional) -> IO MarkovFunctional)
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CInt
a3'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a4 (((CUInt, Ptr CDouble) -> IO MarkovFunctional)
-> IO MarkovFunctional)
-> ((CUInt, Ptr CDouble) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \(CUInt
a4'1, Ptr CDouble
a4'2) ->
GenSwaptionVolatilityStructure sv
-> (Ptr CSwaptionVolatilityStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional
forall sv b.
GenSwaptionVolatilityStructure sv
-> (Ptr CSwaptionVolatilityStructure' -> IO b) -> IO b
withSwaptionVolatilityStructure GenSwaptionVolatilityStructure sv
a5 ((Ptr CSwaptionVolatilityStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional)
-> (Ptr CSwaptionVolatilityStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \Ptr CSwaptionVolatilityStructure'
a5' ->
[Day]
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a6 (((CUInt, Ptr CInt) -> IO MarkovFunctional) -> IO MarkovFunctional)
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \(CUInt
a6'1, Ptr CInt
a6'2) ->
[Word]
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a n b.
(Integral a, Num n, Storable n) =>
[a] -> ((CUInt, Ptr n) -> IO b) -> IO b
withIntArray [Word]
a7 (((CUInt, Ptr CInt) -> IO MarkovFunctional) -> IO MarkovFunctional)
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \(CUInt
a7'1, Ptr CInt
a7'2) ->
[TimeUnit]
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. Enum a => [a] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withEnumArray [TimeUnit]
a8 (((CUInt, Ptr CInt) -> IO MarkovFunctional) -> IO MarkovFunctional)
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \(CUInt
a8'1, Ptr CInt
a8'2) ->
GenSwapIndex sidx
-> (Ptr CSwapIndex' -> IO MarkovFunctional) -> IO MarkovFunctional
forall sidx b.
GenSwapIndex sidx -> (Ptr CSwapIndex' -> IO b) -> IO b
withSwapIndex GenSwapIndex sidx
a9 ((Ptr CSwapIndex' -> IO MarkovFunctional) -> IO MarkovFunctional)
-> (Ptr CSwapIndex' -> IO MarkovFunctional) -> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \Ptr CSwapIndex'
a9' ->
let {a10' :: CUInt
a10' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a10} in
(Ptr (Ptr ()) -> IO MarkovFunctional) -> IO MarkovFunctional
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO MarkovFunctional) -> IO MarkovFunctional)
-> (Ptr (Ptr ()) -> IO MarkovFunctional) -> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a11' ->
Ptr CYieldTermStructure'
-> CDouble
-> CUInt
-> Ptr CInt
-> CUInt
-> Ptr CDouble
-> Ptr CSwaptionVolatilityStructure'
-> CUInt
-> Ptr CInt
-> CUInt
-> Ptr CInt
-> CUInt
-> Ptr CInt
-> Ptr CSwapIndex'
-> CUInt
-> Ptr (Ptr ())
-> IO (Ptr CMarkovFunctional')
qlMarkovFunctional'_ Ptr CYieldTermStructure'
a1' CDouble
a2' CUInt
a3'1 Ptr CInt
a3'2 CUInt
a4'1 Ptr CDouble
a4'2 Ptr CSwaptionVolatilityStructure'
a5' CUInt
a6'1 Ptr CInt
a6'2 CUInt
a7'1 Ptr CInt
a7'2 CUInt
a8'1 Ptr CInt
a8'2 Ptr CSwapIndex'
a9' CUInt
a10' Ptr (Ptr ())
a11' IO (Ptr CMarkovFunctional')
-> (Ptr CMarkovFunctional' -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CMarkovFunctional'
res ->
Ptr CMarkovFunctional' -> IO MarkovFunctional
peekMarkovFunctional Ptr CMarkovFunctional'
res IO MarkovFunctional
-> (MarkovFunctional -> IO MarkovFunctional) -> IO MarkovFunctional
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \MarkovFunctional
res' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a11'IO () -> IO MarkovFunctional -> IO MarkovFunctional
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
MarkovFunctional -> IO MarkovFunctional
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (MarkovFunctional
res')
{-# LINE 533 "./QuantLib/Model.chs" #-}
markovFunctionalCaplet :: GenYieldTermStructure y -> Double -> Double -> [(Day, Double)]
-> GenOptionletVolatilityStructure ov -> NonEmpty Day -> GenIborIndex ibor -> Word -> IO MarkovFunctional
markovFunctionalCaplet ts reversion initialVol steps capletVol expiries ibor gridPoints =
qlMarkovFunctionalCaplet ts reversion dates (initialVol : vols) capletVol (toList expiries) ibor gridPoints
where (dates, vols) = unzip steps
qlMarkovFunctionalCaplet :: (GenYieldTermStructure y) -> (Double)
-> ([Day])
-> ([Double])
-> (GenOptionletVolatilityStructure ov)
-> ([Day])
-> (GenIborIndex ibor)
-> (Word)
-> IO ((MarkovFunctional))
qlMarkovFunctionalCaplet :: forall y ov ibor.
GenYieldTermStructure y
-> Double
-> [Day]
-> [Double]
-> GenOptionletVolatilityStructure ov
-> [Day]
-> GenIborIndex ibor
-> Word
-> IO MarkovFunctional
qlMarkovFunctionalCaplet GenYieldTermStructure y
a1 Double
a2 [Day]
a3 [Double]
a4 GenOptionletVolatilityStructure ov
a5 [Day]
a6 GenIborIndex ibor
a7 Word
a8 =
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y
a1 ((Ptr CYieldTermStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional)
-> (Ptr CYieldTermStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
[Day]
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a3 (((CUInt, Ptr CInt) -> IO MarkovFunctional) -> IO MarkovFunctional)
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CInt
a3'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a4 (((CUInt, Ptr CDouble) -> IO MarkovFunctional)
-> IO MarkovFunctional)
-> ((CUInt, Ptr CDouble) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \(CUInt
a4'1, Ptr CDouble
a4'2) ->
GenOptionletVolatilityStructure ov
-> (Ptr COptionletVolatilityStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional
forall ov b.
GenOptionletVolatilityStructure ov
-> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b
withOptionletVolatilityStructure GenOptionletVolatilityStructure ov
a5 ((Ptr COptionletVolatilityStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional)
-> (Ptr COptionletVolatilityStructure' -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \Ptr COptionletVolatilityStructure'
a5' ->
[Day]
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a6 (((CUInt, Ptr CInt) -> IO MarkovFunctional) -> IO MarkovFunctional)
-> ((CUInt, Ptr CInt) -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \(CUInt
a6'1, Ptr CInt
a6'2) ->
GenIborIndex ibor
-> (Ptr CIborIndex' -> IO MarkovFunctional) -> IO MarkovFunctional
forall ibor b.
GenIborIndex ibor -> (Ptr CIborIndex' -> IO b) -> IO b
withIborIndex GenIborIndex ibor
a7 ((Ptr CIborIndex' -> IO MarkovFunctional) -> IO MarkovFunctional)
-> (Ptr CIborIndex' -> IO MarkovFunctional) -> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \a7' ->
let {a8' = fromIntegral a8} in
(Ptr (Ptr ()) -> IO MarkovFunctional) -> IO MarkovFunctional
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO MarkovFunctional) -> IO MarkovFunctional)
-> (Ptr (Ptr ()) -> IO MarkovFunctional) -> IO MarkovFunctional
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a9' ->
qlMarkovFunctionalCaplet'_ a1' CDouble
a2' CUInt
a3'1 Ptr CInt
a3'2 CUInt
a4'1 Ptr CDouble
a4'2 Ptr COptionletVolatilityStructure'
a5' CUInt
a6'1 Ptr CInt
a6'2 Ptr CIborIndex'
a7' CUInt
a8' Ptr (Ptr ())
a9' IO (Ptr CMarkovFunctional')
-> (Ptr CMarkovFunctional' -> IO MarkovFunctional)
-> IO MarkovFunctional
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CMarkovFunctional'
res ->
Ptr CMarkovFunctional' -> IO MarkovFunctional
peekMarkovFunctional Ptr CMarkovFunctional'
res IO MarkovFunctional
-> (MarkovFunctional -> IO MarkovFunctional) -> IO MarkovFunctional
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \MarkovFunctional
res' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a9'IO () -> IO MarkovFunctional -> IO MarkovFunctional
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
MarkovFunctional -> IO MarkovFunctional
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (MarkovFunctional
res')
{-# LINE 548 "./QuantLib/Model.chs" #-}
qlMarkovFunctionalVolatility :: (MarkovFunctional) -> IO (([Double]))
qlMarkovFunctionalVolatility a1 =
withGenCalibratedModel a1 $ \a1' ->
preDoubleArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
qlMarkovFunctionalVolatility'_ a1' a2'1 a2'2 a3' >>
peekDoubleArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 551 "./QuantLib/Model.chs" #-}
discount :: (AffineModel) -> (Double)
-> IO ((Double))
discount a1 a2 =
withStandalone a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
discount'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 558 "./QuantLib/Model.chs" #-}
discountBond :: (AffineModel) -> (Double)
-> (Double)
-> ([Double])
-> IO ((Double))
discountBond :: AffineModel -> Double -> Double -> [Double] -> IO Double
discountBond AffineModel
a1 Double
a2 Double
a3 [Double]
a4 =
AffineModel -> (Ptr CAffineModel' -> IO Double) -> IO Double
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone AffineModel
a1 ((Ptr CAffineModel' -> IO Double) -> IO Double)
-> (Ptr CAffineModel' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CAffineModel'
a1' ->
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
[Double] -> ((CUInt, Ptr CDouble) -> IO Double) -> IO Double
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a4 (((CUInt, Ptr CDouble) -> IO Double) -> IO Double)
-> ((CUInt, Ptr CDouble) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \(CUInt
a4'1, Ptr CDouble
a4'2) ->
(Ptr (Ptr ()) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO Double) -> IO Double)
-> (Ptr (Ptr ()) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a5' ->
Ptr CAffineModel'
-> CDouble
-> CDouble
-> CUInt
-> Ptr CDouble
-> Ptr (Ptr ())
-> IO CDouble
discountBond'_ Ptr CAffineModel'
a1' CDouble
a2' CDouble
a3' CUInt
a4'1 Ptr CDouble
a4'2 Ptr (Ptr ())
a5' 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 ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a5'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 569 "./QuantLib/Model.chs" #-}
discountBondOption_ :: (AffineModel) -> (OptionType)
-> (Double)
-> (Double)
-> (Bool)
-> (Double)
-> (Double)
-> IO ((Double))
discountBondOption_ a1 a2 a3 a4 a5 a6 a7 =
withStandalone a1 $ \a1' ->
let {a2' = fromEnumC a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = C2HSImp.fromBool a5} in
let {a6' = realToFrac a6} in
let {a7' = realToFrac a7} in
preErrorCheck $ \a8' ->
discountBondOption_'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
let {res' = realToFrac res} in
errorCheck a8'>>
return (res')
{-# LINE 578 "./QuantLib/Model.chs" #-}
discountBondOption :: AffineModel -> OptionType -> Double -> Double -> Maybe Double -> Double -> IO Double
discountBondOption model typ strike maturity bondStart bondMaturity =
discountBondOption_ model typ strike maturity (maybe False (const True) bondStart) (fromMaybe 0 bondStart) bondMaturity
numeraire :: (Gaussian1dModel) -> (Day)
-> (Double)
-> (Maybe (GenYieldTermStructure y))
-> IO ((Double))
numeraire :: forall y.
Gaussian1dModel
-> Day -> Double -> Maybe (GenYieldTermStructure y) -> IO Double
numeraire Gaussian1dModel
a1 Day
a2 Double
a3 Maybe (GenYieldTermStructure y)
a4 =
Gaussian1dModel
-> (Ptr CGaussian1dModel' -> IO Double) -> IO Double
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone Gaussian1dModel
a1 ((Ptr CGaussian1dModel' -> IO Double) -> IO Double)
-> (Ptr CGaussian1dModel' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CGaussian1dModel'
a1' ->
Day -> (CInt -> IO Double) -> IO Double
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a2 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a2' ->
let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in
Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO Double) -> IO Double
forall y b.
Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withMaybeYieldTermStructure Maybe (GenYieldTermStructure y)
a4 ((Ptr CYieldTermStructure' -> IO Double) -> IO Double)
-> (Ptr CYieldTermStructure' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a4' ->
(Ptr (Ptr ()) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO Double) -> IO Double)
-> (Ptr (Ptr ()) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a5' ->
Ptr CGaussian1dModel'
-> CInt
-> CDouble
-> Ptr CYieldTermStructure'
-> Ptr (Ptr ())
-> IO CDouble
numeraire'_ Ptr CGaussian1dModel'
a1' CInt
a2' CDouble
a3' Ptr CYieldTermStructure'
a4' Ptr (Ptr ())
a5' 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 ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a5'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 594 "./QuantLib/Model.chs" #-}
gaussian1dZerobond :: (Gaussian1dModel) -> (Day)
-> (Maybe Day)
-> (Double)
-> (Maybe (GenYieldTermStructure y))
-> IO ((Double))
gaussian1dZerobond a1 a2 a3 a4 a5 =
withStandalone a1 $ \a1' ->
withDay a2 $ \a2' ->
withMaybeDay a3 $ \a3' ->
let {a4' = realToFrac a4} in
withMaybeYieldTermStructure a5 $ \a5' ->
preErrorCheck $ \a6' ->
gaussian1dZerobond'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = realToFrac res} in
errorCheck a6'>>
return (res')
{-# LINE 604 "./QuantLib/Model.chs" #-}
gaussian1dZerobondOption :: (Gaussian1dModel) -> (OptionType)
-> (Day)
-> (Day)
-> (Day)
-> (Double)
-> (Maybe Day)
-> (Double)
-> (Maybe (GenYieldTermStructure y))
-> (Double)
-> (Word)
-> (Bool)
-> (Bool)
-> IO ((Double))
gaussian1dZerobondOption :: forall y.
Gaussian1dModel
-> OptionType
-> Day
-> Day
-> Day
-> Double
-> Maybe Day
-> Double
-> Maybe (GenYieldTermStructure y)
-> Double
-> Word
-> Bool
-> Bool
-> IO Double
gaussian1dZerobondOption Gaussian1dModel
a1 OptionType
a2 Day
a3 Day
a4 Day
a5 Double
a6 Maybe Day
a7 Double
a8 Maybe (GenYieldTermStructure y)
a9 Double
a10 Word
a11 Bool
a12 Bool
a13 =
Gaussian1dModel
-> (Ptr CGaussian1dModel' -> IO Double) -> IO Double
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone Gaussian1dModel
a1 ((Ptr CGaussian1dModel' -> IO Double) -> IO Double)
-> (Ptr CGaussian1dModel' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CGaussian1dModel'
a1' ->
let {a2' :: CInt
a2' = OptionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC OptionType
a2} in
Day -> (CInt -> IO Double) -> IO Double
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a3' ->
Day -> (CInt -> IO Double) -> IO Double
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a4 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
Day -> (CInt -> IO Double) -> IO Double
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a5 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a5' ->
let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in
Maybe Day -> (CInt -> IO Double) -> IO Double
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a7 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a7' ->
let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in
Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO Double) -> IO Double
forall y b.
Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withMaybeYieldTermStructure Maybe (GenYieldTermStructure y)
a9 ((Ptr CYieldTermStructure' -> IO Double) -> IO Double)
-> (Ptr CYieldTermStructure' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a9' ->
let {a10' :: CDouble
a10' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a10} in
let {a11' :: CUInt
a11' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a11} in
let {a12' :: CInt
a12' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a12} in
let {a13' :: CInt
a13' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a13} in
(Ptr (Ptr ()) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO Double) -> IO Double)
-> (Ptr (Ptr ()) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a14' ->
Ptr CGaussian1dModel'
-> CInt
-> CInt
-> CInt
-> CInt
-> CDouble
-> CInt
-> CDouble
-> Ptr CYieldTermStructure'
-> CDouble
-> CUInt
-> CInt
-> CInt
-> Ptr (Ptr ())
-> IO CDouble
gaussian1dZerobondOption'_ Ptr CGaussian1dModel'
a1' CInt
a2' CInt
a3' CInt
a4' CInt
a5' CDouble
a6' CInt
a7' CDouble
a8' Ptr CYieldTermStructure'
a9' CDouble
a10' CUInt
a11' CInt
a12' CInt
a13' Ptr (Ptr ())
a14' 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 ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a14'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 625 "./QuantLib/Model.chs" #-}
gaussian1dForwardRate :: (Gaussian1dModel) -> (Day)
-> (Maybe Day)
-> (Double)
-> (Maybe (GenIborIndex ibor))
-> IO ((Double))
gaussian1dForwardRate a1 a2 a3 a4 a5 =
withStandalone a1 $ \a1' ->
withDay a2 $ \a2' ->
withMaybeDay a3 $ \a3' ->
let {a4' = realToFrac a4} in
withMaybeIborIndex a5 $ \a5' ->
preErrorCheck $ \a6' ->
gaussian1dForwardRate'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = realToFrac res} in
errorCheck a6'>>
return (res')
{-# LINE 635 "./QuantLib/Model.chs" #-}
gaussian1dSwapRate :: (Gaussian1dModel) -> (Day)
-> ((Int,TimeUnit))
-> (Maybe Day)
-> (Double)
-> (Maybe (GenSwapIndex sidx))
-> IO ((Double))
gaussian1dSwapRate a1 a2 a3 a4 a5 a6 =
withStandalone a1 $ \a1' ->
withDay a2 $ \a2' ->
let {(a3'1, a3'2) = fromEnumQuantity a3} in
withMaybeDay a4 $ \a4' ->
let {a5' = realToFrac a5} in
withMaybeSwapIndex a6 $ \a6' ->
preErrorCheck $ \a7' ->
gaussian1dSwapRate'_ a1' a2' a3'1 a3'2 a4' a5' a6' a7' >>= \res ->
let {res' = realToFrac res} in
errorCheck a7'>>
return (res')
{-# LINE 645 "./QuantLib/Model.chs" #-}
gaussian1dSwapAnnuity :: (Gaussian1dModel) -> (Day)
-> ((Int,TimeUnit))
-> (Maybe Day)
-> (Double)
-> (Maybe (GenSwapIndex sidx))
-> IO ((Double))
gaussian1dSwapAnnuity a1 a2 a3 a4 a5 a6 =
withStandalone a1 $ \a1' ->
withDay a2 $ \a2' ->
let {(a3'1, a3'2) = fromEnumQuantity a3} in
withMaybeDay a4 $ \a4' ->
let {a5' = realToFrac a5} in
withMaybeSwapIndex a6 $ \a6' ->
preErrorCheck $ \a7' ->
gaussian1dSwapAnnuity'_ a1' a2' a3'1 a3'2 a4' a5' a6' a7' >>= \res ->
let {res' = realToFrac res} in
errorCheck a7'>>
return (res')
{-# LINE 656 "./QuantLib/Model.chs" #-}
gaussian1dYGrid :: (Gaussian1dModel) -> (Double)
-> (Int)
-> (Double)
-> (Double)
-> (Double)
-> IO ((RealVector))
gaussian1dYGrid a1 a2 a3 a4 a5 a6 =
withStandalone a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = fromIntegral a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
preDoubleArray $ \(a7'1, a7'2) ->
preErrorCheck $ \a8' ->
gaussian1dYGrid'_ a1' a2' a3' a4' a5' a6' a7'1 a7'2 a8' >>
peekRealVector a7'1 a7'2>>= \a7'' ->
errorCheck a8'>>
return (a7'')
{-# LINE 668 "./QuantLib/Model.chs" #-}
stateProcess :: (Gaussian1dModel) -> IO ((StochasticProcess1D))
stateProcess a1 =
withStandalone a1 $ \a1' ->
preErrorCheck $ \a2' ->
stateProcess'_ a1' a2' >>= \res ->
peekStochasticProcess1D res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 671 "./QuantLib/Model.chs" #-}
class HasLeverageFunction a where
leverageFunction :: a -> IO LocalVolTermStructure
instance HasLeverageFunction HestonSLVMCModel where
leverageFunction = qlHestonSLVMCModelLeverageFunction
instance HasLeverageFunction HestonSLVFDMModel where
leverageFunction = qlHestonSLVFDMModelLeverageFunction
class HasVolatilities a where
volatilities :: a -> IO [Double]
instance HasVolatilities Gsr where
volatilities :: Gsr -> IO [Double]
volatilities = Gsr -> IO [Double]
qlGsrVolatility
instance HasVolatilities MarkovFunctional where
volatilities :: MarkovFunctional -> IO [Double]
volatilities = MarkovFunctional -> IO [Double]
qlMarkovFunctionalVolatility
varianceGammaModel :: (VarianceGammaProcess) -> IO ((CalibratedModel))
varianceGammaModel :: VarianceGammaProcess -> IO CalibratedModel
varianceGammaModel VarianceGammaProcess
a1 =
VarianceGammaProcess
-> (Ptr CVarianceGammaProcess' -> IO CalibratedModel)
-> IO CalibratedModel
forall p1d b.
GenStochasticProcess1D (ForeignPtr p1d)
-> (Ptr p1d -> IO b) -> IO b
withGenStochasticProcess1D VarianceGammaProcess
a1 ((Ptr CVarianceGammaProcess' -> IO CalibratedModel)
-> IO CalibratedModel)
-> (Ptr CVarianceGammaProcess' -> IO CalibratedModel)
-> IO CalibratedModel
forall a b. (a -> b) -> a -> b
$ \Ptr CVarianceGammaProcess'
a1' ->
(Ptr (Ptr ()) -> IO CalibratedModel) -> IO CalibratedModel
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO CalibratedModel) -> IO CalibratedModel)
-> (Ptr (Ptr ()) -> IO CalibratedModel) -> IO CalibratedModel
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a2' ->
Ptr CVarianceGammaProcess'
-> Ptr (Ptr ()) -> IO (Ptr CCalibratedModel')
varianceGammaModel'_ Ptr CVarianceGammaProcess'
a1' Ptr (Ptr ())
a2' IO (Ptr CCalibratedModel')
-> (Ptr CCalibratedModel' -> IO CalibratedModel)
-> IO CalibratedModel
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CCalibratedModel'
res ->
Ptr CCalibratedModel' -> IO CalibratedModel
peekCalibratedModel Ptr CCalibratedModel'
res IO CalibratedModel
-> (CalibratedModel -> IO CalibratedModel) -> IO CalibratedModel
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CalibratedModel
res' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a2'IO () -> IO CalibratedModel -> IO CalibratedModel
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
CalibratedModel -> IO CalibratedModel
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (CalibratedModel
res')
{-# LINE 690 "./QuantLib/Model.chs" #-}
vasicek :: (Double)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> IO ((OneFactorAffineModel))
vasicek :: Double
-> Double -> Double -> Double -> Double -> IO OneFactorAffineModel
vasicek Double
a1 Double
a2 Double
a3 Double
a4 Double
a5 =
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
LmCorrelationModel
a3 :: Double
a3 :: LmCorrelationModel
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
(Ptr (Ptr ()) -> IO OneFactorAffineModel)
-> IO OneFactorAffineModel
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO OneFactorAffineModel)
-> IO OneFactorAffineModel)
-> (Ptr (Ptr ()) -> IO OneFactorAffineModel)
-> IO OneFactorAffineModel
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a6' ->
CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> Ptr (Ptr ())
-> IO (Ptr COneFactorAffineModel')
vasicek'_ CDouble
a1' CDouble
a2' CDouble
a3' CDouble
a4' CDouble
a5' Ptr (Ptr ())
a6' IO (Ptr COneFactorAffineModel')
-> (Ptr COneFactorAffineModel' -> IO OneFactorAffineModel)
-> IO OneFactorAffineModel
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr COneFactorAffineModel'
res ->
Ptr COneFactorAffineModel' -> IO OneFactorAffineModel
peekOneFactorAffineModel res >>= \OneFactorAffineModel
res' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a6'IO () -> IO OneFactorAffineModel -> IO OneFactorAffineModel
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
OneFactorAffineModel -> IO OneFactorAffineModel
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (OneFactorAffineModel
res')
{-# LINE 698 "./QuantLib/Model.chs" #-}
liborForwardModel :: (LiborForwardModelProcess) -> (LmVolatilityModel) -> (LmCorrelationModel) -> IO ((LiborForwardModel))
liborForwardModel a1 a2 a3 =
withGenStochasticProcess a1 $ \a1' ->
withLmVolatilityModel a2 $ \a2' ->
withLmCorrelationModel a3 $ \a3' ->
preErrorCheck $ \a4' ->
liborForwardModel'_ a1' a2' a3' a4' >>= \res ->
peekLiborForwardModel res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 701 "./QuantLib/Model.chs" #-}
liborForwardModelS0 :: (LiborForwardModel) -> (Word)
-> (Word)
-> IO ((Double))
liborForwardModelS0 a1 a2 a3 =
withGenCalibratedModel a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
preErrorCheck $ \a4' ->
liborForwardModelS0'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 708 "./QuantLib/Model.chs" #-}
lfmHullWhiteParameterization :: LiborForwardModelProcess -> GenOptionletVolatilityStructure ov
-> Matrix Double
-> Word
-> IO LfmHullWhiteParameterization
lfmHullWhiteParameterization process capletVol (Matrix rows cols values) factors = qlLfmHullWhiteParameterization process capletVol rows cols values factors
qlLfmHullWhiteParameterization :: (LiborForwardModelProcess)
-> (GenOptionletVolatilityStructure ov)
-> (Word)
-> (Word)
-> ([Double])
-> (Word)
-> IO ((LfmHullWhiteParameterization))
qlLfmHullWhiteParameterization :: forall ov.
LiborForwardModelProcess
-> GenOptionletVolatilityStructure ov
-> Word
-> Word
-> [Double]
-> Word
-> IO LfmHullWhiteParameterization
qlLfmHullWhiteParameterization LiborForwardModelProcess
a1 GenOptionletVolatilityStructure ov
a2 Word
a3 Word
a4 [Double]
a5 Word
a6 =
LiborForwardModelProcess
-> (Ptr CLiborForwardModelProcess'
-> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization
forall p b.
GenStochasticProcess (ForeignPtr p) -> (Ptr p -> IO b) -> IO b
withGenStochasticProcess LiborForwardModelProcess
a1 ((Ptr CLiborForwardModelProcess'
-> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization)
-> (Ptr CLiborForwardModelProcess'
-> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization
forall a b. (a -> b) -> a -> b
$ \Ptr CLiborForwardModelProcess'
a1' ->
GenOptionletVolatilityStructure ov
-> (Ptr COptionletVolatilityStructure'
-> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization
forall ov b.
GenOptionletVolatilityStructure ov
-> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b
withOptionletVolatilityStructure GenOptionletVolatilityStructure ov
a2 ((Ptr COptionletVolatilityStructure'
-> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization)
-> (Ptr COptionletVolatilityStructure'
-> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization
forall a b. (a -> b) -> a -> b
$ \Ptr COptionletVolatilityStructure'
a2' ->
let {a3' :: CUInt
a3' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a3} in
let {a4' :: CUInt
a4' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a4} in
[Double]
-> (Ptr CDouble -> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization
forall b. [Double] -> (Ptr CDouble -> IO b) -> IO b
withDoubleArrayRaw [Double]
a5 ((Ptr CDouble -> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization)
-> (Ptr CDouble -> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization
forall a b. (a -> b) -> a -> b
$ \Ptr CDouble
a5' ->
let {a6' :: CUInt
a6' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a6} in
(Ptr (Ptr ()) -> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization)
-> (Ptr (Ptr ()) -> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a7' ->
Ptr CLiborForwardModelProcess'
-> Ptr COptionletVolatilityStructure'
-> CUInt
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr (Ptr ())
-> IO (Ptr CLfmHullWhiteParameterization)
qlLfmHullWhiteParameterization'_ Ptr CLiborForwardModelProcess'
a1' Ptr COptionletVolatilityStructure'
a2' CUInt
a3' CUInt
a4' Ptr CDouble
a5' CUInt
a6' Ptr (Ptr ())
a7' IO (Ptr CLfmHullWhiteParameterization)
-> (Ptr CLfmHullWhiteParameterization
-> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CLfmHullWhiteParameterization
res ->
Ptr CLfmHullWhiteParameterization
-> IO LfmHullWhiteParameterization
peekLfmHullWhiteParameterization Ptr CLfmHullWhiteParameterization
res IO LfmHullWhiteParameterization
-> (LfmHullWhiteParameterization
-> IO LfmHullWhiteParameterization)
-> IO LfmHullWhiteParameterization
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \LfmHullWhiteParameterization
res' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a7'IO ()
-> IO LfmHullWhiteParameterization
-> IO LfmHullWhiteParameterization
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
LfmHullWhiteParameterization -> IO LfmHullWhiteParameterization
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (LfmHullWhiteParameterization
res')
{-# LINE 724 "./QuantLib/Model.chs" #-}
setCovarParam :: (LiborForwardModelProcess)
-> (LfmHullWhiteParameterization)
-> IO ()
setCovarParam a1 a2 =
withGenStochasticProcess a1 $ \a1' ->
withStandalone a2 $ \a2' ->
preErrorCheck $ \a3' ->
setCovarParam'_ a1' a2' a3' >>
errorCheck a3'>>
return ()
{-# LINE 736 "./QuantLib/Model.chs" #-}
lfmHullWhiteCovariance :: LfmHullWhiteParameterization -> Double -> [Double] -> IO (Matrix Double)
lfmHullWhiteCovariance p t x = toMatrixDouble <$> qlLfmHullWhiteCovariance p t x
where toMatrixDouble (r, c, d) = Matrix r c d
qlLfmHullWhiteCovariance :: (LfmHullWhiteParameterization)
-> (Double)
-> ([Double])
-> IO ((Word), (Word), ([Double]))
qlLfmHullWhiteCovariance :: LfmHullWhiteParameterization
-> Double -> [Double] -> IO (Word, Word, [Double])
qlLfmHullWhiteCovariance LfmHullWhiteParameterization
a1 Double
a2 [Double]
a3 =
LfmHullWhiteParameterization
-> (Ptr CLfmHullWhiteParameterization -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone LfmHullWhiteParameterization
a1 ((Ptr CLfmHullWhiteParameterization -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> (Ptr CLfmHullWhiteParameterization -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr CLfmHullWhiteParameterization
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 b. ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO b) -> IO b
preDoubleArray (((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 ()) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double]))
-> (Ptr (Ptr ()) -> IO (Word, Word, [Double]))
-> IO (Word, Word, [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a7' ->
Ptr CLfmHullWhiteParameterization
-> CDouble
-> CUInt
-> Ptr CDouble
-> Ptr CUInt
-> Ptr CUInt
-> Ptr CUInt
-> Ptr (Ptr CDouble)
-> Ptr (Ptr ())
-> IO ()
qlLfmHullWhiteCovariance'_ Ptr CLfmHullWhiteParameterization
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 ())
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 ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
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 746 "./QuantLib/Model.chs" #-}
calibrate :: GenCalibratedModel m -> NonEmpty (GenCalibrationHelper ch, Double)
-> OptimizationMethod -> EndCriteria -> Maybe Constraint
-> [Bool]
-> IO ()
calibrate m h o e c fp = qlCalibratedModelCalibrate m hh hw o e c fp where (hh, hw) = unzip (toList h)
qlCalibratedModelCalibrate :: (GenCalibratedModel m) -> ([GenCalibrationHelper ch]) -> ([Double]) -> (OptimizationMethod) -> (EndCriteria) -> (Maybe Constraint) -> ([Bool]) -> IO ()
qlCalibratedModelCalibrate a1 a2 a3 a4 a5 a6 a7 =
withCalibratedModel a1 $ \a1' ->
withCalibrationHelperArray a2 $ \(a2'1, a2'2) ->
withDoubleArray a3 $ \(a3'1, a3'2) ->
withOptimizationMethod a4 $ \a4' ->
withEndCriteria a5 $ \a5' ->
withMaybeConstraint a6 $ \a6' ->
withBoolArray a7 $ \(a7'1, a7'2) ->
preErrorCheck $ \a8' ->
qlCalibratedModelCalibrate'_ a1' a2'1 a2'2 a3'1 a3'2 a4' a5' a6' a7'1 a7'2 a8' >>
errorCheck a8'>>
return ()
{-# LINE 756 "./QuantLib/Model.chs" #-}
value :: (GenCalibratedModel m) -> ([Double]) -> ([GenCalibrationHelper ch]) -> IO ((Double))
value a1 a2 a3 =
withCalibratedModel a1 $ \a1' ->
withDoubleArray a2 $ \(a2'1, a2'2) ->
withCalibrationHelperArray a3 $ \(a3'1, a3'2) ->
preErrorCheck $ \a4' ->
value'_ a1' a2'1 a2'2 a3'1 a3'2 a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 759 "./QuantLib/Model.chs" #-}
capHelper :: ((Word,TimeUnit))
-> (GenQuote q)
-> (GenIborIndex ibor) -> (Frequency)
-> (DayCounter) -> (Bool)
-> (GenYieldTermStructure y) -> (CalibrationErrorType) -> (VolatilityType)
-> (Double)
-> IO ((BlackCalibrationHelper))
capHelper a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
let {(a1'1, a1'2) = fromEnumQuantity a1} in
withQuote a2 $ \a2' ->
withIborIndex a3 $ \a3' ->
let {a4' = (fromIntegral . fromEnum) a4} in
withDayCounter a5 $ \a5' ->
let {a6' = C2HSImp.fromBool a6} in
withYieldTermStructure a7 $ \a7' ->
let {a8' = (fromIntegral . fromEnum) a8} in
let {a9' = (fromIntegral . fromEnum) a9} in
let {a10' = realToFrac a10} in
preErrorCheck $ \a11' ->
capHelper'_ a1'1 a1'2 a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
peekBlackCalibrationHelper res >>= \res' ->
errorCheck a11'>>
return (res')
{-# LINE 769 "./QuantLib/Model.chs" #-}
hestonModelHelper :: ((Word,TimeUnit))
-> (Calendar) -> (GenQuote q1)
-> (Double)
-> (GenQuote q2)
-> (GenYieldTermStructure y1)
-> (GenYieldTermStructure y2)
-> (CalibrationErrorType) -> IO ((BlackCalibrationHelper))
hestonModelHelper a1 a2 a3 a4 a5 a6 a7 a8 =
let {(a1'1, a1'2) = fromEnumQuantity a1} in
withCalendar a2 $ \a2' ->
withQuote a3 $ \a3' ->
let {a4' = realToFrac a4} in
withQuote a5 $ \a5' ->
withYieldTermStructure a6 $ \a6' ->
withYieldTermStructure a7 $ \a7' ->
let {a8' = (fromIntegral . fromEnum) a8} in
preErrorCheck $ \a9' ->
hestonModelHelper'_ a1'1 a1'2 a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
peekBlackCalibrationHelper res >>= \res' ->
errorCheck a9'>>
return (res')
{-# LINE 778 "./QuantLib/Model.chs" #-}
data SwaptionSpan
= SpanTenors !(Word, TimeUnit) !(Word, TimeUnit)
| SpanFromDate !Day !(Word, TimeUnit)
| SpanDates !Day !Day
deriving (Eq, Show)
swaptionHelper :: SwaptionSpan -> GenQuote q -> GenIborIndex ibor -> (Word, TimeUnit)
-> DayCounter -> DayCounter -> GenYieldTermStructure y -> CalibrationErrorType
-> Maybe Double -> Double -> VolatilityType -> Double -> Maybe Word -> RateAveragingType
-> IO SwaptionHelper
swaptionHelper span' = case span' of
SpanTenors m l -> swaptionHelperTenorsRaw m l
SpanFromDate d l -> swaptionHelperFromDateRaw d l
SpanDates d e -> swaptionHelperFromDatesRaw d e
swaptionHelperTenorsRaw :: ((Word,TimeUnit))
-> ((Word,TimeUnit))
-> (GenQuote q)
-> (GenIborIndex ibor) -> ((Word,TimeUnit))
-> (DayCounter)
-> (DayCounter)
-> (GenYieldTermStructure y) -> (CalibrationErrorType) -> (Maybe Double)
-> (Double)
-> (VolatilityType)
-> (Double)
-> (Maybe Word)
-> (RateAveragingType)
-> IO ((SwaptionHelper))
swaptionHelperTenorsRaw :: forall q ibor y.
(Word, TimeUnit)
-> (Word, TimeUnit)
-> GenQuote q
-> GenIborIndex ibor
-> (Word, TimeUnit)
-> DayCounter
-> DayCounter
-> GenYieldTermStructure y
-> CalibrationErrorType
-> Maybe Double
-> Double
-> VolatilityType
-> Double
-> Maybe Word
-> RateAveragingType
-> IO SwaptionHelper
swaptionHelperTenorsRaw (Word, TimeUnit)
a1 (Word, TimeUnit)
a2 GenQuote q
a3 GenIborIndex ibor
a4 (Word, TimeUnit)
a5 DayCounter
a6 DayCounter
a7 GenYieldTermStructure y
a8 CalibrationErrorType
a9 Maybe Double
a10 Double
a11 VolatilityType
a12 Double
a13 Maybe Word
a14 RateAveragingType
a15 =
let {(CInt
a1'1, CInt
a1'2) = (Word, TimeUnit) -> (CInt, CInt)
forall a b c.
(Enum a, Integral b, Integral c) =>
(b, a) -> (CInt, c)
fromEnumQuantity (Word, TimeUnit)
a1} in
let {(CInt
a2'1, CInt
a2'2) = (Word, TimeUnit) -> (CInt, CInt)
forall a b c.
(Enum a, Integral b, Integral c) =>
(b, a) -> (CInt, c)
fromEnumQuantity (Word, TimeUnit)
a2} in
GenQuote q
-> (Ptr CQuote' -> IO SwaptionHelper) -> IO SwaptionHelper
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q
a3 ((Ptr CQuote' -> IO SwaptionHelper) -> IO SwaptionHelper)
-> (Ptr CQuote' -> IO SwaptionHelper) -> IO SwaptionHelper
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a3' ->
GenIborIndex ibor
-> (Ptr CIborIndex' -> IO SwaptionHelper) -> IO SwaptionHelper
forall ibor b.
GenIborIndex ibor -> (Ptr CIborIndex' -> IO b) -> IO b
withIborIndex GenIborIndex ibor
a4 ((Ptr CIborIndex' -> IO SwaptionHelper) -> IO SwaptionHelper)
-> (Ptr CIborIndex' -> IO SwaptionHelper) -> IO SwaptionHelper
forall a b. (a -> b) -> a -> b
$ \Ptr CIborIndex'
a4' ->
let {(CInt
a5'1, CInt
a5'2) = (Word, TimeUnit) -> (CInt, CInt)
forall a b c.
(Enum a, Integral b, Integral c) =>
(b, a) -> (CInt, c)
fromEnumQuantity (Word, TimeUnit)
a5} in
DayCounter
-> (Ptr CDayCounter -> IO SwaptionHelper) -> IO SwaptionHelper
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a6 ((Ptr CDayCounter -> IO SwaptionHelper) -> IO SwaptionHelper)
-> (Ptr CDayCounter -> IO SwaptionHelper) -> IO SwaptionHelper
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a6' ->
DayCounter
-> (Ptr CDayCounter -> IO SwaptionHelper) -> IO SwaptionHelper
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a7 ((Ptr CDayCounter -> IO SwaptionHelper) -> IO SwaptionHelper)
-> (Ptr CDayCounter -> IO SwaptionHelper) -> IO SwaptionHelper
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a7' ->
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO SwaptionHelper)
-> IO SwaptionHelper
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y
a8 ((Ptr CYieldTermStructure' -> IO SwaptionHelper)
-> IO SwaptionHelper)
-> (Ptr CYieldTermStructure' -> IO SwaptionHelper)
-> IO SwaptionHelper
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a8' ->
let {a9' :: CInt
a9' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (CalibrationErrorType -> Int) -> CalibrationErrorType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CalibrationErrorType -> Int
forall a. Enum a => a -> Int
fromEnum) CalibrationErrorType
a9} in
let {a10' :: CDouble
a10' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a10} in
let {a11' :: CDouble
a11' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a11} in
let {a12' :: CInt
a12' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (VolatilityType -> Int) -> VolatilityType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VolatilityType -> Int
forall a. Enum a => a -> Int
fromEnum) VolatilityType
a12} in
let {a13' :: CDouble
a13' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a13} in
let {a14' :: CUInt
a14' = Maybe Word -> CUInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Word
a14} in
let {a15' :: CInt
a15' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (RateAveragingType -> Int) -> RateAveragingType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RateAveragingType -> Int
forall a. Enum a => a -> Int
fromEnum) RateAveragingType
a15} in
(Ptr (Ptr ()) -> IO SwaptionHelper) -> IO SwaptionHelper
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO SwaptionHelper) -> IO SwaptionHelper)
-> (Ptr (Ptr ()) -> IO SwaptionHelper) -> IO SwaptionHelper
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a16' ->
CInt
-> CInt
-> CInt
-> CInt
-> Ptr CQuote'
-> Ptr CIborIndex'
-> CInt
-> CInt
-> Ptr CDayCounter
-> Ptr CDayCounter
-> Ptr CYieldTermStructure'
-> CInt
-> CDouble
-> CDouble
-> CInt
-> CDouble
-> CUInt
-> CInt
-> Ptr (Ptr ())
-> IO (Ptr CSwaptionHelper')
swaptionHelperTenorsRaw'_ CInt
a1'1 CInt
a1'2 CInt
a2'1 CInt
a2'2 Ptr CQuote'
a3' Ptr CIborIndex'
a4' CInt
a5'1 CInt
a5'2 Ptr CDayCounter
a6' Ptr CDayCounter
a7' Ptr CYieldTermStructure'
a8' CInt
a9' CDouble
a10' CDouble
a11' CInt
a12' CDouble
a13' CUInt
a14' CInt
a15' Ptr (Ptr ())
a16' IO (Ptr CSwaptionHelper')
-> (Ptr CSwaptionHelper' -> IO SwaptionHelper) -> IO SwaptionHelper
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CSwaptionHelper'
res ->
Ptr CSwaptionHelper' -> IO SwaptionHelper
peekSwaptionHelper Ptr CSwaptionHelper'
res IO SwaptionHelper
-> (SwaptionHelper -> IO SwaptionHelper) -> IO SwaptionHelper
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \SwaptionHelper
res' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a16'IO () -> IO SwaptionHelper -> IO SwaptionHelper
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
SwaptionHelper -> IO SwaptionHelper
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (SwaptionHelper
res')
{-# LINE 810 "./QuantLib/Model.chs" #-}
swaptionHelperFromDateRaw :: (Day)
-> ((Word,TimeUnit))
-> (GenQuote q)
-> (GenIborIndex ibor) -> ((Word,TimeUnit))
-> (DayCounter)
-> (DayCounter)
-> (GenYieldTermStructure y) -> (CalibrationErrorType) -> (Maybe Double)
-> (Double)
-> (VolatilityType)
-> (Double)
-> (Maybe Word)
-> (RateAveragingType)
-> IO ((SwaptionHelper))
swaptionHelperFromDateRaw a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 =
withDay a1 $ \a1' ->
let {(a2'1, a2'2) = fromEnumQuantity a2} in
withQuote a3 $ \a3' ->
withIborIndex a4 $ \a4' ->
let {(a5'1, a5'2) = fromEnumQuantity a5} in
withDayCounter a6 $ \a6' ->
withDayCounter a7 $ \a7' ->
withYieldTermStructure a8 $ \a8' ->
let {a9' = (fromIntegral . fromEnum) a9} in
let {a10' = fromMaybeDouble a10} in
let {a11' = realToFrac a11} in
let {a12' = (fromIntegral . fromEnum) a12} in
let {a13' = realToFrac a13} in
let {a14' = fromMaybeInt a14} in
let {a15' = (fromIntegral . fromEnum) a15} in
preErrorCheck $ \a16' ->
swaptionHelperFromDateRaw'_ a1' a2'1 a2'2 a3' a4' a5'1 a5'2 a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' a16' >>= \res ->
peekSwaptionHelper res >>= \res' ->
errorCheck a16'>>
return (res')
{-# LINE 826 "./QuantLib/Model.chs" #-}
swaptionHelperFromDatesRaw :: (Day)
-> (Day)
-> (GenQuote q)
-> (GenIborIndex ibor) -> ((Word,TimeUnit))
-> (DayCounter)
-> (DayCounter)
-> (GenYieldTermStructure y) -> (CalibrationErrorType) -> (Maybe Double)
-> (Double)
-> (VolatilityType)
-> (Double)
-> (Maybe Word)
-> (RateAveragingType)
-> IO ((SwaptionHelper))
swaptionHelperFromDatesRaw a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 =
withDay a1 $ \a1' ->
withDay a2 $ \a2' ->
withQuote a3 $ \a3' ->
withIborIndex a4 $ \a4' ->
let {(a5'1, a5'2) = fromEnumQuantity a5} in
withDayCounter a6 $ \a6' ->
withDayCounter a7 $ \a7' ->
withYieldTermStructure a8 $ \a8' ->
let {a9' = (fromIntegral . fromEnum) a9} in
let {a10' = fromMaybeDouble a10} in
let {a11' = realToFrac a11} in
let {a12' = (fromIntegral . fromEnum) a12} in
let {a13' = realToFrac a13} in
let {a14' = fromMaybeInt a14} in
let {a15' = (fromIntegral . fromEnum) a15} in
preErrorCheck $ \a16' ->
swaptionHelperFromDatesRaw'_ a1' a2' a3' a4' a5'1 a5'2 a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' a16' >>= \res ->
peekSwaptionHelper res >>= \res' ->
errorCheck a16'>>
return (res')
{-# LINE 842 "./QuantLib/Model.chs" #-}
helperSwaption :: (SwaptionHelper) -> IO ((Swaption))
helperSwaption a1 =
withSwaptionHelper a1 $ \a1' ->
preErrorCheck $ \a2' ->
helperSwaption'_ a1' a2' >>= \res ->
peekSwaption res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 845 "./QuantLib/Model.chs" #-}
times :: (GenBlackCalibrationHelper bch) -> IO (([Double]))
times a1 =
withBlackCalibrationHelper a1 $ \a1' ->
preDoubleArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
times'_ a1' a2'1 a2'2 a3' >>
peekDoubleArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 848 "./QuantLib/Model.chs" #-}
params :: (GenCalibratedModel m) -> IO (([Double]))
params a1 =
withCalibratedModel a1 $ \a1' ->
preDoubleArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
params'_ a1' a2'1 a2'2 a3' >>
peekDoubleArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 851 "./QuantLib/Model.chs" #-}
setParams :: (GenCalibratedModel m) -> ([Double])
-> IO ()
setParams a1 a2 =
withCalibratedModel a1 $ \a1' ->
withDoubleArray a2 $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
setParams'_ a1' a2'1 a2'2 a3' >>
errorCheck a3'>>
return ()
{-# LINE 859 "./QuantLib/Model.chs" #-}
blackPrice :: (GenBlackCalibrationHelper bch) -> (Double)
-> IO ((Double))
blackPrice a1 a2 =
withBlackCalibrationHelper a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
blackPrice'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 863 "./QuantLib/Model.chs" #-}
calibrationError :: (GenBlackCalibrationHelper bch) -> IO ((Double))
calibrationError a1 =
withBlackCalibrationHelper a1 $ \a1' ->
preErrorCheck $ \a2' ->
calibrationError'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 866 "./QuantLib/Model.chs" #-}
impliedVolatility :: (GenBlackCalibrationHelper bch) -> (Double)
-> (Double)
-> (Word)
-> (Double)
-> (Double)
-> IO ((Double))
impliedVolatility :: forall bch.
GenBlackCalibrationHelper bch
-> Double -> Double -> Word -> Double -> Double -> IO Double
impliedVolatility GenBlackCalibrationHelper bch
a1 Double
a2 Double
a3 Word
a4 Double
a5 Double
a6 =
GenBlackCalibrationHelper bch
-> (Ptr CBlackCalibrationHelper' -> IO Double) -> IO Double
forall bch b.
GenBlackCalibrationHelper bch
-> (Ptr CBlackCalibrationHelper' -> IO b) -> IO b
withBlackCalibrationHelper GenBlackCalibrationHelper bch
a1 ((Ptr CBlackCalibrationHelper' -> IO Double) -> IO Double)
-> (Ptr CBlackCalibrationHelper' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CBlackCalibrationHelper'
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
let {a3' = realToFrac a3} in
let {a4' = fromIntegral a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
preErrorCheck $ \a7' ->
impliedVolatility'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
let {res' = realToFrac res} in
errorCheck a7'>>
return (res')
{-# LINE 874 "./QuantLib/Model.chs" #-}
marketValue :: (GenBlackCalibrationHelper bch) -> IO ((Double))
marketValue a1 =
withBlackCalibrationHelper a1 $ \a1' ->
preErrorCheck $ \a2' ->
marketValue'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 877 "./QuantLib/Model.chs" #-}
modelValue :: (GenBlackCalibrationHelper bch) -> IO ((Double))
modelValue a1 =
withBlackCalibrationHelper a1 $ \a1' ->
preErrorCheck $ \a2' ->
modelValue'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 880 "./QuantLib/Model.chs" #-}
volatility :: (GenBlackCalibrationHelper bch) -> IO ((Quote))
volatility a1 =
withBlackCalibrationHelper a1 $ \a1' ->
preErrorCheck $ \a2' ->
volatility'_ a1' a2' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 883 "./QuantLib/Model.chs" #-}
setPricingEngine :: (GenBlackCalibrationHelper bch) -> (GenPricingEngine pe) -> IO ()
setPricingEngine a1 a2 =
withBlackCalibrationHelper a1 $ \a1' ->
withPricingEngine a2 $ \a2' ->
preErrorCheck $ \a3' ->
setPricingEngine'_ a1' a2' a3' >>
errorCheck a3'>>
return ()
{-# LINE 886 "./QuantLib/Model.chs" #-}
garch11 :: (Double)
-> (Double)
-> (Double)
-> IO ((Garch11))
garch11 a1 a2 a3 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
preErrorCheck $ \a4' ->
garch11'_ a1' a2' a3' a4' >>= \res ->
peekGarch11 res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 895 "./QuantLib/Model.chs" #-}
garch11Calibrated :: NonEmpty (Day, Double)
-> Garch11Mode -> IO Garch11
garch11Calibrated :: NonEmpty (Day, Double) -> Garch11Mode -> IO Garch11
garch11Calibrated NonEmpty (Day, Double)
series = [Day] -> [Double] -> Garch11Mode -> IO Garch11
qlGarch11Calibrated [Day]
dates [Double]
vals
where ([Day]
dates, [Double]
vals) = [(Day, Double)] -> ([Day], [Double])
forall a b. [(a, b)] -> ([a], [b])
unzip (NonEmpty (Day, Double) -> [(Day, Double)]
forall a. NonEmpty a -> [a]
toList NonEmpty (Day, Double)
series)
qlGarch11Calibrated :: ([Day]) -> ([Double]) -> (Garch11Mode) -> IO ((Garch11))
qlGarch11Calibrated :: [Day] -> [Double] -> Garch11Mode -> IO Garch11
qlGarch11Calibrated [Day]
a1 [Double]
a2 Garch11Mode
a3 =
[Day] -> ((CUInt, Ptr CInt) -> IO Garch11) -> IO Garch11
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a1 (((CUInt, Ptr CInt) -> IO Garch11) -> IO Garch11)
-> ((CUInt, Ptr CInt) -> IO Garch11) -> IO Garch11
forall a b. (a -> b) -> a -> b
$ \(CUInt
a1'1, Ptr CInt
a1'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Garch11) -> IO Garch11
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a2 (((CUInt, Ptr CDouble) -> IO Garch11) -> IO Garch11)
-> ((CUInt, Ptr CDouble) -> IO Garch11) -> IO Garch11
forall a b. (a -> b) -> a -> b
$ \(CUInt
a2'1, Ptr CDouble
a2'2) ->
let {a3' :: CInt
a3' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Garch11Mode -> Int) -> Garch11Mode -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Garch11Mode -> Int
forall a. Enum a => a -> Int
fromEnum) Garch11Mode
a3} in
(Ptr (Ptr ()) -> IO Garch11) -> IO Garch11
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO Garch11) -> IO Garch11)
-> (Ptr (Ptr ()) -> IO Garch11) -> IO Garch11
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a4' ->
CUInt
-> Ptr CInt
-> CUInt
-> Ptr CDouble
-> CInt
-> Ptr (Ptr ())
-> IO (Ptr CGarch11)
qlGarch11Calibrated'_ CUInt
a1'1 Ptr CInt
a1'2 CUInt
a2'1 Ptr CDouble
a2'2 CInt
a3' Ptr (Ptr ())
a4' IO (Ptr CGarch11) -> (Ptr CGarch11 -> IO Garch11) -> IO Garch11
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CGarch11
res ->
Ptr CGarch11 -> IO Garch11
peekGarch11 Ptr CGarch11
res IO Garch11 -> (Garch11 -> IO Garch11) -> IO Garch11
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Garch11
res' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a4'IO () -> IO Garch11 -> IO Garch11
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Garch11 -> IO Garch11
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Garch11
res')
{-# LINE 910 "./QuantLib/Model.chs" #-}
alpha :: (Garch11) -> (Double)
alpha a1 =
C2HSImp.unsafePerformIO $
withGarch11 a1 $ \a1' ->
alpha'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 913 "./QuantLib/Model.chs" #-}
beta :: (Garch11) -> (Double)
beta a1 =
C2HSImp.unsafePerformIO $
withGarch11 a1 $ \a1' ->
beta'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 916 "./QuantLib/Model.chs" #-}
omega :: (Garch11) -> (Double)
omega a1 =
C2HSImp.unsafePerformIO $
withGarch11 a1 $ \a1' ->
omega'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 919 "./QuantLib/Model.chs" #-}
longTermVolatility :: (Garch11) -> (Double)
longTermVolatility a1 =
C2HSImp.unsafePerformIO $
withGarch11 a1 $ \a1' ->
longTermVolatility'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 922 "./QuantLib/Model.chs" #-}
logLikelihood :: (Garch11) -> (Double)
logLikelihood a1 =
C2HSImp.unsafePerformIO $
withGarch11 a1 $ \a1' ->
logLikelihood'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 925 "./QuantLib/Model.chs" #-}
forecast :: (Garch11) -> (Double)
-> (Double)
-> (Double)
forecast a1 a2 a3 =
C2HSImp.unsafePerformIO $
withGarch11 a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
forecast'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 932 "./QuantLib/Model.chs" #-}
calculate :: Garch11 -> NonEmpty (Day, Double)
-> IO [(Day, Double)]
calculate g series = do
(ds, vs) <- qlGarch11Calculate g dates vals
return $ zip ds vs
where (dates, vals) = unzip (toList series)
qlGarch11Calculate :: (Garch11) -> ([Day]) -> ([Double]) -> IO (([Day]), ([Double]))
qlGarch11Calculate :: Garch11 -> [Day] -> [Double] -> IO ([Day], [Double])
qlGarch11Calculate Garch11
a1 [Day]
a2 [Double]
a3 =
Garch11
-> (Ptr CGarch11 -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall b. Garch11 -> (Ptr CGarch11 -> IO b) -> IO b
withGarch11 Garch11
a1 ((Ptr CGarch11 -> IO ([Day], [Double])) -> IO ([Day], [Double]))
-> (Ptr CGarch11 -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr CGarch11
a1' ->
[Day]
-> ((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a2 (((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a2'1, Ptr CInt
a2'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a3 (((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CDouble
a3'2) ->
((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. ((Ptr CUInt, Ptr (Ptr CInt)) -> IO b) -> IO b
preIntArray (((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a4'1, Ptr (Ptr CInt)
a4'2) ->
((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO b) -> IO b
preDoubleArray (((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a5'1, Ptr (Ptr CDouble)
a5'2) ->
(Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double]))
-> (Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a6' ->
Ptr CGarch11
-> CUInt
-> Ptr CInt
-> CUInt
-> Ptr CDouble
-> Ptr CUInt
-> Ptr (Ptr CInt)
-> Ptr CUInt
-> Ptr (Ptr CDouble)
-> Ptr (Ptr ())
-> IO ()
qlGarch11Calculate'_ Ptr CGarch11
a1' CUInt
a2'1 Ptr CInt
a2'2 CUInt
a3'1 Ptr CDouble
a3'2 Ptr CUInt
a4'1 Ptr (Ptr CInt)
a4'2 Ptr CUInt
a5'1 Ptr (Ptr CDouble)
a5'2 Ptr (Ptr ())
a6' IO () -> IO [Day] -> IO [Day]
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 CInt) -> IO [Day]
peekDayArray Ptr CUInt
a4'1 Ptr (Ptr CInt)
a4'2IO [Day] -> ([Day] -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \[Day]
a4'' ->
Ptr CUInt -> Ptr (Ptr CDouble) -> IO [Double]
peekDoubleArray Ptr CUInt
a5'1 Ptr (Ptr CDouble)
a5'2IO [Double]
-> ([Double] -> IO ([Day], [Double])) -> IO ([Day], [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]
a5'' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a6'IO () -> IO ([Day], [Double]) -> IO ([Day], [Double])
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
([Day], [Double]) -> IO ([Day], [Double])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ([Day]
a4'', [Double]
a5'')
{-# LINE 947 "./QuantLib/Model.chs" #-}
garmanKlassSimpleSigma :: Double
-> NonEmpty (Day, Double, Double, Double, Double)
-> IO [(Day, Double)]
garmanKlassSimpleSigma yearFraction bars = do
(ds, vs) <- qlGarmanKlassSimpleSigma yearFraction dates opens closes highs lows
return $ zip ds vs
where (dates, opens, closes, highs, lows) = unzipBars bars
qlGarmanKlassSimpleSigma :: (Double) -> ([Day]) -> ([Double]) -> ([Double]) -> ([Double]) -> ([Double]) -> IO (([Day]), ([Double]))
qlGarmanKlassSimpleSigma :: Double
-> [Day]
-> [Double]
-> [Double]
-> [Double]
-> [Double]
-> IO ([Day], [Double])
qlGarmanKlassSimpleSigma Double
a1 [Day]
a2 [Double]
a3 [Double]
a4 [Double]
a5 [Double]
a6 =
let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in
[Day]
-> ((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a2 (((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a2'1, Ptr CInt
a2'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a3 (((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CDouble
a3'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a4 (((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a4'1, Ptr CDouble
a4'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a5 (((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a5'1, Ptr CDouble
a5'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a6 (((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a6'1, Ptr CDouble
a6'2) ->
((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. ((Ptr CUInt, Ptr (Ptr CInt)) -> IO b) -> IO b
preIntArray (((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a7'1, Ptr (Ptr CInt)
a7'2) ->
((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO b) -> IO b
preDoubleArray (((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a8'1, Ptr (Ptr CDouble)
a8'2) ->
(Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double]))
-> (Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a9' ->
CDouble
-> CUInt
-> Ptr CInt
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> Ptr CUInt
-> Ptr (Ptr CInt)
-> Ptr CUInt
-> Ptr (Ptr CDouble)
-> Ptr (Ptr ())
-> IO ()
qlGarmanKlassSimpleSigma'_ CDouble
a1' CUInt
a2'1 Ptr CInt
a2'2 CUInt
a3'1 Ptr CDouble
a3'2 CUInt
a4'1 Ptr CDouble
a4'2 CUInt
a5'1 Ptr CDouble
a5'2 CUInt
a6'1 Ptr CDouble
a6'2 Ptr CUInt
a7'1 Ptr (Ptr CInt)
a7'2 Ptr CUInt
a8'1 Ptr (Ptr CDouble)
a8'2 Ptr (Ptr ())
a9' IO () -> IO [Day] -> IO [Day]
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 CInt) -> IO [Day]
peekDayArray Ptr CUInt
a7'1 Ptr (Ptr CInt)
a7'2IO [Day] -> ([Day] -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \[Day]
a7'' ->
Ptr CUInt -> Ptr (Ptr CDouble) -> IO [Double]
peekDoubleArray Ptr CUInt
a8'1 Ptr (Ptr CDouble)
a8'2IO [Double]
-> ([Double] -> IO ([Day], [Double])) -> IO ([Day], [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]
a8'' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a9'IO () -> IO ([Day], [Double]) -> IO ([Day], [Double])
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
([Day], [Double]) -> IO ([Day], [Double])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ([Day]
a7'', [Double]
a8'')
{-# LINE 961 "./QuantLib/Model.chs" #-}
garmanKlassSigma1 :: Double
-> Double
-> NonEmpty (Day, Double, Double, Double, Double)
-> IO [(Day, Double)]
garmanKlassSigma1 yearFraction marketOpenFraction bars = do
(ds, vs) <- qlGarmanKlassSigma1 yearFraction marketOpenFraction dates opens closes highs lows
return $ zip ds vs
where (dates, opens, closes, highs, lows) = unzipBars bars
qlGarmanKlassSigma1 :: (Double) -> (Double) -> ([Day]) -> ([Double]) -> ([Double]) -> ([Double]) -> ([Double]) -> IO (([Day]), ([Double]))
qlGarmanKlassSigma1 :: Double
-> Double
-> [Day]
-> [Double]
-> [Double]
-> [Double]
-> [Double]
-> IO ([Day], [Double])
qlGarmanKlassSigma1 Double
a1 Double
a2 [Day]
a3 [Double]
a4 [Double]
a5 [Double]
a6 [Double]
a7 =
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
[Day]
-> ((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a3 (((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CInt
a3'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a4 (((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a4'1, Ptr CDouble
a4'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a5 (((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a5'1, Ptr CDouble
a5'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a6 (((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a6'1, Ptr CDouble
a6'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a7 (((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a7'1, Ptr CDouble
a7'2) ->
((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. ((Ptr CUInt, Ptr (Ptr CInt)) -> IO b) -> IO b
preIntArray (((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a8'1, Ptr (Ptr CInt)
a8'2) ->
((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO b) -> IO b
preDoubleArray (((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a9'1, Ptr (Ptr CDouble)
a9'2) ->
(Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double]))
-> (Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a10' ->
CDouble
-> CDouble
-> CUInt
-> Ptr CInt
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> Ptr CUInt
-> Ptr (Ptr CInt)
-> Ptr CUInt
-> Ptr (Ptr CDouble)
-> Ptr (Ptr ())
-> IO ()
qlGarmanKlassSigma1'_ CDouble
a1' CDouble
a2' CUInt
a3'1 Ptr CInt
a3'2 CUInt
a4'1 Ptr CDouble
a4'2 CUInt
a5'1 Ptr CDouble
a5'2 CUInt
a6'1 Ptr CDouble
a6'2 CUInt
a7'1 Ptr CDouble
a7'2 Ptr CUInt
a8'1 Ptr (Ptr CInt)
a8'2 Ptr CUInt
a9'1 Ptr (Ptr CDouble)
a9'2 Ptr (Ptr ())
a10' IO () -> IO [Day] -> IO [Day]
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 CInt) -> IO [Day]
peekDayArray Ptr CUInt
a8'1 Ptr (Ptr CInt)
a8'2IO [Day] -> ([Day] -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \[Day]
a8'' ->
Ptr CUInt -> Ptr (Ptr CDouble) -> IO [Double]
peekDoubleArray Ptr CUInt
a9'1 Ptr (Ptr CDouble)
a9'2IO [Double]
-> ([Double] -> IO ([Day], [Double])) -> IO ([Day], [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]
a9'' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a10'IO () -> IO ([Day], [Double]) -> IO ([Day], [Double])
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
([Day], [Double]) -> IO ([Day], [Double])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ([Day]
a8'', [Double]
a9'')
{-# LINE 977 "./QuantLib/Model.chs" #-}
parkinsonSigma :: Double
-> NonEmpty (Day, Double, Double, Double, Double)
-> IO [(Day, Double)]
parkinsonSigma yearFraction bars = do
(ds, vs) <- qlParkinsonSigma yearFraction dates opens closes highs lows
return $ zip ds vs
where (dates, opens, closes, highs, lows) = unzipBars bars
qlParkinsonSigma :: (Double) -> ([Day]) -> ([Double]) -> ([Double]) -> ([Double]) -> ([Double]) -> IO (([Day]), ([Double]))
qlParkinsonSigma a1 a2 a3 a4 a5 a6 =
let {a1' = realToFrac a1} in
withDayArray a2 $ \(a2'1, a2'2) ->
withDoubleArray a3 $ \(a3'1, a3'2) ->
withDoubleArray a4 $ \(a4'1, a4'2) ->
withDoubleArray a5 $ \(a5'1, a5'2) ->
withDoubleArray a6 $ \(a6'1, a6'2) ->
preIntArray $ \(a7'1, a7'2) ->
preDoubleArray $ \(a8'1, a8'2) ->
preErrorCheck $ \a9' ->
qlParkinsonSigma'_ a1' a2'1 a2'2 a3'1 a3'2 a4'1 a4'2 a5'1 a5'2 a6'1 a6'2 a7'1 a7'2 a8'1 a8'2 a9' >>
peekDayArray a7'1 a7'2>>= \a7'' ->
peekDoubleArray a8'1 a8'2>>= \a8'' ->
errorCheck a9'>>
return (a7'', a8'')
{-# LINE 991 "./QuantLib/Model.chs" #-}
garmanKlassSigma3 :: Double
-> Double
-> NonEmpty (Day, Double, Double, Double, Double)
-> IO [(Day, Double)]
garmanKlassSigma3 yearFraction marketOpenFraction bars = do
(ds, vs) <- qlGarmanKlassSigma3 yearFraction marketOpenFraction dates opens closes highs lows
return $ zip ds vs
where (dates, opens, closes, highs, lows) = unzipBars bars
qlGarmanKlassSigma3 :: (Double) -> (Double) -> ([Day]) -> ([Double]) -> ([Double]) -> ([Double]) -> ([Double]) -> IO (([Day]), ([Double]))
qlGarmanKlassSigma3 a1 a2 a3 a4 a5 a6 a7 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
withDayArray a3 $ \(a3'1, a3'2) ->
withDoubleArray a4 $ \(a4'1, a4'2) ->
withDoubleArray a5 $ \(a5'1, a5'2) ->
withDoubleArray a6 $ \(a6'1, a6'2) ->
withDoubleArray a7 $ \(a7'1, a7'2) ->
preIntArray $ \(a8'1, a8'2) ->
preDoubleArray $ \(a9'1, a9'2) ->
preErrorCheck $ \a10' ->
qlGarmanKlassSigma3'_ a1' a2' a3'1 a3'2 a4'1 a4'2 a5'1 a5'2 a6'1 a6'2 a7'1 a7'2 a8'1 a8'2 a9'1 a9'2 a10' >>
peekDayArray a8'1 a8'2>>= \a8'' ->
peekDoubleArray a9'1 a9'2>>= \a9'' ->
errorCheck a10'>>
return (a8'', a9'')
{-# LINE 1006 "./QuantLib/Model.chs" #-}
garmanKlassSigma4 :: Double
-> NonEmpty (Day, Double, Double, Double, Double)
-> IO [(Day, Double)]
garmanKlassSigma4 yearFraction bars = do
(ds, vs) <- qlGarmanKlassSigma4 yearFraction dates opens closes highs lows
return $ zip ds vs
where (dates, opens, closes, highs, lows) = unzipBars bars
qlGarmanKlassSigma4 :: (Double) -> ([Day]) -> ([Double]) -> ([Double]) -> ([Double]) -> ([Double]) -> IO (([Day]), ([Double]))
qlGarmanKlassSigma4 a1 a2 a3 a4 a5 a6 =
let {a1' = realToFrac a1} in
withDayArray a2 $ \(a2'1, a2'2) ->
withDoubleArray a3 $ \(a3'1, a3'2) ->
withDoubleArray a4 $ \(a4'1, a4'2) ->
withDoubleArray a5 $ \(a5'1, a5'2) ->
withDoubleArray a6 $ \(a6'1, a6'2) ->
preIntArray $ \(a7'1, a7'2) ->
preDoubleArray $ \(a8'1, a8'2) ->
preErrorCheck $ \a9' ->
qlGarmanKlassSigma4'_ a1' a2'1 a2'2 a3'1 a3'2 a4'1 a4'2 a5'1 a5'2 a6'1 a6'2 a7'1 a7'2 a8'1 a8'2 a9' >>
peekDayArray a7'1 a7'2>>= \a7'' ->
peekDoubleArray a8'1 a8'2>>= \a8'' ->
errorCheck a9'>>
return (a7'', a8'')
{-# LINE 1020 "./QuantLib/Model.chs" #-}
garmanKlassSigma5 :: Double
-> NonEmpty (Day, Double, Double, Double, Double)
-> IO [(Day, Double)]
garmanKlassSigma5 yearFraction bars = do
(ds, vs) <- qlGarmanKlassSigma5 yearFraction dates opens closes highs lows
return $ zip ds vs
where (dates, opens, closes, highs, lows) = unzipBars bars
qlGarmanKlassSigma5 :: (Double) -> ([Day]) -> ([Double]) -> ([Double]) -> ([Double]) -> ([Double]) -> IO (([Day]), ([Double]))
qlGarmanKlassSigma5 a1 a2 a3 a4 a5 a6 =
let {a1' = realToFrac a1} in
withDayArray a2 $ \(a2'1, a2'2) ->
withDoubleArray a3 $ \(a3'1, a3'2) ->
withDoubleArray a4 $ \(a4'1, a4'2) ->
withDoubleArray a5 $ \(a5'1, a5'2) ->
withDoubleArray a6 $ \(a6'1, a6'2) ->
preIntArray $ \(a7'1, a7'2) ->
preDoubleArray $ \(a8'1, a8'2) ->
preErrorCheck $ \a9' ->
qlGarmanKlassSigma5'_ a1' a2'1 a2'2 a3'1 a3'2 a4'1 a4'2 a5'1 a5'2 a6'1 a6'2 a7'1 a7'2 a8'1 a8'2 a9' >>
peekDayArray a7'1 a7'2>>= \a7'' ->
peekDoubleArray a8'1 a8'2>>= \a8'' ->
errorCheck a9'>>
return (a7'', a8'')
{-# LINE 1034 "./QuantLib/Model.chs" #-}
garmanKlassSigma6 :: Double
-> Double
-> NonEmpty (Day, Double, Double, Double, Double)
-> IO [(Day, Double)]
garmanKlassSigma6 yearFraction marketOpenFraction bars = do
(ds, vs) <- qlGarmanKlassSigma6 yearFraction marketOpenFraction dates opens closes highs lows
return $ zip ds vs
where (dates, opens, closes, highs, lows) = unzipBars bars
qlGarmanKlassSigma6 :: (Double) -> (Double) -> ([Day]) -> ([Double]) -> ([Double]) -> ([Double]) -> ([Double]) -> IO (([Day]), ([Double]))
qlGarmanKlassSigma6 a1 a2 a3 a4 a5 a6 a7 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
withDayArray a3 $ \(a3'1, a3'2) ->
withDoubleArray a4 $ \(a4'1, a4'2) ->
withDoubleArray a5 $ \(a5'1, a5'2) ->
withDoubleArray a6 $ \(a6'1, a6'2) ->
withDoubleArray a7 $ \(a7'1, a7'2) ->
preIntArray $ \(a8'1, a8'2) ->
preDoubleArray $ \(a9'1, a9'2) ->
preErrorCheck $ \a10' ->
qlGarmanKlassSigma6'_ a1' a2' a3'1 a3'2 a4'1 a4'2 a5'1 a5'2 a6'1 a6'2 a7'1 a7'2 a8'1 a8'2 a9'1 a9'2 a10' >>
peekDayArray a8'1 a8'2>>= \a8'' ->
peekDoubleArray a9'1 a9'2>>= \a9'' ->
errorCheck a10'>>
return (a8'', a9'')
{-# LINE 1049 "./QuantLib/Model.chs" #-}
constantVolatilityEstimator :: Word
-> NonEmpty (Day, Double)
-> IO [(Day, Double)]
constantVolatilityEstimator windowSize series = do
(ds, vs) <- qlConstantVolatilityEstimator windowSize dates vals
return $ zip ds vs
where (dates, vals) = unzip (toList series)
qlConstantVolatilityEstimator :: (Word) -> ([Day]) -> ([Double]) -> IO (([Day]), ([Double]))
qlConstantVolatilityEstimator a1 a2 a3 =
let {a1' = fromIntegral a1} in
withDayArray a2 $ \(a2'1, a2'2) ->
withDoubleArray a3 $ \(a3'1, a3'2) ->
preIntArray $ \(a4'1, a4'2) ->
preDoubleArray $ \(a5'1, a5'2) ->
preErrorCheck $ \a6' ->
qlConstantVolatilityEstimator'_ a1' a2'1 a2'2 a3'1 a3'2 a4'1 a4'2 a5'1 a5'2 a6' >>
peekDayArray a4'1 a4'2>>= \a4'' ->
peekDoubleArray a5'1 a5'2>>= \a5'' ->
errorCheck a6'>>
return (a4'', a5'')
{-# LINE 1062 "./QuantLib/Model.chs" #-}
simpleLocalVolatilityEstimator :: Double
-> NonEmpty (Day, Double)
-> IO [(Day, Double)]
simpleLocalVolatilityEstimator yearFraction series = do
(ds, vs) <- qlSimpleLocalVolatilityEstimator yearFraction dates vals
return $ zip ds vs
where (dates, vals) = unzip (toList series)
qlSimpleLocalVolatilityEstimator :: (Double) -> ([Day]) -> ([Double]) -> IO (([Day]), ([Double]))
qlSimpleLocalVolatilityEstimator :: Double -> [Day] -> [Double] -> IO ([Day], [Double])
qlSimpleLocalVolatilityEstimator Double
a1 [Day]
a2 [Double]
a3 =
let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in
[Day]
-> ((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a2 (((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CInt) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a2'1, Ptr CInt
a2'2) ->
[Double]
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a3 (((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((CUInt, Ptr CDouble) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CDouble
a3'2) ->
((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. ((Ptr CUInt, Ptr (Ptr CInt)) -> IO b) -> IO b
preIntArray (((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a4'1, Ptr (Ptr CInt)
a4'2) ->
((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall b. ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO b) -> IO b
preDoubleArray (((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double]))
-> ((Ptr CUInt, Ptr (Ptr CDouble)) -> IO ([Day], [Double]))
-> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a5'1, Ptr (Ptr CDouble)
a5'2) ->
(Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double]))
-> (Ptr (Ptr ()) -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a6' ->
CDouble
-> CUInt
-> Ptr CInt
-> CUInt
-> Ptr CDouble
-> Ptr CUInt
-> Ptr (Ptr CInt)
-> Ptr CUInt
-> Ptr (Ptr CDouble)
-> Ptr (Ptr ())
-> IO ()
qlSimpleLocalVolatilityEstimator'_ CDouble
a1' CUInt
a2'1 Ptr CInt
a2'2 CUInt
a3'1 Ptr CDouble
a3'2 Ptr CUInt
a4'1 Ptr (Ptr CInt)
a4'2 Ptr CUInt
a5'1 Ptr (Ptr CDouble)
a5'2 Ptr (Ptr ())
a6' IO () -> IO [Day] -> IO [Day]
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 CInt) -> IO [Day]
peekDayArray Ptr CUInt
a4'1 Ptr (Ptr CInt)
a4'2IO [Day] -> ([Day] -> IO ([Day], [Double])) -> IO ([Day], [Double])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \[Day]
a4'' ->
Ptr CUInt -> Ptr (Ptr CDouble) -> IO [Double]
peekDoubleArray Ptr CUInt
a5'1 Ptr (Ptr CDouble)
a5'2IO [Double]
-> ([Double] -> IO ([Day], [Double])) -> IO ([Day], [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]
a5'' ->
Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a6'IO () -> IO ([Day], [Double]) -> IO ([Day], [Double])
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
([Day], [Double]) -> IO ([Day], [Double])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ([Day]
a4'', [Double]
a5'')
{-# LINE 1076 "./QuantLib/Model.chs" #-}
unzipBars :: NonEmpty (Day, Double, Double, Double, Double) -> ([Day], [Double], [Double], [Double], [Double])
unzipBars bars = (map d5 xs, map o5 xs, map c5 xs, map h5 xs, map l5 xs)
where
xs = toList bars
d5 (d,_,_,_,_) = d
o5 (_,o,_,_,_) = o
c5 (_,_,c,_,_) = c
h5 (_,_,_,h,_) = h
l5 (_,_,_,_,l) = l
gaussian1dCompoundedRate :: (Gaussian1dModel)
-> (OvernightIndexedCoupon)
-> (Maybe Day)
-> (Double)
-> (Maybe (GenYieldTermStructure y))
-> IO ((Double))
gaussian1dCompoundedRate :: forall y.
Gaussian1dModel
-> OvernightIndexedCoupon
-> Maybe Day
-> Double
-> Maybe (GenYieldTermStructure y)
-> IO Double
gaussian1dCompoundedRate Gaussian1dModel
a1 OvernightIndexedCoupon
a2 Maybe Day
a3 Double
a4 Maybe (GenYieldTermStructure y)
a5 =
Gaussian1dModel
-> (Ptr CGaussian1dModel' -> IO Double) -> IO Double
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone Gaussian1dModel
a1 ((Ptr CGaussian1dModel' -> IO Double) -> IO Double)
-> (Ptr CGaussian1dModel' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CGaussian1dModel'
a1' ->
OvernightIndexedCoupon
-> (Ptr COvernightIndexedCoupon' -> IO Double) -> IO Double
forall b.
OvernightIndexedCoupon
-> (Ptr COvernightIndexedCoupon' -> IO b) -> IO b
withOvernightIndexedCoupon OvernightIndexedCoupon
a2 ((Ptr COvernightIndexedCoupon' -> IO Double) -> IO Double)
-> (Ptr COvernightIndexedCoupon' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr COvernightIndexedCoupon'
a2' ->
Maybe Day -> (CInt -> IO Double) -> IO Double
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a3 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a3' ->
let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in
Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO Double) -> IO Double
forall y b.
Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withMaybeYieldTermStructure Maybe (GenYieldTermStructure y)
a5 ((Ptr CYieldTermStructure' -> IO Double) -> IO Double)
-> (Ptr CYieldTermStructure' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a5' ->
(Ptr (Ptr ()) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO Double) -> IO Double)
-> (Ptr (Ptr ()) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a6' ->
Ptr CGaussian1dModel'
-> Ptr COvernightIndexedCoupon'
-> CInt
-> CDouble
-> Ptr CYieldTermStructure'
-> Ptr (Ptr ())
-> IO CDouble
gaussian1dCompoundedRate'_ Ptr CGaussian1dModel'
a1' Ptr COvernightIndexedCoupon'
a2' CInt
a3' CDouble
a4' Ptr CYieldTermStructure'
a5' Ptr (Ptr ())
a6' 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 ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck Ptr (Ptr ())
a6'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 1096 "./QuantLib/Model.chs" #-}
roughHestonModel :: (GenHestonProcess hp)
-> (Double)
-> IO ((RoughHestonModel))
roughHestonModel a1 a2 =
withHestonProcess a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
roughHestonModel'_ a1' a2' a3' >>= \res ->
peekRoughHestonModel res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 1101 "./QuantLib/Model.chs" #-}
roughHestonTheta :: (RoughHestonModel)
-> IO ((Double))
roughHestonTheta a1 =
withRoughHestonModel a1 $ \a1' ->
preErrorCheck $ \a2' ->
roughHestonTheta'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 1105 "./QuantLib/Model.chs" #-}
roughHestonKappa :: (RoughHestonModel)
-> IO ((Double))
roughHestonKappa a1 =
withRoughHestonModel a1 $ \a1' ->
preErrorCheck $ \a2' ->
roughHestonKappa'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 1109 "./QuantLib/Model.chs" #-}
roughHestonSigma :: (RoughHestonModel)
-> IO ((Double))
roughHestonSigma a1 =
withRoughHestonModel a1 $ \a1' ->
preErrorCheck $ \a2' ->
roughHestonSigma'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 1113 "./QuantLib/Model.chs" #-}
roughHestonRho :: (RoughHestonModel)
-> IO ((Double))
roughHestonRho a1 =
withRoughHestonModel a1 $ \a1' ->
preErrorCheck $ \a2' ->
roughHestonRho'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 1117 "./QuantLib/Model.chs" #-}
roughHestonV0 :: (RoughHestonModel)
-> IO ((Double))
roughHestonV0 a1 =
withRoughHestonModel a1 $ \a1' ->
preErrorCheck $ \a2' ->
roughHestonV0'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 1121 "./QuantLib/Model.chs" #-}
roughHestonHurst :: (RoughHestonModel)
-> IO ((Double))
roughHestonHurst a1 =
withRoughHestonModel a1 $ \a1' ->
preErrorCheck $ \a2' ->
roughHestonHurst'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 1125 "./QuantLib/Model.chs" #-}
roughHestonProcess :: (RoughHestonModel)
-> IO ((HestonProcess))
roughHestonProcess a1 =
withRoughHestonModel a1 $ \a1' ->
preErrorCheck $ \a2' ->
roughHestonProcess'_ a1' a2' >>= \res ->
peekHestonProcess res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 1129 "./QuantLib/Model.chs" #-}
foreign import ccall safe "QuantLib/Model.chs.h qlBatesModel"
batesModel'_ :: ((C2HSImp.Ptr (CBatesProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CBatesModel')))))
foreign import ccall safe "QuantLib/Model.chs.h qlBlackKarasinski"
blackKarasinski'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CShortRateModel')))))))
foreign import ccall safe "QuantLib/Model.chs.h qlCoxIngersollRoss"
coxIngersollRoss'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (COneFactorAffineModel')))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlExtendedCoxIngersollRoss"
extendedCoxIngersollRoss'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (COneFactorAffineModel'))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlG2"
g2'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CG2'))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlG2Dynamics"
g2Dynamics'_ :: ((C2HSImp.Ptr (CG2')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CShortRateDynamics')))))
foreign import ccall safe "QuantLib/Model.chs.h qlShortRateDynamicsShortRate"
shortRate'_ :: ((C2HSImp.Ptr (CShortRateDynamics')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGeneralizedHullWhite"
qlGeneralizedHullWhite'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CShortRateModel')))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGJRGARCHModel"
gjrGarchModel'_ :: ((C2HSImp.Ptr (CGJRGARCHProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CGJRGARCHModel')))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonModel"
hestonModel'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CHestonModel')))))
foreign import ccall safe "QuantLib/Model.chs.h qlMTBrownianGeneratorFactory"
mtBrownianGeneratorFactory'_ :: (C2HSImp.CULong -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CBrownianGeneratorFactory')))))
foreign import ccall safe "QuantLib/Model.chs.h qlSobolBrownianGeneratorFactory"
sobolBrownianGeneratorFactory'_ :: (C2HSImp.CInt -> (C2HSImp.CULong -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CBrownianGeneratorFactory')))))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonSLVMCModel"
hestonSlvMcModel'_ :: ((C2HSImp.Ptr (CLocalVolTermStructure')) -> ((C2HSImp.Ptr (CHestonModel')) -> ((C2HSImp.Ptr (CBrownianGeneratorFactory')) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CHestonSLVMCModel'))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonSLVMCModelLeverageFunction"
qlHestonSLVMCModelLeverageFunction'_ :: ((C2HSImp.Ptr (CHestonSLVMCModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CLocalVolTermStructure')))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonSLVFDMModel"
hestonSlvFdmModelRaw'_ :: ((C2HSImp.Ptr (CLocalVolTermStructure')) -> ((C2HSImp.Ptr (CHestonModel')) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CFdmSchemeDesc)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CHestonSLVFDMModel')))))))))))))))))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonSLVFDMModelLeverageFunction"
qlHestonSLVFDMModelLeverageFunction'_ :: ((C2HSImp.Ptr (CHestonSLVFDMModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CLocalVolTermStructure')))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonSLVFDMModelLogEntries"
hestonSlvFdmLogEntriesSnapshot'_ :: ((C2HSImp.Ptr (CHestonSLVFDMModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CHestonSLVFDMLogEntries)))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonSLVFDMLogEntriesSize"
hestonSlvFdmLogEntriesSize'_ :: ((C2HSImp.Ptr (CHestonSLVFDMLogEntries)) -> (IO C2HSImp.CUInt))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonSLVFDMLogEntriesTime"
hestonSlvFdmLogEntriesTime'_ :: ((C2HSImp.Ptr (CHestonSLVFDMLogEntries)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonSLVFDMLogEntriesSpotGrid"
hestonSlvFdmLogEntriesSpotGrid'_ :: ((C2HSImp.Ptr (CHestonSLVFDMLogEntries)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonSLVFDMLogEntriesVarianceGrid"
hestonSlvFdmLogEntriesVarianceGrid'_ :: ((C2HSImp.Ptr (CHestonSLVFDMLogEntries)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonSLVFDMLogEntriesDensity"
hestonSlvFdmLogEntriesDensity'_ :: ((C2HSImp.Ptr (CHestonSLVFDMLogEntries)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlHullWhite"
hullWhite'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CHullWhite')))))))
foreign import ccall safe "QuantLib/Model.chs.h qlHullWhiteConvexityBias"
convexityBias'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGsr"
qlGsr'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CQuote'))) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CQuote'))) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CGsr'))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGsrVolatility"
qlGsrVolatility'_ :: ((C2HSImp.Ptr (CGsr')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))
foreign import ccall safe "QuantLib/Model.chs.h qlGsrReversion"
reversions'_ :: ((C2HSImp.Ptr (CGsr')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))
foreign import ccall safe "QuantLib/Model.chs.h qlGsrMoveVolatility"
moveVolatility'_ :: ((C2HSImp.Ptr (CGsr')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGsrMoveReversion"
moveReversion'_ :: ((C2HSImp.Ptr (CGsr')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGsrCalibrateVolatilitiesIterative"
calibrateVolatilitiesIterative'_ :: ((C2HSImp.Ptr (CGsr')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CBlackCalibrationHelper'))) -> ((C2HSImp.Ptr (COptimizationMethod)) -> ((C2HSImp.Ptr (CEndCriteria)) -> ((C2HSImp.Ptr (CConstraint)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGsrCalibrateReversionsIterative"
calibrateReversionsIterative'_ :: ((C2HSImp.Ptr (CGsr')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CBlackCalibrationHelper'))) -> ((C2HSImp.Ptr (COptimizationMethod)) -> ((C2HSImp.Ptr (CEndCriteria)) -> ((C2HSImp.Ptr (CConstraint)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlMarkovFunctional"
qlMarkovFunctional'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CSwaptionVolatilityStructure')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> ((C2HSImp.Ptr (CSwapIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CMarkovFunctional')))))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlMarkovFunctionalCaplet"
qlMarkovFunctionalCaplet'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CMarkovFunctional')))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlMarkovFunctionalVolatility"
qlMarkovFunctionalVolatility'_ :: ((C2HSImp.Ptr (CMarkovFunctional')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))
foreign import ccall safe "QuantLib/Model.chs.h qlAffineModelDiscount"
discount'_ :: ((C2HSImp.Ptr (CAffineModel')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/Model.chs.h qlAffineModelDiscountBond"
discountBond'_ :: ((C2HSImp.Ptr (CAffineModel')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/Model.chs.h qlAffineModelDiscountBondOption"
discountBondOption_'_ :: ((C2HSImp.Ptr (CAffineModel')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGaussian1dModelNumeraire"
numeraire'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGaussian1dModelZerobond"
gaussian1dZerobond'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGaussian1dModelZerobondOption"
gaussian1dZerobondOption'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGaussian1dModelForwardRate"
gaussian1dForwardRate'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CIborIndex')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGaussian1dModelSwapRate"
gaussian1dSwapRate'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CSwapIndex')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGaussian1dModelSwapAnnuity"
gaussian1dSwapAnnuity'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CSwapIndex')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGaussian1dModelYGrid"
gaussian1dYGrid'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGaussian1dModelStateProcess"
stateProcess'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CStochasticProcess1D')))))
foreign import ccall safe "QuantLib/Model.chs.h qlVarianceGammaModel"
varianceGammaModel'_ :: ((C2HSImp.Ptr (CVarianceGammaProcess')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CCalibratedModel')))))
foreign import ccall safe "QuantLib/Model.chs.h qlVasicek"
vasicek'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (COneFactorAffineModel')))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlLiborForwardModel"
liborForwardModel'_ :: ((C2HSImp.Ptr (CLiborForwardModelProcess')) -> ((C2HSImp.Ptr (CLmVolatilityModel)) -> ((C2HSImp.Ptr (CLmCorrelationModel)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CLiborForwardModel')))))))
foreign import ccall safe "QuantLib/Model.chs.h qlLiborForwardModelS0"
liborForwardModelS0'_ :: ((C2HSImp.Ptr (CLiborForwardModel')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/Model.chs.h qlLfmHullWhiteParameterization"
qlLfmHullWhiteParameterization'_ :: ((C2HSImp.Ptr (CLiborForwardModelProcess')) -> ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CLfmHullWhiteParameterization))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlLiborForwardModelProcessSetCovarParam"
setCovarParam'_ :: ((C2HSImp.Ptr (CLiborForwardModelProcess')) -> ((C2HSImp.Ptr (CLfmHullWhiteParameterization)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))
foreign import ccall safe "QuantLib/Model.chs.h qlLfmHullWhiteCovariance"
qlLfmHullWhiteCovariance'_ :: ((C2HSImp.Ptr (CLfmHullWhiteParameterization)) -> (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 ())) -> (IO ()))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlCalibratedModelCalibrate"
qlCalibratedModelCalibrate'_ :: ((C2HSImp.Ptr (CCalibratedModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CCalibrationHelper'))) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (COptimizationMethod)) -> ((C2HSImp.Ptr (CEndCriteria)) -> ((C2HSImp.Ptr (CConstraint)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlCalibratedModelValue"
value'_ :: ((C2HSImp.Ptr (CCalibratedModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CCalibrationHelper'))) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/Model.chs.h qlCapHelper"
capHelper'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CBlackCalibrationHelper')))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlHestonModelHelper"
hestonModelHelper'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CBlackCalibrationHelper')))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlSwaptionHelper"
swaptionHelperTenorsRaw'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CSwaptionHelper'))))))))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlSwaptionHelperFromDate"
swaptionHelperFromDateRaw'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CSwaptionHelper')))))))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlSwaptionHelperFromDates"
swaptionHelperFromDatesRaw'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CSwaptionHelper'))))))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlSwaptionHelperSwaption"
helperSwaption'_ :: ((C2HSImp.Ptr (CSwaptionHelper')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CSwaption')))))
foreign import ccall safe "QuantLib/Model.chs.h qlBlackCalibrationHelperTimes"
times'_ :: ((C2HSImp.Ptr (CBlackCalibrationHelper')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))
foreign import ccall safe "QuantLib/Model.chs.h qlCalibratedModelParams"
params'_ :: ((C2HSImp.Ptr (CCalibratedModel')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))
foreign import ccall safe "QuantLib/Model.chs.h qlCalibratedModelSetParams"
setParams'_ :: ((C2HSImp.Ptr (CCalibratedModel')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))
foreign import ccall safe "QuantLib/Model.chs.h qlBlackCalibrationHelperBlackPrice"
blackPrice'_ :: ((C2HSImp.Ptr (CBlackCalibrationHelper')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/Model.chs.h qlBlackCalibrationHelperCalibrationError"
calibrationError'_ :: ((C2HSImp.Ptr (CBlackCalibrationHelper')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Model.chs.h qlBlackCalibrationHelperImpliedVolatility"
impliedVolatility'_ :: ((C2HSImp.Ptr (CBlackCalibrationHelper')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlBlackCalibrationHelperMarketValue"
marketValue'_ :: ((C2HSImp.Ptr (CBlackCalibrationHelper')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Model.chs.h qlBlackCalibrationHelperModelValue"
modelValue'_ :: ((C2HSImp.Ptr (CBlackCalibrationHelper')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Model.chs.h qlBlackCalibrationHelperVolatility"
volatility'_ :: ((C2HSImp.Ptr (CBlackCalibrationHelper')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CQuote')))))
foreign import ccall safe "QuantLib/Model.chs.h qlBlackCalibrationHelperSetPricingEngine"
setPricingEngine'_ :: ((C2HSImp.Ptr (CBlackCalibrationHelper')) -> ((C2HSImp.Ptr (CPricingEngine')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))
foreign import ccall safe "QuantLib/Model.chs.h qlGarch11"
garch11'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CGarch11)))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGarch11Calibrated"
qlGarch11Calibrated'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CGarch11)))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGarch11Alpha"
alpha'_ :: ((C2HSImp.Ptr (CGarch11)) -> (IO C2HSImp.CDouble))
foreign import ccall safe "QuantLib/Model.chs.h qlGarch11Beta"
beta'_ :: ((C2HSImp.Ptr (CGarch11)) -> (IO C2HSImp.CDouble))
foreign import ccall safe "QuantLib/Model.chs.h qlGarch11Omega"
omega'_ :: ((C2HSImp.Ptr (CGarch11)) -> (IO C2HSImp.CDouble))
foreign import ccall safe "QuantLib/Model.chs.h qlGarch11LtVol"
longTermVolatility'_ :: ((C2HSImp.Ptr (CGarch11)) -> (IO C2HSImp.CDouble))
foreign import ccall safe "QuantLib/Model.chs.h qlGarch11LogLikelihood"
logLikelihood'_ :: ((C2HSImp.Ptr (CGarch11)) -> (IO C2HSImp.CDouble))
foreign import ccall safe "QuantLib/Model.chs.h qlGarch11Forecast"
forecast'_ :: ((C2HSImp.Ptr (CGarch11)) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/Model.chs.h qlGarch11Calculate"
qlGarch11Calculate'_ :: ((C2HSImp.Ptr (CGarch11)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGarmanKlassSimpleSigma"
qlGarmanKlassSimpleSigma'_ :: (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGarmanKlassSigma1"
qlGarmanKlassSigma1'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlParkinsonSigma"
qlParkinsonSigma'_ :: (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGarmanKlassSigma3"
qlGarmanKlassSigma3'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGarmanKlassSigma4"
qlGarmanKlassSigma4'_ :: (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGarmanKlassSigma5"
qlGarmanKlassSigma5'_ :: (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGarmanKlassSigma6"
qlGarmanKlassSigma6'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ()))))))))))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlConstantVolatilityEstimator"
qlConstantVolatilityEstimator'_ :: (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlSimpleLocalVolatilityEstimator"
qlSimpleLocalVolatilityEstimator'_ :: (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO ())))))))))))
foreign import ccall safe "QuantLib/Model.chs.h qlGaussian1dModelCompoundedRate"
gaussian1dCompoundedRate'_ :: ((C2HSImp.Ptr (CGaussian1dModel')) -> ((C2HSImp.Ptr (COvernightIndexedCoupon')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/Model.chs.h qlRoughHestonModel"
roughHestonModel'_ :: ((C2HSImp.Ptr (CHestonProcess')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CRoughHestonModel'))))))
foreign import ccall safe "QuantLib/Model.chs.h qlRoughHestonModelTheta"
roughHestonTheta'_ :: ((C2HSImp.Ptr (CRoughHestonModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Model.chs.h qlRoughHestonModelKappa"
roughHestonKappa'_ :: ((C2HSImp.Ptr (CRoughHestonModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Model.chs.h qlRoughHestonModelSigma"
roughHestonSigma'_ :: ((C2HSImp.Ptr (CRoughHestonModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Model.chs.h qlRoughHestonModelRho"
roughHestonRho'_ :: ((C2HSImp.Ptr (CRoughHestonModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Model.chs.h qlRoughHestonModelV0"
roughHestonV0'_ :: ((C2HSImp.Ptr (CRoughHestonModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Model.chs.h qlRoughHestonModelHurst"
roughHestonHurst'_ :: ((C2HSImp.Ptr (CRoughHestonModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Model.chs.h qlRoughHestonModelProcess"
roughHestonProcess'_ :: ((C2HSImp.Ptr (CRoughHestonModel')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CHestonProcess')))))