Quiz: Monte Carlo Pricing Framework in C++
Module 5 of 8 · Hard
Quick Quiz
1. The `PathSimulator` stores the model as `const Model* _model` (a raw owning pointer). In the copy constructor, `_model(ps._model->clone())` is used. What is the purpose of storing the model as a pointer rather than as a `Model` object by value?
2. The `EulerPathSimulator::next_step` computes: ```cpp double next_step = current_price + model->drift_term(t, current_price) * dt + model->diffusion_term(t, current_price) * sqrt(dt) * gaussian; ``` For Black-Scholes where `drift_term = r*S` and `diffusion_term = sigma*S`, what is the bias of this Euler scheme for large `dt`?
3. The standard error of a Monte Carlo estimate decreases as `O(1/N)` — doubling the number of paths halves the standard error.
4. In the `MonteCarlo` engine, `_path_simulator` is stored as `PathSimulator*` obtained via `clone()`. In the `price()` method that loops over paths, each call to `_path_simulator->path()` generates an independent path. What ensures independence between paths?
5. The `Payoff` hierarchy has `EuropeanOptionPayoff`, `PutPayoff`, and `AsianCallPayoff`. All derive from `Payoff` and implement `discounted_payoff(path, time_points)`. For a European call with strike K, what is the correct implementation?
6. The Open/Closed Principle, as applied to the MC pricing framework, means that you can add a new model (e.g., `HestonModel`) or a new payoff (e.g., `BarrierCallPayoff`) without modifying `MonteCarlo`, `PathSimulator`, or any existing class.