Skip to content

Commit 4065ca4

Browse files
committed
fix: heston model calibration
1 parent a880cf6 commit 4065ca4

File tree

4 files changed

+395
-353
lines changed

4 files changed

+395
-353
lines changed

src/quant/calibration.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
use nalgebra::DVector;
2+
3+
use crate::quant::CalibrationLossScore;
4+
15
pub mod bsm;
2-
pub mod heston;
36
pub mod sabr;
7+
pub mod heston;
8+
9+
#[derive(Clone, Debug)]
10+
pub struct CalibrationHistory<T> {
11+
pub residuals: DVector<f64>,
12+
pub call_put: DVector<(f64, f64)>,
13+
pub params: T,
14+
pub loss_scores: CalibrationLossScore,
15+
}

src/quant/calibration/bsm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ use levenberg_marquardt::{LeastSquaresProblem, LevenbergMarquardt};
55
use nalgebra::{DMatrix, DVector, Dyn, Owned};
66

77
use crate::quant::{
8+
calibration::CalibrationHistory,
89
pricing::bsm::{BSMCoc, BSMPricer},
910
r#trait::{CalibrationLossExt, PricerExt},
1011
CalibrationLossScore, OptionType,
1112
};
1213

13-
use super::heston::CalibrationHistory;
14-
1514
#[derive(Clone, Debug)]
1615
pub struct BSMParams {
1716
/// Implied volatility

0 commit comments

Comments
 (0)