| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.Process
Synopsis
- data GenStochasticProcess p
- type StochasticProcess = GenStochasticProcess CStochasticProcess
- type GenStochasticProcess1D p1d = GenStochasticProcess (AnyOf CStochasticProcess1D' p1d)
- type StochasticProcess1D = GenStochasticProcess1D CStochasticProcess1D
- type GenGeneralizedBlackScholesProcess gbs = GenStochasticProcess1D (AnyOf CGeneralizedBlackScholesProcess' gbs)
- type GeneralizedBlackScholesProcess = GenGeneralizedBlackScholesProcess CGeneralizedBlackScholesProcess
- type BlackProcess = GenGeneralizedBlackScholesProcess CBlackProcess
- type ExtOUWithJumpsProcess = GenStochasticProcess CExtOUWithJumpsProcess
- type ExtendedOrnsteinUhlenbeckProcess = GenStochasticProcess1D CExtendedOrnsteinUhlenbeckProcess
- type GJRGARCHProcess = GenStochasticProcess CGJRGARCHProcess
- type GenHestonProcess hp = GenStochasticProcess (AnyOf CHestonProcess' hp)
- type HestonProcess = GenHestonProcess CHestonProcess
- type HestonSLVProcess = GenStochasticProcess CHestonSLVProcess
- type BatesProcess = GenHestonProcess CBatesProcess
- type G2Process = GenStochasticProcess CG2Process
- type G2ForwardProcess = GenStochasticProcess CG2ForwardProcess
- type HybridHestonHullWhiteProcess = GenStochasticProcess CHybridHestonHullWhiteProcess
- type KlugeExtOUProcess = GenStochasticProcess CKlugeExtOUProcess
- type LiborForwardModelProcess = GenStochasticProcess CLiborForwardModelProcess
- type StochasticProcessArray = GenStochasticProcess CStochasticProcessArray
- type VarianceGammaProcess = GenStochasticProcess1D CVarianceGammaProcess
- type Merton76Process = GenStochasticProcess1D CMerton76Process
- type HullWhiteProcess = GenStochasticProcess1D CHullWhiteProcess
- type HullWhiteForwardProcess = GenStochasticProcess1D CHullWhiteForwardProcess
- data ProcessDiscretization
- data ExtendedBlackScholesMertonProcessDiscretization
- data ExtendedOrnsteinUhlenbeckProcessDiscretization
- data HestonProcessDiscretization
- data GJRGARCHProcessDiscretization
- data HybridHestonHullWhiteProcessDiscretization
- asStochasticProcess :: GenStochasticProcess p -> IO StochasticProcess
- asStochasticProcess1D :: GenStochasticProcess1D p1d -> IO StochasticProcess1D
- asGeneralizedBlackScholesProcess :: GenGeneralizedBlackScholesProcess gbs -> IO GeneralizedBlackScholesProcess
- asHestonProcess :: GenHestonProcess hp -> IO HestonProcess
- blackProcess :: GenQuote q -> GenYieldTermStructure y -> GenBlackVolTermStructure bv -> ProcessDiscretization -> Bool -> IO BlackProcess
- blackScholesMertonProcess :: GenQuote q -> GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> GenBlackVolTermStructure bv -> ProcessDiscretization -> Bool -> IO GeneralizedBlackScholesProcess
- blackScholesProcess :: GenQuote q -> GenYieldTermStructure y -> GenBlackVolTermStructure bv -> ProcessDiscretization -> Bool -> IO GeneralizedBlackScholesProcess
- extendedBlackScholesMertonProcess :: GenQuote q -> GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> GenBlackVolTermStructure bv -> ProcessDiscretization -> ExtendedBlackScholesMertonProcessDiscretization -> IO GeneralizedBlackScholesProcess
- garmanKohlhagenProcess :: GenQuote q -> GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> GenBlackVolTermStructure bv -> ProcessDiscretization -> Bool -> IO GeneralizedBlackScholesProcess
- generalizedBlackScholesProcess :: GenQuote q -> GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> GenBlackVolTermStructure bv -> ProcessDiscretization -> Bool -> IO GeneralizedBlackScholesProcess
- squareRootProcess :: Double -> Double -> Double -> Double -> ProcessDiscretization -> IO StochasticProcess1D
- vegaStressedBlackScholesProcess :: GenQuote q -> GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> GenBlackVolTermStructure bv -> Double -> Double -> Double -> Double -> Double -> ProcessDiscretization -> IO GeneralizedBlackScholesProcess
- batesProcess :: GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> GenQuote q -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> HestonProcessDiscretization -> IO BatesProcess
- extOuWithJumpsProcess :: ExtendedOrnsteinUhlenbeckProcess -> Double -> Double -> Double -> Double -> IO ExtOUWithJumpsProcess
- g2ForwardProcess :: Double -> Double -> Double -> Double -> Double -> Maybe (GenYieldTermStructure y) -> IO G2ForwardProcess
- g2Process :: Double -> Double -> Double -> Double -> Double -> Maybe (GenYieldTermStructure y) -> IO G2Process
- gemanRoncoroniProcess :: Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> IO StochasticProcess1D
- geometricBrownianMotionProcess :: Double -> Double -> Double -> IO StochasticProcess1D
- gjrGarchProcess :: GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> GenQuote q -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> GJRGARCHProcessDiscretization -> IO GJRGARCHProcess
- hestonProcess :: GenYieldTermStructure y1 -> Maybe (GenYieldTermStructure y2) -> GenQuote q -> Double -> Double -> Double -> Double -> Double -> HestonProcessDiscretization -> IO HestonProcess
- hestonSlvProcess :: GenHestonProcess hp -> GenLocalVolTermStructure lv -> Double -> IO HestonSLVProcess
- hullWhiteForwardProcess :: GenYieldTermStructure y -> Double -> Double -> IO HullWhiteForwardProcess
- hullWhiteProcess :: GenYieldTermStructure y -> Double -> Double -> IO HullWhiteProcess
- hybridHestonHullWhiteProcess :: GenHestonProcess hp -> HullWhiteForwardProcess -> Double -> HybridHestonHullWhiteProcessDiscretization -> IO HybridHestonHullWhiteProcess
- klugeExtOuProcess :: Double -> ExtOUWithJumpsProcess -> ExtendedOrnsteinUhlenbeckProcess -> IO KlugeExtOUProcess
- withExtendedOrnsteinUhlenbeckProcess :: Double -> Double -> Double -> (Double -> Double) -> ExtendedOrnsteinUhlenbeckProcessDiscretization -> Double -> (ExtendedOrnsteinUhlenbeckProcess -> IO a) -> IO a
- linearSeasonalOrnsteinUhlenbeckProcess :: Double -> Double -> Double -> Double -> Double -> Double -> Double -> ExtendedOrnsteinUhlenbeckProcessDiscretization -> Double -> IO ExtendedOrnsteinUhlenbeckProcess
- liborForwardModelProcess :: Word -> GenIborIndex ibor -> IO LiborForwardModelProcess
- merton76Process :: GenQuote q1 -> GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> GenBlackVolTermStructure bv -> GenQuote q2 -> GenQuote q3 -> GenQuote q4 -> ProcessDiscretization -> IO Merton76Process
- ornsteinUhlenbeckProcess :: Double -> Double -> Double -> Double -> IO StochasticProcess1D
- varianceGammaProcess :: GenQuote q -> GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> Double -> Double -> Double -> IO VarianceGammaProcess
- stochasticProcessArray :: NonEmpty (GenStochasticProcess1D p1d) -> Matrix Double -> IO StochasticProcessArray
- class HasForwardMeasureTime a where
- setForwardMeasureTime :: a -> Double -> IO ()
- apply :: GenStochasticProcess p -> [Double] -> [Double] -> IO [Double]
- covariance :: GenStochasticProcess p -> Double -> [Double] -> Double -> IO (Matrix Double)
- diffusion :: GenStochasticProcess p -> Double -> [Double] -> IO (Matrix Double)
- drift :: GenStochasticProcess p -> Double -> [Double] -> IO [Double]
- evolve :: GenStochasticProcess p -> Double -> [Double] -> Double -> [Double] -> IO [Double]
- expectation :: GenStochasticProcess p -> Double -> [Double] -> Double -> IO [Double]
- stdDeviation :: GenStochasticProcess p -> Double -> [Double] -> Double -> IO (Matrix Double)
- pdf :: GenHestonProcess hp -> Double -> Double -> Double -> Double -> IO Double
- discountBond :: LiborForwardModelProcess -> [Double] -> IO [Double]
- factors :: GenStochasticProcess p -> IO Word
- initialValues :: GenStochasticProcess p -> IO [Double]
- fixingDates :: LiborForwardModelProcess -> IO [Day]
- fixingTimes :: LiborForwardModelProcess -> IO [Double]
- cashFlows :: LiborForwardModelProcess -> Double -> IO Leg
- index :: LiborForwardModelProcess -> IO IborIndex
- accrualTimes :: LiborForwardModelProcess -> IO [(Double, Double)]
- class HasPhi a where
- class HasShortRate a where
- class HasAlpha a where
- bFunction :: HullWhiteForwardProcess -> Double -> Double -> IO Double
- mFunction :: HullWhiteForwardProcess -> Double -> Double -> Double -> IO Double
- numeraire :: HybridHestonHullWhiteProcess -> Double -> [Double] -> IO Double
- thetaAt :: GeneralizedBlackScholesProcess -> Double -> Double -> Double -> IO Double
Types
Process hierarchy
data GenStochasticProcess p Source #
StochasticProcess
ExtOUWithJumpsProcess
GJRGARCHProcess
HybridHestonHullWhiteProcess
KlugeExtOUProcess
LiborForwardModelProcess
StochasticProcessArray
G2Process
G2ForwardProcess
HestonProcess
BatesProcess
HestonSLVProcess
StochasticProcess1D
ExtendedOrnsteinUhlenbeckProcess
HullWhiteForwardProcess
HullWhiteProcess
Merton76Process
VarianceGammaProcess
GeneralizedBlackScholesProcess
BlackProcessInstances
| HasAlpha HullWhiteForwardProcess Source # | |
Defined in QuantLib.Process | |
| HasAlpha HullWhiteProcess Source # | |
Defined in QuantLib.Process | |
| HasForwardMeasureTime G2ForwardProcess Source # | |
Defined in QuantLib.Process Methods setForwardMeasureTime :: G2ForwardProcess -> Double -> IO () Source # | |
| HasForwardMeasureTime HullWhiteForwardProcess Source # | |
Defined in QuantLib.Process Methods setForwardMeasureTime :: HullWhiteForwardProcess -> Double -> IO () Source # | |
| HasPhi G2ForwardProcess Source # | |
Defined in QuantLib.Process | |
| HasPhi G2Process Source # | |
| HasShortRate G2ForwardProcess Source # | |
Defined in QuantLib.Process | |
| HasShortRate G2Process Source # | |
type StochasticProcess = GenStochasticProcess CStochasticProcess Source #
The root of the hierarchy shown under GenStochasticProcess.
type GenStochasticProcess1D p1d = GenStochasticProcess (AnyOf CStochasticProcess1D' p1d) Source #
A StochasticProcess1D or one of its leaves; see the hierarchy under GenStochasticProcess.
type StochasticProcess1D = GenStochasticProcess1D CStochasticProcess1D Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type GenGeneralizedBlackScholesProcess gbs = GenStochasticProcess1D (AnyOf CGeneralizedBlackScholesProcess' gbs) Source #
type GeneralizedBlackScholesProcess = GenGeneralizedBlackScholesProcess CGeneralizedBlackScholesProcess Source #
A StochasticProcess1D; see the hierarchy under GenStochasticProcess.
type BlackProcess = GenGeneralizedBlackScholesProcess CBlackProcess Source #
A GeneralizedBlackScholesProcess; see the hierarchy under GenStochasticProcess.
type ExtOUWithJumpsProcess = GenStochasticProcess CExtOUWithJumpsProcess Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type ExtendedOrnsteinUhlenbeckProcess = GenStochasticProcess1D CExtendedOrnsteinUhlenbeckProcess Source #
A StochasticProcess1D; see the hierarchy under GenStochasticProcess.
type GJRGARCHProcess = GenStochasticProcess CGJRGARCHProcess Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type GenHestonProcess hp = GenStochasticProcess (AnyOf CHestonProcess' hp) Source #
A HestonProcess or one of its leaves; see the hierarchy under GenStochasticProcess.
type HestonProcess = GenHestonProcess CHestonProcess Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type HestonSLVProcess = GenStochasticProcess CHestonSLVProcess Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type BatesProcess = GenHestonProcess CBatesProcess Source #
A HestonProcess; see the hierarchy under GenStochasticProcess.
type G2Process = GenStochasticProcess CG2Process Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type G2ForwardProcess = GenStochasticProcess CG2ForwardProcess Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type HybridHestonHullWhiteProcess = GenStochasticProcess CHybridHestonHullWhiteProcess Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type KlugeExtOUProcess = GenStochasticProcess CKlugeExtOUProcess Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type LiborForwardModelProcess = GenStochasticProcess CLiborForwardModelProcess Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type StochasticProcessArray = GenStochasticProcess CStochasticProcessArray Source #
A StochasticProcess; see the hierarchy under GenStochasticProcess.
type VarianceGammaProcess = GenStochasticProcess1D CVarianceGammaProcess Source #
A StochasticProcess1D; see the hierarchy under GenStochasticProcess.
type Merton76Process = GenStochasticProcess1D CMerton76Process Source #
A StochasticProcess1D; see the hierarchy under GenStochasticProcess.
type HullWhiteProcess = GenStochasticProcess1D CHullWhiteProcess Source #
A StochasticProcess1D; see the hierarchy under GenStochasticProcess.
type HullWhiteForwardProcess = GenStochasticProcess1D CHullWhiteForwardProcess Source #
A StochasticProcess1D; see the hierarchy under GenStochasticProcess.
Discretization schemes
data ProcessDiscretization Source #
Constructors
| EulerDiscretization | |
| EndEulerDiscretization |
Instances
data ExtendedBlackScholesMertonProcessDiscretization Source #
Constructors
| ExtendedBSMEuler | |
| Milstein | |
| PredictorCorrector |
Instances
data ExtendedOrnsteinUhlenbeckProcessDiscretization Source #
Constructors
| MidPoint | |
| Trapezodial | |
| GaussLobatto |
Instances
data HestonProcessDiscretization Source #
Constructors
Instances
data GJRGARCHProcessDiscretization Source #
Instances
data HybridHestonHullWhiteProcessDiscretization Source #
Constructors
| HybridHestonHullWhiteEuler | |
| BSMHullWhite |
Instances
Constructors
Hierarchy conversion
asGeneralizedBlackScholesProcess :: GenGeneralizedBlackScholesProcess gbs -> IO GeneralizedBlackScholesProcess Source #
asHestonProcess :: GenHestonProcess hp -> IO HestonProcess Source #
Black-Scholes processes
Arguments
| :: GenQuote q | x0 |
| -> GenYieldTermStructure y | riskFreeTS |
| -> GenBlackVolTermStructure bv | blackVolTS |
| -> ProcessDiscretization | |
| -> Bool | forceDiscretization |
| -> IO BlackProcess |
Black (1976) process for a forward or futures contract: d(ln S) = -sigma^2/2 dt + sigma dW.
blackScholesMertonProcess Source #
Arguments
| :: GenQuote q | x0 |
| -> GenYieldTermStructure y1 | dividendTS |
| -> GenYieldTermStructure y2 | riskFreeTS |
| -> GenBlackVolTermStructure bv | blackVolTS |
| -> ProcessDiscretization | |
| -> Bool | forceDiscretization |
| -> IO GeneralizedBlackScholesProcess |
Merton (1973) extension of Black-Scholes for a continuous-dividend-paying stock: d(ln S) = (r - q - sigma^2/2) dt + sigma dW.
Arguments
| :: GenQuote q | x0 |
| -> GenYieldTermStructure y | riskFreeTS |
| -> GenBlackVolTermStructure bv | blackVolTS |
| -> ProcessDiscretization | |
| -> Bool | forceDiscretization |
| -> IO GeneralizedBlackScholesProcess |
Black-Scholes (1973) process for a stock: d(ln S) = (r - sigma^2/2) dt + sigma dW.
extendedBlackScholesMertonProcess Source #
Arguments
| :: GenQuote q | x0 |
| -> GenYieldTermStructure y1 | dividendTS |
| -> GenYieldTermStructure y2 | riskFreeTS |
| -> GenBlackVolTermStructure bv | blackVolTS |
| -> ProcessDiscretization | |
| -> ExtendedBlackScholesMertonProcessDiscretization | |
| -> IO GeneralizedBlackScholesProcess |
blackScholesMertonProcess with a choice of evolution scheme (Euler/Milstein/predictor-corrector)
on top of the discretization argument.
garmanKohlhagenProcess Source #
Arguments
| :: GenQuote q | x0 |
| -> GenYieldTermStructure y1 | foreignRiskFreeTS |
| -> GenYieldTermStructure y2 | domesticRiskFreeTS |
| -> GenBlackVolTermStructure bv | blackVolTS |
| -> ProcessDiscretization | |
| -> Bool | forceDiscretization |
| -> IO GeneralizedBlackScholesProcess |
Garman-Kohlhagen (1983) process for an exchange rate: d(ln S) = (r - r_f - sigma^2/2) dt + sigma dW.
generalizedBlackScholesProcess Source #
Arguments
| :: GenQuote q | x0 |
| -> GenYieldTermStructure y1 | dividendTS |
| -> GenYieldTermStructure y2 | riskFreeTS |
| -> GenBlackVolTermStructure bv | blackVolTS |
| -> ProcessDiscretization | |
| -> Bool | forceDiscretization |
| -> IO GeneralizedBlackScholesProcess |
Generalized Black-Scholes process with separate dividend and risk-free curves: d(ln S) = (r - q - sigma^2/2) dt + sigma dW.
Arguments
| :: Double | b |
| -> Double | a |
| -> Double | sigma |
| -> Double | x0 |
| -> ProcessDiscretization | |
| -> IO StochasticProcess1D |
square-root process: dx = a (b - x) dt + sigma sqrt(x) dW.
vegaStressedBlackScholesProcess Source #
Arguments
| :: GenQuote q | x0 |
| -> GenYieldTermStructure y1 | dividendTS |
| -> GenYieldTermStructure y2 | riskFreeTS |
| -> GenBlackVolTermStructure bv | blackVolTS |
| -> Double | lowerTimeBorderForStressTest |
| -> Double | upperTimeBorderForStressTest |
| -> Double | lowerAssetBorderForStressTest |
| -> Double | upperAssetBorderForStressTest |
| -> Double | stressLevel |
| -> ProcessDiscretization | |
| -> IO GeneralizedBlackScholesProcess |
blackScholesMertonProcess variant supporting local vega stress tests over a given
time/asset border and stress level.
Other processes
Arguments
| :: GenYieldTermStructure y1 | riskFreeTS |
| -> GenYieldTermStructure y2 | dividendYield |
| -> GenQuote q | s0 |
| -> Double | v0 |
| -> Double | kappa |
| -> Double | theta |
| -> Double | sigma |
| -> Double | rho |
| -> Double | lambda |
| -> Double | nu |
| -> Double | delta |
| -> HestonProcessDiscretization | |
| -> IO BatesProcess |
square-root stochastic-volatility Bates process: a Heston process plus a compound Poisson jump component with log-normally distributed jump size.
extOuWithJumpsProcess Source #
Arguments
| :: ExtendedOrnsteinUhlenbeckProcess | |
| -> Double | Y0 |
| -> Double | beta |
| -> Double | jumpIntensity |
| -> Double | eta |
| -> IO ExtOUWithJumpsProcess |
Kluge model: an extended Ornstein-Uhlenbeck process plus an exponential-jump component, S = exp(X + Y) with dX = alpha (mu(t) - X) dt + sigma dW and dY = -beta Y dt + J dN. When the extended process is callback-backed, this result must remain inside the same continuation.
Arguments
| :: Double | a |
| -> Double | sigma |
| -> Double | b |
| -> Double | eta |
| -> Double | rho |
| -> Maybe (GenYieldTermStructure y) | termStructure |
| -> IO G2ForwardProcess |
T-forward-measure counterpart of g2Process: the two-factor G2++ short-rate model, with
the simulated state again shifted so its components sum to the short rate.
Arguments
| :: Double | a |
| -> Double | sigma |
| -> Double | b |
| -> Double | eta |
| -> Double | rho |
| -> Maybe (GenYieldTermStructure y) | termStructure |
| -> IO G2Process |
two-factor G2++ short-rate process, state shifted so its two OU components sum to the short rate; degenerates to a pair of zero-mean OU processes if no term structure is given.
gemanRoncoroniProcess Source #
Arguments
| :: Double | x0 |
| -> Double | alpha |
| -> Double | beta |
| -> Double | gamma |
| -> Double | delta |
| -> Double | eps |
| -> Double | zeta |
| -> Double | d |
| -> Double | k |
| -> Double | tau |
| -> Double | sig2 |
| -> Double | a |
| -> Double | b |
| -> Double | theta1 |
| -> Double | theta2 |
| -> Double | theta3 |
| -> Double | psi |
| -> IO StochasticProcess1D |
Geman-Roncoroni process, a mean-reverting jump-diffusion model for electricity spot prices with a seasonal deterministic mean and an asymmetric jump term.
geometricBrownianMotionProcess Source #
Arguments
| :: Double | initialValue |
| -> Double | mue |
| -> Double | sigma |
| -> IO StochasticProcess1D |
geometric Brownian motion process: dS = mue S dt + sigma S dW.
Arguments
| :: GenYieldTermStructure y1 | riskFreeRate |
| -> GenYieldTermStructure y2 | dividendYield |
| -> GenQuote q | s0 |
| -> Double | v0 |
| -> Double | omega |
| -> Double | alpha |
| -> Double | beta |
| -> Double | gamma |
| -> Double | lambda |
| -> Double | daysPerYear |
| -> GJRGARCHProcessDiscretization | |
| -> IO GJRGARCHProcess |
stochastic-volatility GJR-GARCH(1,1) process; parameters are supplied as daily constants and annualized internally via daysPerYear.
Arguments
| :: GenYieldTermStructure y1 | riskFreeRate |
| -> Maybe (GenYieldTermStructure y2) | dividendYield |
| -> GenQuote q | s0 |
| -> Double | v0 |
| -> Double | kappa |
| -> Double | theta |
| -> Double | sigma |
| -> Double | rho |
| -> HestonProcessDiscretization | |
| -> IO HestonProcess |
dividendYield may be Nothing (an empty term-structure handle) -- required e.g. by
integralHestonVarianceOptionEngine, which rejects a process with a
non-empty dividend handle.
Arguments
| :: GenHestonProcess hp | hestonProcess |
| -> GenLocalVolTermStructure lv | leverageFct |
| -> Double | mixingFactor |
| -> IO HestonSLVProcess |
Two-factor Heston stochastic-local-volatility process using the supplied calibrated leverage
function. It is a generic StochasticProcess, so it composes with path generators and the
existing drift/diffusion operations.
hullWhiteForwardProcess Source #
Arguments
| :: GenYieldTermStructure y | h |
| -> Double | y |
| -> Double | sigma |
| -> IO HullWhiteForwardProcess |
T-forward-measure counterpart of hullWhiteProcess.
Arguments
| :: GenYieldTermStructure y | h |
| -> Double | y |
| -> Double | sigma |
| -> IO HullWhiteProcess |
Hull-White one-factor short-rate process, fitted to the given initial term structure.
hybridHestonHullWhiteProcess Source #
Arguments
| :: GenHestonProcess hp | |
| -> HullWhiteForwardProcess | |
| -> Double | corrEquityShortRate |
| -> HybridHestonHullWhiteProcessDiscretization | |
| -> IO HybridHestonHullWhiteProcess |
three-factor hybrid model combining a Heston equity process with a Hull-White short-rate process, correlated via corrEquityShortRate.
Arguments
| :: Double | rho |
| -> ExtOUWithJumpsProcess | |
| -> ExtendedOrnsteinUhlenbeckProcess | |
| -> IO KlugeExtOUProcess |
Joint correlated Kluge (extOuWithJumpsProcess) and extended Ornstein-Uhlenbeck process. When
either input retains a Haskell callback, this result must remain inside that callback's scope.
withExtendedOrnsteinUhlenbeckProcess Source #
Arguments
| :: Double | speed |
| -> Double | sigma |
| -> Double | x0 |
| -> (Double -> Double) | b(t) |
| -> ExtendedOrnsteinUhlenbeckProcessDiscretization | |
| -> Double | intEps |
| -> (ExtendedOrnsteinUhlenbeckProcess -> IO a) | |
| -> IO a |
An extended Ornstein-Uhlenbeck process dx = speed*(b(t) - x)dt + sigma*dW with an arbitrary
deterministic mean-reversion level b, usable with pathGenerator. The
FunPtr backing b is kept alive only for the continuation's duration. The process and any
dependent process must not escape it (same rule as withDerivedQuote).
linearSeasonalOrnsteinUhlenbeckProcess Source #
Arguments
| :: Double | speed |
| -> Double | sigma (volatility) |
| -> Double | x0 |
| -> Double | a |
| -> Double | k (linear trend) |
| -> Double | c (seasonal amplitude) |
| -> Double | phase |
| -> ExtendedOrnsteinUhlenbeckProcessDiscretization | |
| -> Double | intEps |
| -> IO ExtendedOrnsteinUhlenbeckProcess |
An extended Ornstein-Uhlenbeck process with the Lucia-Schwartz-style level
b(t) = a + k*t + c*sin(2*pi*t + phase), computed natively. Setting k = c = 0 gives a
constant level and c = 0 gives a linear trend.
liborForwardModelProcess Source #
Arguments
| :: Word | size |
| -> GenIborIndex ibor | |
| -> IO LiborForwardModelProcess |
Libor market model process, evolving size forward rates of index under the rolling forward measure with a predictor-corrector step.
Arguments
| :: GenQuote q1 | stateVariable |
| -> GenYieldTermStructure y1 | dividendTS |
| -> GenYieldTermStructure y2 | riskFreeTS |
| -> GenBlackVolTermStructure bv | blackVolTS |
| -> GenQuote q2 | jumpInt |
| -> GenQuote q3 | logJMean |
| -> GenQuote q4 | logJVol |
| -> ProcessDiscretization | |
| -> IO Merton76Process |
Merton (1976) jump-diffusion process: a Black-Scholes process plus a log-normal jump component with Poisson jump intensity jumpInt.
ornsteinUhlenbeckProcess Source #
Ornstein-Uhlenbeck process: dx = a (level - x) dt + sigma dW.
Arguments
| :: GenQuote q | s0 |
| -> GenYieldTermStructure y1 | dividendYield |
| -> GenYieldTermStructure y2 | riskFreeRate |
| -> Double | sigma |
| -> Double | nu |
| -> Double | theta |
| -> IO VarianceGammaProcess |
Variance Gamma process: a Brownian motion db = theta dt + sigma dW time-changed by an independent Gamma process with mean 1 and variance rate nu.
stochasticProcessArray Source #
Arguments
| :: NonEmpty (GenStochasticProcess1D p1d) | |
| -> Matrix Double | correlation |
| -> IO StochasticProcessArray |
array of correlated 1-D stochastic processes, driven by a joint correlation matrix.
Mutators
class HasForwardMeasureTime a where Source #
Forward-measure processes that require a maturity time before simulation.
Methods
setForwardMeasureTime :: a -> Double -> IO () Source #
Instances
| HasForwardMeasureTime G2ForwardProcess Source # | |
Defined in QuantLib.Process Methods setForwardMeasureTime :: G2ForwardProcess -> Double -> IO () Source # | |
| HasForwardMeasureTime HullWhiteForwardProcess Source # | |
Defined in QuantLib.Process Methods setForwardMeasureTime :: HullWhiteForwardProcess -> Double -> IO () Source # | |
Inspectors
Process dynamics
Arguments
| :: GenStochasticProcess p | |
| -> [Double] | x0 |
| -> [Double] | dx |
| -> IO [Double] |
applies an increment dx to a state x0 in the process's own state space -- not always
plain addition (a log-variable process exponentiates, for instance), which is why it is a
method rather than a caller-side zipWith (+).
covariance :: GenStochasticProcess p -> Double -> [Double] -> Double -> IO (Matrix Double) Source #
the covariance matrix of the process over dt given state x0 at time t0; equals
stdDeviation * transpose stdDeviation.
diffusion :: GenStochasticProcess p -> Double -> [Double] -> IO (Matrix Double) Source #
the diffusion part of the process's SDE at state x and time t, i.e. sigma(t, x_t) in
dx_t = mu(t, x_t) dt + sigma(t, x_t) dW_t.
Arguments
| :: GenStochasticProcess p | |
| -> Double | t |
| -> [Double] | x |
| -> IO [Double] |
the drift part of the process's SDE at state x and time t, i.e. mu(t, x_t) in
dx_t = mu(t, x_t) dt + sigma(t, x_t) dW_t.
one discretized step of the process: the state at t0+dt given state x0 at t0 and the
standard-normal draws dw (one per factors).
This crosses the FFI boundary once per timestep, so it is not the way to generate many paths --
use pathGenerator for that, which drives the same evolve entirely inside
QuantLib. Reach for this when Haskell has to own the path logic (path-dependent state,
early termination, a custom draw source via gaussianRsg) while QuantLib
keeps owning the process's discretization scheme.
E[x_(t0+dt) | x_t0 = x0], the expected state at t0+dt given state x0 at time t0.
stdDeviation :: GenStochasticProcess p -> Double -> [Double] -> Double -> IO (Matrix Double) Source #
the standard deviation matrix of the process over dt given state x0 at time t0, i.e.
a square root of covariance -- the factor a simulated normal draw is multiplied by in one
exact-scheme step. Pairs with expectation: x_(t0+dt) = expectation + stdDeviation * dw
for a process whose discretization is exact in that sense.
Probability density of (x = ln S, v) at time t, evaluated via the Heston
characteristic-function inversion (the same machinery as analyticPDFHestonEngine).
eps is the requested integration accuracy.
Arguments
| :: LiborForwardModelProcess | |
| -> [Double] | rates |
| -> IO [Double] |
the cumulative discount factors implied by one simulated vector of forward rates: element
i discounts from the end of accrual period i back to the process's start, i.e.
scanl1 (*) [1 / (1 + r_i tau_i)] over accrualTimes -- not the
individual one-period factors.
Process state
factors :: GenStochasticProcess p -> IO Word Source #
the number of independent Brownian factors driving a stochastic process -- e.g. 2 for
g2Process, matching its state size; used to size a pathGenerator's
underlying sequence generator (process->factors() * steps, mirroring upstream's own usage).
initialValues :: GenStochasticProcess p -> IO [Double] Source #
the process's state at time 0, e.g. (0, 0) for a curveless g2Process or
(phi(0), 0) once a term structure is given.
fixingDates :: LiborForwardModelProcess -> IO [Day] Source #
the reset (fixing) dates of the forward rates this process evolves
fixingTimes :: LiborForwardModelProcess -> IO [Double] Source #
the reset (fixing) times of the forward rates this process evolves, in the process's own day count fraction from the evaluation date
Arguments
| :: LiborForwardModelProcess | |
| -> Double | amount |
| -> IO Leg |
the leg of Ibor coupons (notional amount each) this process's forward rates reset -- used
e.g. to build the cap this process prices via liborForwardModel
index :: LiborForwardModelProcess -> IO IborIndex Source #
the underlying IborIndex this process was constructed with
accrualTimes :: LiborForwardModelProcess -> IO [(Double, Double)] Source #
the (start, end) accrual times of the forward rates this process evolves, in its own day
count fraction from the evaluation date; their difference is the accrual period a caplet
payoff is scaled by.
Short-rate and forward-measure quantities
Two-factor short-rate processes with the same deterministic curve-fitting offset.
class HasShortRate a where Source #
Two-factor processes whose simulated state maps to the short rate in the same way.
Instances
class HasAlpha a where Source #
Hull--White processes exposing the deterministic curve-fitting offset.
Instances
| HasAlpha HullWhiteForwardProcess Source # | |
Defined in QuantLib.Process | |
| HasAlpha HullWhiteProcess Source # | |
Defined in QuantLib.Process | |
Arguments
| :: HullWhiteForwardProcess | |
| -> Double | t |
| -> Double | T |
| -> IO Double |
the Hull-White B(t, T) = (1 - exp(-a (T - t))) / a factor of the affine discount-bond formula P(t, T) = A(t, T) exp(-B(t, T) r_t).
the T-forward-measure drift adjustment M_T(s, t, T) the process applies between s and t when the numeraire is the T-maturity zero bond.
Arguments
| :: HybridHestonHullWhiteProcess | |
| -> Double | t |
| -> [Double] | x |
| -> IO Double |
the T-forward-measure numeraire of a hybridHestonHullWhiteProcess at time t in state
x: P(t, T, x!!2) / P(0, T), where T is the process's forward-measure time and P is
the Hull-White discount bond implied by the simulated short-rate factor.
The state is [S, v, r] -- spot, variance and the Hull-White factor, in the order
initialValues returns -- and only x!!2 is read. This is not a bank account: to turn a
simulated time-t payoff into a present value, divide it by this numeraire and multiply by
the curve's own discount ts T.
T is captured when the hybrid process is constructed, from the
hullWhiteForwardProcess's forward-measure time -- so setForwardMeasureTime must be
called on that process before hybridHestonHullWhiteProcess, not after.