<kiyosi/pricing/engines/vanilla/monte_carlo.hpp>
#include <kiyosi/pricing/engines/vanilla/monte_carlo.hpp>make_monte_carlo_vanilla_engine
Result<MonteCarloVanillaEngine> kiyosi::make_monte_carlo_vanilla_engine(MonteCarloSettings settings)Creates an engine after validating its configuration. 返回值: The engine, or an invalid_parameter error.
kiyosi::MonteCarloVanillaEngine
class kiyosi::MonteCarloVanillaEngineMonte Carlo valuation for vanilla European and American options. Accepts 1..10,000,000 paths and 2..10,000 steps; American pricing before expiry needs 3 steps. European prices sample the exact terminal distribution; the validated step count has no effect. American calls with nonpositive dividends and nonnegative rates use that distribution too, retaining the immediate-exercise lower bound. Rate stencils crossing zero use exercise-grid simulations on both sides to avoid mixing sampled estimators. American implied-volatility solves reuse request-local path and cash-flow buffers on CPU and device workspaces on CUDA; every trial recomputes its exercise decisions.
成员
MonteCarloVanillaEngine
kiyosi::MonteCarloVanillaEngine::MonteCarloVanillaEngine()=defaultCreates an engine with valid default settings.
price
Result<double> kiyosi::MonteCarloVanillaEngine::price(const EuropeanOption &option, const PricingContext &context) constPrices a European or American vanilla option. 返回值: Price, or a contract, context, numerical, or backend error.
price
Result<double> kiyosi::MonteCarloVanillaEngine::price(const AmericanOption &option, const PricingContext &context) constprice_with_greeks
Result<PricingResult> kiyosi::MonteCarloVanillaEngine::price_with_greeks(const EuropeanOption &option, const PricingContext &context, GreeksRequest greeks, NumericalShiftSettings settings={}) constPrices with the explicitly requested Greeks; unavailable measures remain empty. CPU European requests with feasible stencils reuse per-call samples, with storage linear in path count. Requests without feasible stencils stream the scalar price without retaining samples. CPU and CUDA American requests reuse a path buffer; spot stencils also cache growth factors, adding about 8 bytes per rounded-even path per time interval. All storage is request-local.
price_with_greeks
Result<PricingResult> kiyosi::MonteCarloVanillaEngine::price_with_greeks(const AmericanOption &option, const PricingContext &context, GreeksRequest greeks, NumericalShiftSettings settings) constprice_with_greeks
Result<PricingResult> kiyosi::MonteCarloVanillaEngine::price_with_greeks(const AmericanOption &option, const PricingContext &context, GreeksRequest greeks) constAmerican exercise decisions amplify small-bump sampling noise. The default spot bump is 8% of spot; other shifts retain NumericalShiftSettings defaults. Explicit shifts are absolute. Estimates still have sampling error and bump-size bias; check convergence for the valuation.
settings
MonteCarloSettings kiyosi::MonteCarloVanillaEngine::settings() const noexceptReturns the engine settings.
default_american_spot_shift
static double kiyosi::MonteCarloVanillaEngine::default_american_spot_shift(const PricingContext &context) noexceptCore-owned default shared by C++ and language bindings.