multilevel
criteria
Convergence criteria for the Multi-level Monte-Carlo
- class ConvergenceCriteria(criteria: Callable[[float, array, float], bool], compute_mc_paths: Callable[[float, array, array], array])[source]
Bases:
objectCharacterisation of the criteria convergence and the update of the number of paths after each pass
- compute_mc_paths_giles(rmse: float, vl: array, cl: array) array[source]
Same as in Giles papers :param rmse: root-mean square error :param vl: estimated variance of the correction terms \(|P_l - P_{l-1}|\) :param cl: cost of each level l :return: the updated number of Monte-Carlo paths for each level l
- criteria_giles(alpha: float, ml: array, rmse: float) bool[source]
Same convergence criteria as in Giles papers
- Parameters
alpha – weak convergence rate
ml – estimated mean of the correction terms \(|P_l - P_{l-1}|\)
rmse – root-mean square error
- Returns
true if the convergence criteria has been met
- criteria_run_to_maximum_level(alpha: float, ml: array, rmse: float) bool[source]
Run the Multilevel Monte-Carlo until the last level :return: always false so that the algorithm runs until the maximum level
- class GilesConvergenceCriteria[source]
Bases:
ConvergenceCriteria
engine
Multilevel Monte-Carlo engine
Note
the discounting is deterministic by design
the implementation supports multiprocessing
- class Engine(configuration: ConfigurationMultiLevel, coupling_process: Union[CouplingMarkovChain, CouplingSDE, CouplingProcessLevyCopula])[source]
Bases:
objectMultilevel Monte-Carlo engine
- __init__(configuration: ConfigurationMultiLevel, coupling_process: Union[CouplingMarkovChain, CouplingSDE, CouplingProcessLevyCopula])[source]
The Multilevel Monte-Carlo relies on the simulation of the fine and coarse processes linked by a coupling. :param configuration: Multilevel Monte-Carlo configuration :param coupling_process: stochastic coupling process of the fine and coarse processes
- compute_level_l(level: int, current_mc_paths: int, extra_mc_paths: int, coupling_process: Union[CouplingMarkovChain, CouplingSDE, CouplingProcessLevyCopula], product: Product, df: float, statistics: MLMCStatistics) None[source]
Run the Multilevel Monte-Carlo for the level l :param level: current level :param current_mc_paths: number of Monte-Carlo paths applied to the level l :param extra_mc_paths: extra number of paths to be applied to the level l :param coupling_process: coupling process defining the coupling between the fine and coarse processes :param product: product to price :param df: discount factor function :param statistics: statistics object
- price(product: Product, rmse: float) MLMCStatistics[source]
Pricing of the product by the Multilevel Monte-Carlo engine :param product: product to price :param rmse: root-mean square error
- price_with_constant_mc_paths_and_level(product) MLMCStatistics[source]
Same as the
price()function but with constant number of paths and a fixed number of levels :param product: product to price