Processes¶
Stochastic processes driving the pricing engines.
processes
¶
Runtime source shim for the native itofin.processes submodule.
The real itofin.processes is a compiled submodule registered into
sys.modules by the extension (see crates/itofin-py/src/lib.rs); it wins
at import time, so nothing here runs. This file exists only so static type
checkers resolve from itofin.processes import ... from processes.pyi without
a reportMissingModuleSource warning.
Auto-generated by scripts/gen_submodule_shims.py from processes.pyi; do not edit or delete by hand.
BlackScholesProcess
¶
BlackScholesProcess(spot: float, risk_free_rate: float, dividend_yield: float, volatility: float, reference_date: Date, day_counter: DayCounter)
A generalized Black-Scholes process, built from scalars or curve objects.
The Handle plumbing is assembled internally, so no handle crosses the binding boundary. The constructor takes the conventional (risk_free_rate, dividend_yield) order and places the two curves in the core's own order at a single call site.
Build a flat-market process from scalar inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spot
|
float
|
The spot level, held as a quote. |
required |
risk_free_rate
|
float
|
The flat risk-free rate, made into a curve compounded continuously on an annual frequency. |
required |
dividend_yield
|
float
|
The flat dividend yield, made into a curve on the same convention as the risk-free rate. |
required |
volatility
|
float
|
The flat Black volatility. |
required |
reference_date
|
Date
|
The date the three flat curves are anchored on. |
required |
day_counter
|
DayCounter
|
The day count the curves accrue on. |
required |
from_curves
staticmethod
¶
from_curves(spot: float, risk_free: YieldTermStructure, dividend: YieldTermStructure, vol: BlackVolTermStructure) -> BlackScholesProcess
Build a process from term-structure objects instead of scalars.
The three legs are bound by name and placed in the core's order at a single call site, the same risk-free/dividend argument-order footgun the scalar constructor guards against.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spot
|
float
|
The spot level, held as a quote. |
required |
risk_free
|
YieldTermStructure
|
The risk-free discount curve. |
required |
dividend
|
YieldTermStructure
|
The dividend curve. |
required |
vol
|
BlackVolTermStructure
|
The Black volatility surface. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
BlackScholesProcess |
BlackScholesProcess
|
A process over the three supplied term structures. |
risk_free_rate
¶
Return the risk-free rate carried by the process.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The continuously compounded zero rate on the risk-free curve at the |
float
|
reference date. |
dividend_yield
¶
Return the dividend yield carried by the process.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The continuously compounded zero rate on the dividend curve at the |
float
|
reference date. |
HestonProcess
¶
HestonProcess(risk_free_rate: float, dividend_yield: float, spot: float, v0: float, kappa: float, theta: float, sigma: float, rho: float, reference_date: Date, day_counter: DayCounter)
The square-root stochastic-variance process.
The two flat yield curves and the spot quote are assembled behind their handles internally, so no handle crosses the binding boundary.
Build the process from scalar market inputs and the five parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
risk_free_rate
|
float
|
The flat risk-free rate, made into a curve compounded continuously on an annual frequency. |
required |
dividend_yield
|
float
|
The flat dividend yield, made into a curve on the same convention as the risk-free rate. |
required |
spot
|
float
|
The spot level, held as a quote. |
required |
v0
|
float
|
The initial variance. |
required |
kappa
|
float
|
The mean-reversion speed. |
required |
theta
|
float
|
The long-run variance. |
required |
sigma
|
float
|
The volatility of variance. |
required |
rho
|
float
|
The spot/variance correlation. |
required |
reference_date
|
Date
|
The date the two flat curves are anchored on. |
required |
day_counter
|
DayCounter
|
The day count the curves accrue on. |
required |
v0
¶
Return the initial variance.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The initial variance v0. |
kappa
¶
Return the mean-reversion speed.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The mean-reversion speed kappa. |
theta
¶
Return the long-run variance.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The long-run variance theta. |
sigma
¶
Return the volatility of variance.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The volatility of variance sigma. |
rho
¶
Return the spot/variance correlation.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The spot/variance correlation rho. |