| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.Model
Description
Historical volatility estimators bound here (ql/models/volatility, ql/prices.hpp) --
Garch11, GarmanKlass/Parkinson, ConstantEstimator, SimpleLocalEstimator -- are distinct
from QuantLib.TermStructure.Volatility, which covers forward-looking implied-volatility
surfaces and smiles. None of these classes have any calculations of their own beyond a single
calculate call and are never needed as an argument type elsewhere, so only Garch11 --
whose calibrated state (alpha etc.) is queried repeatedly -- gets a dedicated Haskell type;
every GarmanKlass variant, ConstantEstimator, and SimpleLocalEstimator are bound as a
single construct-and-calculate function each.
Synopsis
- data GenCalibratedModel m
- type CalibratedModel = GenCalibratedModel CCalibratedModel
- type GenShortRateModel sm = GenCalibratedModel (AnyOf CShortRateModel' sm)
- type ShortRateModel = GenShortRateModel CShortRateModel
- type GenOneFactorAffineModel om = GenShortRateModel (AnyOf COneFactorAffineModel' om)
- type OneFactorAffineModel = GenOneFactorAffineModel COneFactorAffineModel
- type HullWhite = GenOneFactorAffineModel CHullWhite
- type G2 = GenShortRateModel CG2
- type GenHestonModel hm = GenCalibratedModel (AnyOf CHestonModel' hm)
- type HestonModel = GenHestonModel CHestonModel
- type RoughHestonModel = GenCalibratedModel CRoughHestonModel
- type PiecewiseTimeDependentHestonModel = GenCalibratedModel CPiecewiseTimeDependentHestonModel
- type GenBatesModel bm = GenHestonModel (AnyOf CBatesModel' bm)
- type BatesModel = GenBatesModel CBatesModel
- type BatesDetJumpModel = GenBatesModel CBatesDetJumpModel
- type GenBatesDoubleExpModel bdem = GenHestonModel (AnyOf CBatesDoubleExpModel' bdem)
- type BatesDoubleExpModel = GenBatesDoubleExpModel CBatesDoubleExpModel
- type BatesDoubleExpDetJumpModel = GenBatesDoubleExpModel CBatesDoubleExpDetJumpModel
- type GJRGARCHModel = GenCalibratedModel CGJRGARCHModel
- type Gaussian1dModel = Standalone CGaussian1dModel'
- type Gsr = GenCalibratedModel CGsr
- type MarkovFunctional = GenCalibratedModel CMarkovFunctional
- type LiborForwardModel = GenCalibratedModel CLiborForwardModel
- type HestonSLVMCModel = Standalone CHestonSLVMCModel'
- type HestonSLVFDMModel = Standalone CHestonSLVFDMModel'
- type AffineModel = Standalone CAffineModel'
- type ShortRateDynamics = Standalone CShortRateDynamics'
- data Garch11
- data Garch11Mode
- data GenCalibrationHelper ch
- type CalibrationHelper = GenCalibrationHelper CCalibrationHelper
- type GenBlackCalibrationHelper bch = GenCalibrationHelper (AnyOf CBlackCalibrationHelper' bch)
- type BlackCalibrationHelper = GenBlackCalibrationHelper CBlackCalibrationHelper
- type SwaptionHelper = GenBlackCalibrationHelper CSwaptionHelper
- type BrownianGeneratorFactory = Standalone CBrownianGeneratorFactory'
- data CalibrationErrorType
- data SobolBrownianOrdering
- data HestonSLVGreensAlgorithm
- data HestonSLVVarianceTransformation
- data HestonSLVFokkerPlanckFdmParams = HestonSLVFokkerPlanckFdmParams {
- hestonSlvXGrid :: !Word
- hestonSlvVGrid :: !Word
- hestonSlvTMaxStepsPerYear :: !Word
- hestonSlvTMinStepsPerYear :: !Word
- hestonSlvTStepNumberDecay :: !Double
- hestonSlvNRannacherTimeSteps :: !Word
- hestonSlvPredictionCorrectionSteps :: !Word
- hestonSlvX0Density :: !Double
- hestonSlvLocalVolEpsProb :: !Double
- hestonSlvMaxIntegrationIterations :: !Word
- hestonSlvVLowerEps :: !Double
- hestonSlvVUpperEps :: !Double
- hestonSlvVMin :: !Double
- hestonSlvV0Density :: !Double
- hestonSlvVLowerBoundDensity :: !Double
- hestonSlvVUpperBoundDensity :: !Double
- hestonSlvLeverageFctPropEps :: !Double
- hestonSlvGreensAlgorithm :: !HestonSLVGreensAlgorithm
- hestonSlvVarianceTransformation :: !HestonSLVVarianceTransformation
- hestonSlvSchemeDesc :: !FdmScheme
- data HestonSLVFDMLogEntry = HestonSLVFDMLogEntry {}
- type LfmHullWhiteParameterization = QlLfmHullWhiteParameterization
- data LmCorrelationModel
- data LmVolatilityModel
- data SwaptionSpan
- class AsAffineModel model where
- asAffineModel :: model -> IO AffineModel
- class AsGaussian1dModel model where
- asGaussian1dModel :: model -> IO Gaussian1dModel
- asCalibratedModel :: GenCalibratedModel m -> IO CalibratedModel
- asHestonModel :: GenHestonModel hm -> IO HestonModel
- asShortRateModel :: GenShortRateModel sm -> IO ShortRateModel
- asOneFactorAffineModel :: GenOneFactorAffineModel om -> IO OneFactorAffineModel
- asBatesModel :: GenBatesModel bm -> IO BatesModel
- asBatesDoubleExpModel :: GenBatesDoubleExpModel bdem -> IO BatesDoubleExpModel
- asCalibrationHelper :: GenCalibrationHelper ch -> IO CalibrationHelper
- asBlackCalibrationHelper :: GenBlackCalibrationHelper bch -> IO BlackCalibrationHelper
- batesModel :: BatesProcess -> IO BatesModel
- blackKarasinski :: GenYieldTermStructure y -> Double -> Double -> IO ShortRateModel
- coxIngersollRoss :: Double -> Double -> Double -> Double -> Bool -> IO OneFactorAffineModel
- extendedCoxIngersollRoss :: GenYieldTermStructure y -> Double -> Double -> Double -> Double -> Bool -> IO OneFactorAffineModel
- g2 :: GenYieldTermStructure y -> Double -> Double -> Double -> Double -> Double -> IO G2
- generalizedHullWhite :: GenYieldTermStructure y -> NonEmpty (Day, Double) -> NonEmpty (Day, Double) -> IO ShortRateModel
- gjrGarchModel :: GJRGARCHProcess -> IO GJRGARCHModel
- hestonModel :: GenHestonProcess hp -> IO HestonModel
- roughHestonModel :: GenHestonProcess hp -> Double -> IO RoughHestonModel
- mtBrownianGeneratorFactory :: Word -> IO BrownianGeneratorFactory
- sobolBrownianGeneratorFactory :: SobolBrownianOrdering -> Word -> SobolDirectionIntegers -> IO BrownianGeneratorFactory
- hestonSlvMcModel :: GenLocalVolTermStructure lv -> GenHestonModel hm -> BrownianGeneratorFactory -> Day -> Word -> Word -> Word -> [Day] -> Double -> IO HestonSLVMCModel
- hestonSlvFdmModel :: GenLocalVolTermStructure lv -> GenHestonModel hm -> Day -> HestonSLVFokkerPlanckFdmParams -> Bool -> [Day] -> Double -> IO HestonSLVFDMModel
- hullWhite :: GenYieldTermStructure y -> Double -> Double -> IO HullWhite
- varianceGammaModel :: VarianceGammaProcess -> IO CalibratedModel
- vasicek :: Double -> Double -> Double -> Double -> Double -> IO OneFactorAffineModel
- liborForwardModel :: LiborForwardModelProcess -> LmVolatilityModel -> LmCorrelationModel -> IO LiborForwardModel
- lfmHullWhiteParameterization :: LiborForwardModelProcess -> GenOptionletVolatilityStructure ov -> Matrix Double -> Word -> IO LfmHullWhiteParameterization
- gsr :: GenYieldTermStructure y -> GenQuote q1 -> [(Day, GenQuote q1)] -> GenQuote q2 -> Double -> IO Gsr
- gsrWithReversions :: GenYieldTermStructure y -> (GenQuote q1, GenQuote q2) -> [(Day, (GenQuote q1, GenQuote q2))] -> Double -> IO Gsr
- markovFunctional :: GenYieldTermStructure y -> Double -> Double -> [(Day, Double)] -> GenSwaptionVolatilityStructure sv -> NonEmpty (Day, (Word, TimeUnit)) -> GenSwapIndex sidx -> Word -> IO MarkovFunctional
- markovFunctionalCaplet :: GenYieldTermStructure y -> Double -> Double -> [(Day, Double)] -> GenOptionletVolatilityStructure ov -> NonEmpty Day -> GenIborIndex ibor -> Word -> IO MarkovFunctional
- garch11 :: Double -> Double -> Double -> IO Garch11
- garch11Calibrated :: NonEmpty (Day, Double) -> Garch11Mode -> IO Garch11
- capHelper :: (Word, TimeUnit) -> GenQuote q -> GenIborIndex ibor -> Frequency -> DayCounter -> Bool -> GenYieldTermStructure y -> CalibrationErrorType -> VolatilityType -> Double -> IO BlackCalibrationHelper
- hestonModelHelper :: (Word, TimeUnit) -> Calendar -> GenQuote q1 -> Double -> GenQuote q2 -> GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> CalibrationErrorType -> IO BlackCalibrationHelper
- swaptionHelper :: SwaptionSpan -> GenQuote q -> GenIborIndex ibor -> (Word, TimeUnit) -> DayCounter -> DayCounter -> GenYieldTermStructure y -> CalibrationErrorType -> Maybe Double -> Double -> VolatilityType -> Double -> Maybe Word -> RateAveragingType -> IO SwaptionHelper
- setCovarParam :: LiborForwardModelProcess -> LfmHullWhiteParameterization -> IO ()
- calibrate :: GenCalibratedModel m -> NonEmpty (GenCalibrationHelper ch, Double) -> OptimizationMethod -> EndCriteria -> Maybe Constraint -> [Bool] -> IO ()
- calibrateVolatilitiesIterative :: Gsr -> [GenBlackCalibrationHelper bch] -> OptimizationMethod -> EndCriteria -> Maybe Constraint -> [Double] -> IO ()
- calibrateReversionsIterative :: Gsr -> [GenBlackCalibrationHelper bch] -> OptimizationMethod -> EndCriteria -> Maybe Constraint -> [Double] -> IO ()
- moveVolatility :: Gsr -> Word -> IO [Bool]
- moveReversion :: Gsr -> Word -> IO [Bool]
- setPricingEngine :: GenBlackCalibrationHelper bch -> GenPricingEngine pe -> IO ()
- setParams :: GenCalibratedModel m -> [Double] -> IO ()
- discount :: AffineModel -> Double -> IO Double
- discountBond :: AffineModel -> Double -> Double -> [Double] -> IO Double
- discountBondOption :: AffineModel -> OptionType -> Double -> Double -> Maybe Double -> Double -> IO Double
- convexityBias :: Double -> Double -> Double -> Double -> Double -> IO Double
- numeraire :: Gaussian1dModel -> Day -> Double -> Maybe (GenYieldTermStructure y) -> IO Double
- gaussian1dZerobond :: Gaussian1dModel -> Day -> Maybe Day -> Double -> Maybe (GenYieldTermStructure y) -> IO Double
- gaussian1dZerobondOption :: Gaussian1dModel -> OptionType -> Day -> Day -> Day -> Double -> Maybe Day -> Double -> Maybe (GenYieldTermStructure y) -> Double -> Word -> Bool -> Bool -> IO Double
- gaussian1dCompoundedRate :: Gaussian1dModel -> OvernightIndexedCoupon -> Maybe Day -> Double -> Maybe (GenYieldTermStructure y) -> IO Double
- gaussian1dForwardRate :: Gaussian1dModel -> Day -> Maybe Day -> Double -> Maybe (GenIborIndex ibor) -> IO Double
- gaussian1dSwapRate :: Gaussian1dModel -> Day -> (Int, TimeUnit) -> Maybe Day -> Double -> Maybe (GenSwapIndex sidx) -> IO Double
- gaussian1dSwapAnnuity :: Gaussian1dModel -> Day -> (Int, TimeUnit) -> Maybe Day -> Double -> Maybe (GenSwapIndex sidx) -> IO Double
- gaussian1dYGrid :: Gaussian1dModel -> Double -> Int -> Double -> Double -> Double -> IO RealVector
- lfmHullWhiteCovariance :: LfmHullWhiteParameterization -> Double -> [Double] -> IO (Matrix Double)
- liborForwardModelS0 :: LiborForwardModel -> Word -> Word -> IO Double
- blackPrice :: GenBlackCalibrationHelper bch -> Double -> IO Double
- impliedVolatility :: GenBlackCalibrationHelper bch -> Double -> Double -> Word -> Double -> Double -> IO Double
- roughHestonTheta :: RoughHestonModel -> IO Double
- roughHestonKappa :: RoughHestonModel -> IO Double
- roughHestonSigma :: RoughHestonModel -> IO Double
- roughHestonRho :: RoughHestonModel -> IO Double
- roughHestonV0 :: RoughHestonModel -> IO Double
- roughHestonHurst :: RoughHestonModel -> IO Double
- roughHestonProcess :: RoughHestonModel -> IO HestonProcess
- class HasLeverageFunction a where
- leverageFunction :: a -> IO LocalVolTermStructure
- class HasVolatilities a where
- volatilities :: a -> IO [Double]
- reversions :: Gsr -> IO [Double]
- class HasHelperUnderlying h where
- type HelperUnderlying h
- helperInstrument :: h -> IO (HelperUnderlying h)
- g2Dynamics :: G2 -> IO ShortRateDynamics
- shortRate :: ShortRateDynamics -> Double -> Double -> Double -> IO Double
- stateProcess :: Gaussian1dModel -> IO StochasticProcess1D
- hestonSlvFdmLogEntries :: HestonSLVFDMModel -> IO [HestonSLVFDMLogEntry]
- helperSwaption :: SwaptionHelper -> IO Swaption
- times :: GenBlackCalibrationHelper bch -> IO [Double]
- fixedReversion :: [Bool]
- params :: GenCalibratedModel m -> IO [Double]
- value :: GenCalibratedModel m -> [Double] -> [GenCalibrationHelper ch] -> IO Double
- calibrationError :: GenBlackCalibrationHelper bch -> IO Double
- marketValue :: GenBlackCalibrationHelper bch -> IO Double
- modelValue :: GenBlackCalibrationHelper bch -> IO Double
- volatility :: GenBlackCalibrationHelper bch -> IO Quote
- forecast :: Garch11 -> Double -> Double -> Double
- calculate :: Garch11 -> NonEmpty (Day, Double) -> IO [(Day, Double)]
- garmanKlassSimpleSigma :: Double -> NonEmpty (Day, Double, Double, Double, Double) -> IO [(Day, Double)]
- garmanKlassSigma1 :: Double -> Double -> NonEmpty (Day, Double, Double, Double, Double) -> IO [(Day, Double)]
- parkinsonSigma :: Double -> NonEmpty (Day, Double, Double, Double, Double) -> IO [(Day, Double)]
- garmanKlassSigma3 :: Double -> Double -> NonEmpty (Day, Double, Double, Double, Double) -> IO [(Day, Double)]
- garmanKlassSigma4 :: Double -> NonEmpty (Day, Double, Double, Double, Double) -> IO [(Day, Double)]
- garmanKlassSigma5 :: Double -> NonEmpty (Day, Double, Double, Double, Double) -> IO [(Day, Double)]
- garmanKlassSigma6 :: Double -> Double -> NonEmpty (Day, Double, Double, Double, Double) -> IO [(Day, Double)]
- constantVolatilityEstimator :: Word -> NonEmpty (Day, Double) -> IO [(Day, Double)]
- simpleLocalVolatilityEstimator :: Double -> NonEmpty (Day, Double) -> IO [(Day, Double)]
- alpha :: Garch11 -> Double
- beta :: Garch11 -> Double
- omega :: Garch11 -> Double
- longTermVolatility :: Garch11 -> Double
- logLikelihood :: Garch11 -> Double
Types
Model hierarchy
data GenCalibratedModel m Source #
CalibratedModel
LiborForwardModel + AffineModel
GJRGARCHModel
PiecewiseTimeDependentHestonModel
RoughHestonModel
HestonModel
BatesModel
BatesDetJumpModel
BatesDoubleExpModel
BatesDoubleExpDetJumpModel
ShortRateModel
G2 + AffineModel
OneFactorAffineModel + AffineModel
HullWhite + AffineModel
Gsr + Gaussian1dModel
MarkovFunctional + Gaussian1dModelInstances
| AsAffineModel G2 Source # | |
Defined in QuantLib.Internal.Type Methods asAffineModel :: G2 -> IO AffineModel Source # | |
| AsAffineModel LiborForwardModel Source # | |
Defined in QuantLib.Internal.Type Methods asAffineModel :: LiborForwardModel -> IO AffineModel Source # | |
| AsGaussian1dModel Gsr Source # | |
Defined in QuantLib.Internal.Type Methods asGaussian1dModel :: Gsr -> IO Gaussian1dModel Source # | |
| AsGaussian1dModel MarkovFunctional Source # | |
Defined in QuantLib.Internal.Type Methods asGaussian1dModel :: MarkovFunctional -> IO Gaussian1dModel Source # | |
| HasVolatilities Gsr Source # | |
Defined in QuantLib.Model | |
| HasVolatilities MarkovFunctional Source # | |
Defined in QuantLib.Model Methods volatilities :: MarkovFunctional -> IO [Double] Source # | |
| AsAffineModel (GenOneFactorAffineModel model) Source # | |
Defined in QuantLib.Internal.Type Methods asAffineModel :: GenOneFactorAffineModel model -> IO AffineModel Source # | |
type CalibratedModel = GenCalibratedModel CCalibratedModel Source #
The root of the hierarchy shown under GenCalibratedModel.
type GenShortRateModel sm = GenCalibratedModel (AnyOf CShortRateModel' sm) Source #
A ShortRateModel or one of its leaves; see the hierarchy under GenCalibratedModel.
type ShortRateModel = GenShortRateModel CShortRateModel Source #
A CalibratedModel; see the hierarchy under GenCalibratedModel.
type GenOneFactorAffineModel om = GenShortRateModel (AnyOf COneFactorAffineModel' om) Source #
An OneFactorAffineModel or one of its leaves; see the hierarchy under GenCalibratedModel.
type OneFactorAffineModel = GenOneFactorAffineModel COneFactorAffineModel Source #
A ShortRateModel; see the hierarchy under GenCalibratedModel.
type HullWhite = GenOneFactorAffineModel CHullWhite Source #
An OneFactorAffineModel; see the hierarchy under GenCalibratedModel.
type G2 = GenShortRateModel CG2 Source #
A ShortRateModel; see the hierarchy under GenCalibratedModel.
type GenHestonModel hm = GenCalibratedModel (AnyOf CHestonModel' hm) Source #
A HestonModel or one of its leaves; see the hierarchy under GenCalibratedModel.
type HestonModel = GenHestonModel CHestonModel Source #
A CalibratedModel; see the hierarchy under GenCalibratedModel.
type RoughHestonModel = GenCalibratedModel CRoughHestonModel Source #
A CalibratedModel with its concrete native interface preserved.
type PiecewiseTimeDependentHestonModel = GenCalibratedModel CPiecewiseTimeDependentHestonModel Source #
A CalibratedModel; see the hierarchy under GenCalibratedModel.
type GenBatesModel bm = GenHestonModel (AnyOf CBatesModel' bm) Source #
A BatesModel or one of its leaves; see the hierarchy under GenCalibratedModel.
type BatesModel = GenBatesModel CBatesModel Source #
A HestonModel; see the hierarchy under GenCalibratedModel.
type BatesDetJumpModel = GenBatesModel CBatesDetJumpModel Source #
A BatesModel; see the hierarchy under GenCalibratedModel.
type GenBatesDoubleExpModel bdem = GenHestonModel (AnyOf CBatesDoubleExpModel' bdem) Source #
A BatesDoubleExpModel or one of its leaves; see the hierarchy under GenCalibratedModel.
type BatesDoubleExpModel = GenBatesDoubleExpModel CBatesDoubleExpModel Source #
A HestonModel; see the hierarchy under GenCalibratedModel.
type BatesDoubleExpDetJumpModel = GenBatesDoubleExpModel CBatesDoubleExpDetJumpModel Source #
A BatesDoubleExpModel; see the hierarchy under GenCalibratedModel.
type GJRGARCHModel = GenCalibratedModel CGJRGARCHModel Source #
A CalibratedModel; see the hierarchy under GenCalibratedModel.
type Gaussian1dModel = Standalone CGaussian1dModel' Source #
type Gsr = GenCalibratedModel CGsr Source #
A CalibratedModel; see the hierarchy under GenCalibratedModel.
type MarkovFunctional = GenCalibratedModel CMarkovFunctional Source #
A CalibratedModel; see the hierarchy under GenCalibratedModel.
type LiborForwardModel = GenCalibratedModel CLiborForwardModel Source #
A CalibratedModel; see the hierarchy under GenCalibratedModel.
type HestonSLVMCModel = Standalone CHestonSLVMCModel' Source #
type HestonSLVFDMModel = Standalone CHestonSLVFDMModel' Source #
type AffineModel = Standalone CAffineModel' Source #
type ShortRateDynamics = Standalone CShortRateDynamics' Source #
The two-factor short-rate dynamics (state variables x, y with r_t = phi(t) + x_t + y_t)
underlying a G2 model, as returned by TwoFactorModel::dynamics().
Historical volatility estimators
data Garch11Mode Source #
Constructors
| MomentMatchingGuess | |
| GammaGuess | |
| BestOfTwo | |
| DoubleOptimization |
Instances
| Enum Garch11Mode Source # | |
Defined in QuantLib.Model Methods succ :: Garch11Mode -> Garch11Mode # pred :: Garch11Mode -> Garch11Mode # toEnum :: Int -> Garch11Mode # fromEnum :: Garch11Mode -> Int # enumFrom :: Garch11Mode -> [Garch11Mode] # enumFromThen :: Garch11Mode -> Garch11Mode -> [Garch11Mode] # enumFromTo :: Garch11Mode -> Garch11Mode -> [Garch11Mode] # enumFromThenTo :: Garch11Mode -> Garch11Mode -> Garch11Mode -> [Garch11Mode] # | |
| Read Garch11Mode Source # | |
Defined in QuantLib.Model Methods readsPrec :: Int -> ReadS Garch11Mode # readList :: ReadS [Garch11Mode] # readPrec :: ReadPrec Garch11Mode # readListPrec :: ReadPrec [Garch11Mode] # | |
| Show Garch11Mode Source # | |
Defined in QuantLib.Model Methods showsPrec :: Int -> Garch11Mode -> ShowS # show :: Garch11Mode -> String # showList :: [Garch11Mode] -> ShowS # | |
| Eq Garch11Mode Source # | |
Defined in QuantLib.Model | |
Calibration helpers
data GenCalibrationHelper ch Source #
CalibrationHelper
BlackCalibrationHelper*
SwaptionHelperInstances
| HasHelperUnderlying SwaptionHelper Source # | |||||
Defined in QuantLib.TermStructure Associated Types
Methods helperInstrument :: SwaptionHelper -> IO (HelperUnderlying SwaptionHelper) Source # | |||||
| type HelperUnderlying SwaptionHelper Source # | |||||
Defined in QuantLib.TermStructure | |||||
type CalibrationHelper = GenCalibrationHelper CCalibrationHelper Source #
The root of the hierarchy shown under GenCalibrationHelper.
type GenBlackCalibrationHelper bch = GenCalibrationHelper (AnyOf CBlackCalibrationHelper' bch) Source #
A BlackCalibrationHelper or one of its leaves; see the hierarchy under GenCalibrationHelper.
type BlackCalibrationHelper = GenBlackCalibrationHelper CBlackCalibrationHelper Source #
A CalibrationHelper; see the hierarchy under GenCalibrationHelper.
type SwaptionHelper = GenBlackCalibrationHelper CSwaptionHelper Source #
A BlackCalibrationHelper; see the hierarchy under GenCalibrationHelper.
type BrownianGeneratorFactory = Standalone CBrownianGeneratorFactory' Source #
Configuration
data CalibrationErrorType Source #
Constructors
| RelativePriceError | |
| PriceError | |
| ImpliedVolError |
Instances
data SobolBrownianOrdering Source #
Sobol Brownian-bridge coordinate ordering.
Instances
data HestonSLVGreensAlgorithm Source #
Initial-density approximation used by the Heston SLV Fokker--Planck calibrator.
Constructors
| ZeroCorrelation | |
| Gaussian | |
| SemiAnalytical |
Instances
data HestonSLVVarianceTransformation Source #
Variance-coordinate transformation used by the Heston SLV Fokker--Planck calibrator.
Instances
data HestonSLVFokkerPlanckFdmParams Source #
Full numerical configuration for QuantLib's Fokker--Planck SLV calibration.
Constructors
data HestonSLVFDMLogEntry Source #
A copied FDM diagnostic snapshot. Coordinates are the native mesher coordinates: the spot
axis is log-spot and the variance axis follows hestonSlvVarianceTransformation. Density rows
correspond to variance coordinates and columns to log-spot coordinates.
Constructors
| HestonSLVFDMLogEntry | |
Instances
| Show HestonSLVFDMLogEntry Source # | |
Defined in QuantLib.Model Methods showsPrec :: Int -> HestonSLVFDMLogEntry -> ShowS # show :: HestonSLVFDMLogEntry -> String # showList :: [HestonSLVFDMLogEntry] -> ShowS # | |
| Eq HestonSLVFDMLogEntry Source # | |
Defined in QuantLib.Model Methods (==) :: HestonSLVFDMLogEntry -> HestonSLVFDMLogEntry -> Bool # (/=) :: HestonSLVFDMLogEntry -> HestonSLVFDMLogEntry -> Bool # | |
type LfmHullWhiteParameterization = QlLfmHullWhiteParameterization Source #
data LmCorrelationModel Source #
Constructors
| ConstWrapperCorrelation LmCorrelationModel | |
| ExponentialCorrelation | |
| LinearExponentialCorrelation | |
Instances
| Show LmCorrelationModel Source # | |
Defined in QuantLib.Internal.Common Methods showsPrec :: Int -> LmCorrelationModel -> ShowS # show :: LmCorrelationModel -> String # showList :: [LmCorrelationModel] -> ShowS # | |
| Eq LmCorrelationModel Source # | |
Defined in QuantLib.Internal.Common Methods (==) :: LmCorrelationModel -> LmCorrelationModel -> Bool # (/=) :: LmCorrelationModel -> LmCorrelationModel -> Bool # | |
data LmVolatilityModel Source #
Constructors
| ConstWrapperVolatility LmVolatilityModel | |
| FixedVolatility !(NonEmpty (Double, Double)) | (start time, volatility) |
| LinearExponentialVolatility | |
Instances
| Show LmVolatilityModel Source # | |
Defined in QuantLib.Internal.Common Methods showsPrec :: Int -> LmVolatilityModel -> ShowS # show :: LmVolatilityModel -> String # showList :: [LmVolatilityModel] -> ShowS # | |
| Eq LmVolatilityModel Source # | |
Defined in QuantLib.Internal.Common Methods (==) :: LmVolatilityModel -> LmVolatilityModel -> Bool # (/=) :: LmVolatilityModel -> LmVolatilityModel -> Bool # | |
data SwaptionSpan Source #
A swaption helper's exercise and underlying-swap span.
Constructors
| SpanTenors !(Word, TimeUnit) !(Word, TimeUnit) | maturity, length |
| SpanFromDate !Day !(Word, TimeUnit) | exerciseDate, length |
| SpanDates !Day !Day | exerciseDate, endDate |
Instances
| Show SwaptionSpan Source # | |
Defined in QuantLib.Model Methods showsPrec :: Int -> SwaptionSpan -> ShowS # show :: SwaptionSpan -> String # showList :: [SwaptionSpan] -> ShowS # | |
| Eq SwaptionSpan Source # | |
Defined in QuantLib.Model | |
Constructors
Hierarchy and secondary-interface conversion
class AsAffineModel model where Source #
Models that can be materialized as QuantLib's secondary AffineModel interface.
The result owns a shared handle to the same underlying model.
Methods
asAffineModel :: model -> IO AffineModel Source #
Instances
| AsAffineModel AffineModel Source # | |
Defined in QuantLib.Internal.Type Methods asAffineModel :: AffineModel -> IO AffineModel Source # | |
| AsAffineModel G2 Source # | |
Defined in QuantLib.Internal.Type Methods asAffineModel :: G2 -> IO AffineModel Source # | |
| AsAffineModel LiborForwardModel Source # | |
Defined in QuantLib.Internal.Type Methods asAffineModel :: LiborForwardModel -> IO AffineModel Source # | |
| AsAffineModel (GenOneFactorAffineModel model) Source # | |
Defined in QuantLib.Internal.Type Methods asAffineModel :: GenOneFactorAffineModel model -> IO AffineModel Source # | |
class AsGaussian1dModel model where Source #
Models that can be materialized as QuantLib's secondary Gaussian1dModel interface.
The result owns a shared handle to the same underlying model.
Methods
asGaussian1dModel :: model -> IO Gaussian1dModel Source #
Instances
| AsGaussian1dModel Gaussian1dModel Source # | |
Defined in QuantLib.Internal.Type Methods asGaussian1dModel :: Gaussian1dModel -> IO Gaussian1dModel Source # | |
| AsGaussian1dModel Gsr Source # | |
Defined in QuantLib.Internal.Type Methods asGaussian1dModel :: Gsr -> IO Gaussian1dModel Source # | |
| AsGaussian1dModel MarkovFunctional Source # | |
Defined in QuantLib.Internal.Type Methods asGaussian1dModel :: MarkovFunctional -> IO Gaussian1dModel Source # | |
asHestonModel :: GenHestonModel hm -> IO HestonModel Source #
asShortRateModel :: GenShortRateModel sm -> IO ShortRateModel Source #
asBatesModel :: GenBatesModel bm -> IO BatesModel Source #
Model construction
batesModel :: BatesProcess -> IO BatesModel Source #
Bates stochastic-volatility model: extends Heston with jumps in the underlying's return process.
Arguments
| :: GenYieldTermStructure y | |
| -> Double | y |
| -> Double | sigma |
| -> IO ShortRateModel |
Black-Karasinski short-rate model: d(ln r) = (theta(t) - a ln r) dt + sigma dW, with constant reversion a and volatility sigma.
Arguments
| :: Double | r0 |
| -> Double | theta |
| -> Double | k |
| -> Double | sigma |
| -> Bool | withFellerConstraint |
| -> IO OneFactorAffineModel |
Cox-Ingersoll-Ross short-rate model: dr = k(theta - r) dt + sigma sqrt(r) dW.
extendedCoxIngersollRoss Source #
Arguments
| :: GenYieldTermStructure y | |
| -> Double | theta |
| -> Double | k |
| -> Double | sigma |
| -> Double | x0 |
| -> Bool | withFellerConstraint |
| -> IO OneFactorAffineModel |
Extended CIR model: adds a deterministic term-structure-fitting shift to a standard Cox-Ingersoll-Ross process.
Arguments
| :: GenYieldTermStructure y | |
| -> Double | y |
| -> Double | sigma |
| -> Double | b |
| -> Double | eta |
| -> Double | rho |
| -> IO G2 |
Two-additive-factor Gaussian (G2) short-rate model: the sum of two correlated Ornstein-Uhlenbeck factors.
Arguments
| :: GenYieldTermStructure y | |
| -> NonEmpty (Day, Double) | speedstructure |
| -> NonEmpty (Day, Double) | volstructure |
| -> IO ShortRateModel |
Generalized Hull-White model: like hullWhite, but reversion and volatility are piecewise-linear functions of time given at speedstructure/volstructure dates.
gjrGarchModel :: GJRGARCHProcess -> IO GJRGARCHModel Source #
GJR-GARCH stochastic-volatility model, extending GARCH(1,1) with an asymmetric response to negative return shocks.
hestonModel :: GenHestonProcess hp -> IO HestonModel Source #
Heston stochastic-volatility model, calibrated from a HestonProcess.
Arguments
| :: GenHestonProcess hp | process |
| -> Double | hurst |
| -> IO RoughHestonModel |
Rough Heston volatility model (1.44). Hurst is constrained to [0, 0.5]; 0.5 is classical Heston.
mtBrownianGeneratorFactory Source #
Arguments
| :: Word | seed |
| -> IO BrownianGeneratorFactory |
Pseudo-random Mersenne-Twister Brownian increments for SLV Monte-Carlo calibration. Use a
fixed nonzero seed for reproducible calibration output; QuantLib treats zero as entropy.
sobolBrownianGeneratorFactory Source #
Arguments
| :: SobolBrownianOrdering | ordering |
| -> Word | seed |
| -> SobolDirectionIntegers | directionIntegers |
| -> IO BrownianGeneratorFactory |
Low-discrepancy Sobol Brownian increments for SLV Monte-Carlo calibration. Supply a fixed
nonzero seed to make the resulting leverage function reproducible.
Arguments
| :: GenLocalVolTermStructure lv | localVol |
| -> GenHestonModel hm | hestonModel |
| -> BrownianGeneratorFactory | brownianGeneratorFactory |
| -> Day | endDate |
| -> Word | timeStepsPerYear |
| -> Word | nBins |
| -> Word | calibrationPaths |
| -> [Day] | mandatoryDates |
| -> Double | mixingFactor |
| -> IO HestonSLVMCModel |
Monte-Carlo calibration of a Heston stochastic-local-volatility leverage function. The
trailing arguments mirror QuantLib's defaults explicitly; mandatoryDates are inserted into
the calibration time grid.
hestonSlvFdmModel :: GenLocalVolTermStructure lv -> GenHestonModel hm -> Day -> HestonSLVFokkerPlanckFdmParams -> Bool -> [Day] -> Double -> IO HestonSLVFDMModel Source #
Fokker--Planck finite-difference calibration of a Heston stochastic-local-volatility
leverage function. logging retains diagnostic density snapshots for
hestonSlvFdmLogEntries; mandatoryDates are added to its adaptive time grid.
Arguments
| :: GenYieldTermStructure y | |
| -> Double | a (mean reversion) |
| -> Double | sigma |
| -> IO HullWhite |
Single-factor Hull-White (extended Vasicek) short-rate model: dr = (theta(t) - a r) dt + sigma dW, fitted to the given term structure.
varianceGammaModel :: VarianceGammaProcess -> IO CalibratedModel Source #
Variance Gamma model for the underlying's log-return process (Madan-Carr-Chang).
Vasicek short-rate model: dr = a(b - r) dt + sigma dW, with an optional risk premium lambda.
liborForwardModel :: LiborForwardModelProcess -> LmVolatilityModel -> LmCorrelationModel -> IO LiborForwardModel Source #
Libor market (BGM) forward-rate model, built from a LiborForwardModelProcess plus volatility and correlation models.
lfmHullWhiteParameterization Source #
Arguments
| :: LiborForwardModelProcess | |
| -> GenOptionletVolatilityStructure ov | |
| -> Matrix Double | correlation |
| -> Word | factors |
| -> IO LfmHullWhiteParameterization |
Hull-White caplet-volatility parameterization for a Libor forward model. The correlation
matrix and factor count are explicit, mirroring QuantLib's defaulted constructor arguments;
pass an empty matrix and 1 for its standard one-factor default.
gsr :: GenYieldTermStructure y -> GenQuote q1 -> [(Day, GenQuote q1)] -> GenQuote q2 -> Double -> IO Gsr Source #
One-factor GSR model (formulated in the forward measure), with an initial volatility and piecewise-constant changes at the given dates, plus a single constant reversion.
gsrWithReversions :: GenYieldTermStructure y -> (GenQuote q1, GenQuote q2) -> [(Day, (GenQuote q1, GenQuote q2))] -> Double -> IO Gsr Source #
One-factor GSR model with a piecewise-constant reversion as well as volatility: the initial
(volatility, reversion) pair holds until the first step date, and each step date starts a new
pair. calibrateReversionsIterative needs this form, one reversion per calibration helper.
Arguments
| :: GenYieldTermStructure y | |
| -> Double | reversion |
| -> Double | initial volatility |
| -> [(Day, Double)] | subsequent volatility steps |
| -> GenSwaptionVolatilityStructure sv | |
| -> NonEmpty (Day, (Word, TimeUnit)) | swaption expiry/tenor calibration points |
| -> GenSwapIndex sidx | swapIndexBase |
| -> Word | yGridPoints |
| -> IO MarkovFunctional |
Markov-functional interest-rate model, calibrated to a swaption volatility cube against swapIndexBase.
markovFunctionalCaplet :: GenYieldTermStructure y -> Double -> Double -> [(Day, Double)] -> GenOptionletVolatilityStructure ov -> NonEmpty Day -> GenIborIndex ibor -> Word -> IO MarkovFunctional Source #
Markov-functional interest-rate model, calibrated to a caplet volatility structure against iborIndex.
Direct-parameter GARCH(1,1) model: vl is the long-term (unconditional) volatility: the
model's persistence gamma = 1 - alpha - beta and omega = vl * gamma are derived from it.
Does not calibrate; use garch11Calibrated to fit alpha/beta/vl to an observed series.
Calibrates a GARCH(1,1) model to an observed return series via maximum likelihood. All four
Garch11Mode values converge to the same maximum-likelihood fit for a well-behaved series --
they differ only in the initial guess (MomentMatchingGuess/GammaGuess), or run both and
keep the better (BestOfTwo, the upstream default) or optimize from each in turn
(DoubleOptimization). There is no way from Haskell to supply a custom
OptimizationMethod/EndCriteria or to re-calibrate an existing model in place (upstream's
calibrate overloads are mutators on an already-constructed object); construct a fresh model
if a different fit is needed.
Calibration helpers
Arguments
| :: (Word, TimeUnit) | length |
| -> GenQuote q | volatility |
| -> GenIborIndex ibor | |
| -> Frequency | fixedLegFrequency |
| -> DayCounter | |
| -> Bool | includeFirstSwaplet |
| -> GenYieldTermStructure y | |
| -> CalibrationErrorType | |
| -> VolatilityType | type |
| -> Double | shift |
| -> IO BlackCalibrationHelper |
Calibration helper for an at-the-money interest-rate cap.
Arguments
| :: (Word, TimeUnit) | maturity |
| -> Calendar | |
| -> GenQuote q1 | s0 |
| -> Double | strikePrice |
| -> GenQuote q2 | volatility |
| -> GenYieldTermStructure y1 | riskFreeRate |
| -> GenYieldTermStructure y2 | dividendYield |
| -> CalibrationErrorType | |
| -> IO BlackCalibrationHelper |
Calibration helper for the Heston model, from a European option's market volatility.
swaptionHelper :: SwaptionSpan -> GenQuote q -> GenIborIndex ibor -> (Word, TimeUnit) -> DayCounter -> DayCounter -> GenYieldTermStructure y -> CalibrationErrorType -> Maybe Double -> Double -> VolatilityType -> Double -> Maybe Word -> RateAveragingType -> IO SwaptionHelper Source #
Calibration helper for a swaption, over the given exercise/underlying span.
Mutators
Arguments
| :: LiborForwardModelProcess | process |
| -> LfmHullWhiteParameterization | param |
| -> IO () |
installs the covariance parameterization a LiborForwardModelProcess evolves under.
Mandatory before the process is used for anything dynamic: a freshly constructed
liborForwardModelProcess holds no parameterization, and
drift, diffusion, evolve,
factors and pathGenerator all dereference it.
discountBond, the fixing/accrual times and
cashFlows do not, and work without it.
Arguments
| :: GenCalibratedModel m | |
| -> NonEmpty (GenCalibrationHelper ch, Double) | (instrument, weight) |
| -> OptimizationMethod | |
| -> EndCriteria | |
| -> Maybe Constraint | |
| -> [Bool] | fixParameters, e.g. |
| -> IO () |
Calibrate to a set of market instruments (caps/swaptions) An additional constraint can be passed which must be satisfied in addition to the constraints of the model.
calibrateVolatilitiesIterative :: Gsr -> [GenBlackCalibrationHelper bch] -> OptimizationMethod -> EndCriteria -> Maybe Constraint -> [Double] -> IO () Source #
Iteratively calibrates the volatility step values, one at a time, to the given helpers (assumed to have step dates matching the model's volatility step dates).
calibrateReversionsIterative :: Gsr -> [GenBlackCalibrationHelper bch] -> OptimizationMethod -> EndCriteria -> Maybe Constraint -> [Double] -> IO () Source #
Iteratively calibrates the reversions, one at a time: reversion i is fitted to helper i
with every other parameter held. The model needs one reversion per helper at least, so build
it with gsrWithReversions. The end criteria reflect only the last calibration.
A swaption's price depends on the reversion over its swap's life, so helper i should exercise
inside reversion interval i and span it. Helpers expiring at the volatility step dates leave
the fit ill-conditioned, and alternating with calibrateVolatilitiesIterative can diverge.
The calibration mask (calibrate's fixParameters) that fixes every model parameter except
the volatility at step index i (0-based) -- a ready-made fixParameters argument for
calibrating that one volatility in isolation.
The calibration mask that fixes every model parameter except the reversion at index i
(0-based) -- the reversion counterpart of moveVolatility. Only index 0 exists unless the model
was built by gsrWithReversions.
setPricingEngine :: GenBlackCalibrationHelper bch -> GenPricingEngine pe -> IO () Source #
Sets the pricing engine used to compute this calibration helper's model value.
Arguments
| :: GenCalibratedModel m | |
| -> [Double] | params |
| -> IO () |
Replace the arguments on which calibration is done, in the order params returns them, and
notify the model's observers, so engines on it reprice. An array whose length differs from
params' throws and leaves the model unchanged; the model's constraint is not checked. A later
calibrate starts from these values.
Inspectors
Pricing and rate calculations
Arguments
| :: AffineModel | |
| -> Double | t |
| -> IO Double |
Discount factor at time t under the model's own fitted curve -- AffineModel::discount.
Not pure: depends on the model's YieldTermStructure handle, which can be relinked after
construction (see discountBond below for the same caveat).
Price of a discount bond paying 1 at maturity, given the model's state factors at time
now -- AffineModel::discountBond(Time,Time,Array). factors is model-specific: a
one-element list of the short rate for OneFactorAffineModel/HullWhite, a two-element list
for G2, or ignored by LiborForwardModel. Not pure for the same relinkable-curve reason as
discount.
discountBondOption :: AffineModel -> OptionType -> Double -> Double -> Maybe Double -> Double -> IO Double Source #
Futures convexity bias (difference between futures implied rate and forward rate), per G. Kirikos, D. Novak, "Convexity Conundrums", Risk Magazine, March 1997. t/T are in yearfraction using the deposit day counter, futurePrice is the futures' market price.
Not pure: convexityBias can throw (QL_REQUIRE on its inputs), and letting a C++
exception unwind across the FFI boundary from an unsafePerformIO-backed pure binding is undefined
behavior, so this needs the same 'char **e/preErrorCheck' error channel as any other throwing call.
Arguments
| :: Gaussian1dModel | |
| -> Day | referenceDate |
| -> Double | y |
| -> Maybe (GenYieldTermStructure y) | yts |
| -> IO Double |
Numeraire value at referenceDate, conditional on the standardized state variable y
(0 = the model's expected path). yts overrides the model's own term structure for
discounting when given, otherwise the model's own curve is used.
Arguments
| :: Gaussian1dModel | |
| -> Day | maturity |
| -> Maybe Day | referenceDate |
| -> Double | y |
| -> Maybe (GenYieldTermStructure y) | yts |
| -> IO Double |
Price at referenceDate (default: the evaluation date) of a zero-coupon bond paying 1 at
maturity, conditional on the standardized state variable y (0 = the model's expected
path). yts overrides the model's own term structure for discounting when given.
gaussian1dZerobondOption Source #
Arguments
| :: Gaussian1dModel | |
| -> OptionType | type |
| -> Day | expiry |
| -> Day | valueDate |
| -> Day | maturity |
| -> Double | strike |
| -> Maybe Day | referenceDate |
| -> Double | y |
| -> Maybe (GenYieldTermStructure y) | yts |
| -> Double | yStdDevs |
| -> Word | yGridPoints |
| -> Bool | extrapolatePayoff |
| -> Bool | flatPayoffExtrapolation |
| -> IO Double |
Price of a European option of type, expiring at expiry with strike, on a zero-coupon
bond that itself pays 1 at maturity and settles at valueDate, conditional on the
standardized state variable y at referenceDate (default: the evaluation date). yts
overrides the model's own discounting curve when given. The option payoff is evaluated on a
grid of yGridPoints points spanning yStdDevs standard deviations of y;
extrapolatePayoff/flatPayoffExtrapolation control payoff extrapolation beyond the grid.
gaussian1dCompoundedRate Source #
Arguments
| :: Gaussian1dModel | model |
| -> OvernightIndexedCoupon | coupon |
| -> Maybe Day | referenceDate |
| -> Double | y |
| -> Maybe (GenYieldTermStructure y) | curve |
| -> IO Double |
Conditional compounded overnight rate using the coupon's observation dates and index day counter; ignores gearing/spread and historical fixings. Requires QuantLib 1.44. Nothing selects the model reference date or model curve.
gaussian1dForwardRate Source #
Arguments
| :: Gaussian1dModel | |
| -> Day | fixing |
| -> Maybe Day | referenceDate |
| -> Double | y |
| -> Maybe (GenIborIndex ibor) | iborIdx |
| -> IO Double |
Forward rate for iborIdx fixing on fixing, conditional on the standardized state
variable y at referenceDate (default: the evaluation date). iborIdx defaults to the
model's own term structure's natural index when omitted.
Arguments
| :: Gaussian1dModel | |
| -> Day | fixing |
| -> (Int, TimeUnit) | tenor |
| -> Maybe Day | referenceDate |
| -> Double | y |
| -> Maybe (GenSwapIndex sidx) | swapIdx |
| -> IO Double |
Fair swap rate for a swap on swapIdx fixing on fixing with tenor tenor, conditional on
the standardized state variable y at referenceDate (default: the evaluation date).
gaussian1dSwapAnnuity Source #
Arguments
| :: Gaussian1dModel | |
| -> Day | fixing |
| -> (Int, TimeUnit) | tenor |
| -> Maybe Day | referenceDate |
| -> Double | y |
| -> Maybe (GenSwapIndex sidx) | swapIdx |
| -> IO Double |
Annuity (present value of a 1bp fixed leg) of a swap on swapIdx fixing on fixing with
tenor tenor, conditional on the standardized state variable y at referenceDate
(default: the evaluation date).
Arguments
| :: Gaussian1dModel | |
| -> Double | yStdDevs |
| -> Int | gridPoints |
| -> Double | bigT |
| -> Double | t |
| -> Double | y |
| -> IO RealVector |
Grid of values for the standardized state variable at time T, conditional on the
variable being y at time t, spanning yStdDevs standard deviations with
2*gridPoints+1 points.
lfmHullWhiteCovariance :: LfmHullWhiteParameterization -> Double -> [Double] -> IO (Matrix Double) Source #
Instantaneous covariance matrix at t for the supplied forward-rate state x.
Arguments
| :: LiborForwardModel | |
| -> Word | alpha |
| -> Word | beta |
| -> IO Double |
Initial value of the discrete forward rate indexed by alpha, as seen from time index beta
(both indices into the process's tenor structure): the model's calibration input S_0(alpha,beta).
Arguments
| :: GenBlackCalibrationHelper bch | |
| -> Double | volatility |
| -> IO Double |
Black price given a volatility.
Arguments
| :: GenBlackCalibrationHelper bch | |
| -> Double | targetValue |
| -> Double | accuracy |
| -> Word | maxEvaluations |
| -> Double | minVol |
| -> Double | maxVol |
| -> IO Double |
Black volatility implied by the model.
Model state and calibration
Arguments
| :: RoughHestonModel | model |
| -> IO Double |
Current calibrated theta (1.44).
Arguments
| :: RoughHestonModel | model |
| -> IO Double |
Current calibrated kappa (1.44).
Arguments
| :: RoughHestonModel | model |
| -> IO Double |
Current calibrated sigma (1.44).
Arguments
| :: RoughHestonModel | model |
| -> IO Double |
Current calibrated hurst (1.44).
Arguments
| :: RoughHestonModel | model |
| -> IO HestonProcess |
Current calibrated process (1.44).
class HasLeverageFunction a where Source #
Models that expose a calibrated local-volatility leverage function.
Methods
leverageFunction :: a -> IO LocalVolTermStructure Source #
Instances
| HasLeverageFunction HestonSLVFDMModel Source # | |
Defined in QuantLib.Model Methods leverageFunction :: HestonSLVFDMModel -> IO LocalVolTermStructure Source # | |
| HasLeverageFunction HestonSLVMCModel Source # | |
Defined in QuantLib.Model Methods leverageFunction :: HestonSLVMCModel -> IO LocalVolTermStructure Source # | |
class HasVolatilities a where Source #
Models that expose their calibrated volatility step values.
Methods
volatilities :: a -> IO [Double] Source #
Instances
| HasVolatilities Gsr Source # | |
Defined in QuantLib.Model | |
| HasVolatilities MarkovFunctional Source # | |
Defined in QuantLib.Model Methods volatilities :: MarkovFunctional -> IO [Double] Source # | |
reversions :: Gsr -> IO [Double] Source #
Reversion values, as calibrated so far: one for a constant reversion, otherwise one per volatility step.
class HasHelperUnderlying h where Source #
Bootstrap and calibration helpers that build and hold the instrument whose market quote they match. The class lives here, in the term-structure root module, because its instances span QuantLib.TermStructure.Yield, ".Inflation" and QuantLib.Model, and an instance must share a module with its class to stay non-orphan.
Associated Types
type HelperUnderlying h Source #
Methods
helperInstrument :: h -> IO (HelperUnderlying h) Source #
The instrument the helper prices. For helpers that build it internally --
fixedRateBondHelper and
cpiBondHelper among them -- this is the only way to reach it.
Instances
g2Dynamics :: G2 -> IO ShortRateDynamics Source #
The two-factor short-rate dynamics underlying a G2 model (TwoFactorModel::dynamics()).
Short rate implied by a ShortRateDynamics's two state variables x, y at time t: fitting_(t) + x + y. At x = y = 0 this collapses to the model's fitting parameter phi(t).
stateProcess :: Gaussian1dModel -> IO StochasticProcess1D Source #
The model's own state process. Throws if the model was constructed without one set.
hestonSlvFdmLogEntries :: HestonSLVFDMModel -> IO [HestonSLVFDMLogEntry] Source #
Copies retained FDM density diagnostics. Returns [] when the model was built with
logging = False. Calling this makes one fresh QuantLib diagnostic calculation, then decodes
its owned snapshot without retaining the model's mesh objects.
helperSwaption :: SwaptionHelper -> IO Swaption Source #
The Swaption this helper prices internally to compute modelValue.
times :: GenBlackCalibrationHelper bch -> IO [Double] Source #
Times relevant to pricing this calibration helper's instrument, to be added to the model's evolution time grid.
fixedReversion :: [Bool] Source #
Marks the reversion (a) fixed and volatility (sigma) free for calibrate's fixParameters argument. Mirrors HullWhite::FixedReversion().
params :: GenCalibratedModel m -> IO [Double] Source #
Returns array of arguments on which calibration is done.
value :: GenCalibratedModel m -> [Double] -> [GenCalibrationHelper ch] -> IO Double Source #
Objective function value at params for the given calibration instruments.
calibrationError :: GenBlackCalibrationHelper bch -> IO Double Source #
returns the error resulting from the model valuation
marketValue :: GenBlackCalibrationHelper bch -> IO Double Source #
returns the actual price of the instrument (from volatility)
modelValue :: GenBlackCalibrationHelper bch -> IO Double Source #
returns the price of the instrument according to the model
volatility :: GenBlackCalibrationHelper bch -> IO Quote Source #
The quoted market volatility this helper was built with.
Historical volatility
one-step-ahead variance forecast: gamma*vl + alpha*r^2 + beta*sigma2, given the latest
return r and the previous step's variance sigma2.
Runs the model's calibrated (or constructor-supplied) alpha/beta/omega recursion forward
over a return series. The output series is offset by one from the input: the first input
point has nothing to forecast from, so it is dropped, and one extra point is extrapolated one
step past the input series' last date -- an n-point input still produces an n-point
output, just shifted forward by one date.
garmanKlassSimpleSigma Source #
Arguments
| :: Double | yearFraction |
| -> NonEmpty (Day, Double, Double, Double, Double) | (date, open, close, high, low) price bars |
| -> IO [(Day, Double)] |
Garman-Klass (1980) simple estimator: sigma^2 = ln(close/open)^2, scaled by yearFraction.
Input bars are (date, open, close, high, low); only open/close are used here.
Arguments
| :: Double | yearFraction |
| -> Double | marketOpenFraction |
| -> NonEmpty (Day, Double, Double, Double, Double) | (date, open, close, high, low) price bars |
| -> IO [(Day, Double)] |
Garman-Klass Sigma1: blends garmanKlassSimpleSigma with the overnight (previous close to
today's open) jump, weighted by marketOpenFraction (the fraction of the trading day the
market is open). Drops the series' first bar (needs a previous close).
Arguments
| :: Double | yearFraction |
| -> NonEmpty (Day, Double, Double, Double, Double) | (date, open, close, high, low) price bars |
| -> IO [(Day, Double)] |
Parkinson (1980) high-low estimator: sigma^2 = ln(high/low)^2 / (4 ln 2), scaled by
yearFraction. Input bars are (date, open, close, high, low); only high/low are used here.
Arguments
| :: Double | yearFraction |
| -> Double | marketOpenFraction |
| -> NonEmpty (Day, Double, Double, Double, Double) | (date, open, close, high, low) price bars |
| -> IO [(Day, Double)] |
Garman-Klass Sigma3: blends parkinsonSigma with the overnight jump, same
marketOpenFraction weighting as garmanKlassSigma1. Drops the series' first bar.
Arguments
| :: Double | yearFraction |
| -> NonEmpty (Day, Double, Double, Double, Double) | (date, open, close, high, low) price bars |
| -> IO [(Day, Double)] |
Garman-Klass (1980) Sigma4 estimator, combining the high-low range with the close-open
return via their published coefficients. Input bars are (date, open, close, high, low).
Arguments
| :: Double | yearFraction |
| -> NonEmpty (Day, Double, Double, Double, Double) | (date, open, close, high, low) price bars |
| -> IO [(Day, Double)] |
Garman-Klass (1980) Sigma5 estimator: an alternative high-low/close-open combination to
garmanKlassSigma4, with different published coefficients.
Arguments
| :: Double | yearFraction |
| -> Double | marketOpenFraction |
| -> NonEmpty (Day, Double, Double, Double, Double) | (date, open, close, high, low) price bars |
| -> IO [(Day, Double)] |
Garman-Klass Sigma6: blends garmanKlassSigma5 with the overnight jump, same
marketOpenFraction weighting as garmanKlassSigma1. Drops the series' first bar.
constantVolatilityEstimator Source #
Smooths an already-computed volatility series with a rolling constant estimate over the
trailing windowSize points.
simpleLocalVolatilityEstimator Source #
Local (point-to-point) volatility estimate from a raw price series: |ln(p_i/p_{i-1})| /
sqrt(yearFraction) for each consecutive pair. Drops the series' first date; an n-point
input produces an (n-1)-point output.
omega :: Garch11 -> Double Source #
the calibrated (or derived) omega coefficient, vl * (1 - alpha - beta)
longTermVolatility :: Garch11 -> Double Source #
the calibrated (or constructor-supplied) long-term volatility