coupling
couplinglevycopula
Description of a coupled process for a Lévy copula
The Multi-level Monte-Carlo uses a coupled process defined as a coarse process and a fine process
- class CouplingProcessLevyCopula(levy_copula_model: LevyCopulaModel, grid: CTMCGrid, method: SamplingMethod)[source]
Bases:
objectCoupling of a Lévy Copula Markov Chain process
- __init__(levy_copula_model: LevyCopulaModel, grid: CTMCGrid, method: SamplingMethod)[source]
- Parameters
levy_copula_model – Lévy copula to be approximated
grid – states grid
method – simulation algorithm method
- class CouplingLevyCopulaSimulation(coupling_process: CouplingProcessLevyCopula)[source]
Bases:
object- __init__(coupling_process: CouplingProcessLevyCopula)[source]
- class CouplingLevyCopulaSimulationFixedTimes(coupling_process: CouplingProcessLevyCopula)[source]
Bases:
CouplingLevyCopulaSimulation- __init__(coupling_process: CouplingProcessLevyCopula)[source]
- class CouplingLevyCopulaSimulationWithJumpTimes(coupling_process: CouplingProcessLevyCopula)[source]
Bases:
CouplingLevyCopulaSimulation- __init__(coupling_process: CouplingProcessLevyCopula)[source]
couplingmarkovchain
Description of a coupling process for a Continuous-Time Markov Chain
The Multi-level Monte-Carlo relies on a process defining the coupling between a ‘coarse’ process and a ‘fine’ process
- class CouplingMarkovChain(model: LevyModel, method: SamplingMethod, grid: CTMCGrid)[source]
Bases:
objectCoupling of a Markov Chain process
- __init__(model: LevyModel, method: SamplingMethod, grid: CTMCGrid)[source]
- Parameters
model – Lévy model
grid – grid states
method – sampling method for the discrete distribution (i.e. the distribution over the spatial states)
- one_simulation_cost(product) float[source]
Cost of simulating one Monte-Carlo path
- Parameters
product – product to price
- next_level(mc_paths: int, path_managers: [<class 'rpylib.montecarlo.path.MCPath'>], product: ~rpylib.product.product.Product, max_step_epsilon: ~typing.Optional[float] = None)[source]
Update the coupling for the new spatial step h/2
- Parameters
mc_paths – number of Monte-Carlo paths (this is passed to the pre_computation method which initialised the random variables and the cost)
path_managers – list of Monte-Carlo path managers for each MLMC level
product – financial product
max_step_epsilon – maximum step size epsilon for the SimulationMaximumStep case
- class CouplingSimulation(coupling_process: CouplingMarkovChain)[source]
Bases:
objectMethod for the simulation of the coupling process
- __init__(coupling_process: CouplingMarkovChain)[source]
- static probability_to_right_jump(grid: CTMCGrid, mass, increment) float[source]
Compute the probability to jump to the ‘right’ state. ‘right’ means the upper-right corner in the multidimensional case.
- Parameters
grid – states grid
mass – mass function
increment – fine process increment
- coupling_state(increment)[source]
Coupling implementation. If the increment of the fine process is in the coarse grid, then the coarse process has the same increment, otherwise the coupling defines a new increment for the coarse process.
- Parameters
increment – increment of the fine process
- Returns
the increment for the coarse process
- class CouplingSimulationFixedTimes(coupling_process: CouplingMarkovChain)[source]
Bases:
CouplingSimulationSimulation of the coupling at (pre-defined) fixed times
- __init__(coupling_process: CouplingMarkovChain)[source]
- class CouplingSimulationWithJumpTimes(coupling_process: CouplingMarkovChain)[source]
Bases:
CouplingSimulationSimulation of the coupling at stochastic jump times
- __init__(coupling_process: CouplingMarkovChain)[source]
- class CouplingSimulationMaximumStep(coupling_process, epsilon: float)[source]
Bases:
CouplingSimulationWithJumpTimesSimulation of the coupling at the stochastic jump times but extra time increments are added so that the times grid has a maximum time step of size epsilon
couplingprocess
couplingsde
Description of a coupled process for a Lévy-driven SDE
- class CouplingSDE(model: LevyDrivenSDEModel, grid: CTMCGrid, method: SamplingMethod)[source]
Bases:
object- __init__(model: LevyDrivenSDEModel, grid: CTMCGrid, method: SamplingMethod)[source]
helper
Factorisation of code common to the both the 1d and Lévy copula case for coupling processes