pub trait ModelCalibrator: Send + Sync {
// Required methods
fn model_name(&self) -> &str;
fn param_count(&self) -> usize;
fn param_bounds(&self) -> &[(f64, f64)];
fn evaluate_objective(&self, x: &[f64], data: &[MarketDataRow]) -> f64;
fn price_options(
&self,
market_data: &[MarketDataRow],
best_params: &[f64],
config: &OptimizationConfig,
) -> Vec<PricingResult>;
fn param_names(&self) -> Vec<&str>;
fn as_any(&self) -> &dyn Any;
// Provided methods
fn set_prev_solution(&mut self, _prev_solution: Vec<f64>) { ... }
fn set_temporal_reg_lambda(&mut self, _lambda: f64) { ... }
fn expand_bounds_if_needed(
&mut self,
_params: &[f64],
_proximity_threshold: f64,
_expansion_factor: f64,
) -> bool { ... }
}Expand description
Model calibrator trait for parameter optimization
Required Methods§
Sourcefn model_name(&self) -> &str
fn model_name(&self) -> &str
Returns the name of the model (e.g., “svi”)
Sourcefn param_count(&self) -> usize
fn param_count(&self) -> usize
How many parameters are in the model’s optimization vector
Sourcefn param_bounds(&self) -> &[(f64, f64)]
fn param_bounds(&self) -> &[(f64, f64)]
Returns the vector of (min, max) bounds for each parameter
Sourcefn evaluate_objective(&self, x: &[f64], data: &[MarketDataRow]) -> f64
fn evaluate_objective(&self, x: &[f64], data: &[MarketDataRow]) -> f64
Given a parameter vector x and data, returns the objective value
Sourcefn price_options(
&self,
market_data: &[MarketDataRow],
best_params: &[f64],
config: &OptimizationConfig,
) -> Vec<PricingResult>
fn price_options( &self, market_data: &[MarketDataRow], best_params: &[f64], config: &OptimizationConfig, ) -> Vec<PricingResult>
Price options using the calibrated parameters
Sourcefn param_names(&self) -> Vec<&str>
fn param_names(&self) -> Vec<&str>
Returns parameter names in the order they appear in the optimization vector
Provided Methods§
Sourcefn set_prev_solution(&mut self, _prev_solution: Vec<f64>)
fn set_prev_solution(&mut self, _prev_solution: Vec<f64>)
Set the previous solution for temporal regularization
Sourcefn set_temporal_reg_lambda(&mut self, _lambda: f64)
fn set_temporal_reg_lambda(&mut self, _lambda: f64)
Set the lambda parameter for temporal regularization