Skip to main content

simulate_at_dates

Function simulate_at_dates 

Source
pub fn simulate_at_dates<M: SimulationModel>(
    model: &mut M,
    valuation_date: NaiveDate,
    observation_dates: &[NaiveDate],
    n_paths: usize,
    max_step_days: u32,
    day_counter: &dyn DayCounters,
) -> DatedPaths<M::State>
Expand description

Run a date-driven Monte Carlo: build an integration grid (observation dates ∪ uniform max_step_days-spaced refinement), evolve each path via the model’s step, and capture state at each observation date.

  • valuation_datet = 0 reference. All integration times are measured from here via day_counter.
  • observation_dates — must all be strictly after valuation_date.
  • max_step_days — integration step cap in calendar days. Use 1 for daily precision; larger values trade MC accuracy for speed.

The integration grid is deduplicated and sorted; observation dates always land exactly on grid points so state is captured without interpolation error.