Skip to content

Commit

Permalink
chore: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dancixx committed Oct 6, 2024
1 parent 11caf98 commit f0cb3d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/stochastic/diffusion/gbm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,26 +187,26 @@ mod tests {

#[test]
fn gmb_length_equals_n() {
let gbm = GBM::new(0.25, 0.5, N, Some(X0), None, None, None, None);
let gbm = GBM::new(0.25, 0.5, N, Some(X0), Some(1.0), None, None, None);
assert_eq!(gbm.sample().len(), N);
}

#[test]
fn gmb_starts_with_x0() {
let gbm = GBM::new(0.25, 0.5, N, Some(X0), None, None, None, None);
let gbm = GBM::new(0.25, 0.5, N, Some(X0), Some(1.0), None, None, None);
assert_eq!(gbm.sample()[0], X0);
}

#[test]
fn gmb_plot() {
let gbm = GBM::new(0.25, 0.5, N, Some(X0), None, None, None, None);
let gbm = GBM::new(0.25, 0.5, N, Some(X0), Some(1.0), None, None, None);
plot_1d!(gbm.sample(), "Geometric Brownian Motion (GBM) process");
}

#[test]
#[cfg(feature = "malliavin")]
fn gmb_malliavin() {
let gbm = GBM::new(0.25, 0.5, N, Some(X0), None, None, None, Some(true));
let gbm = GBM::new(0.25, 0.5, N, Some(X0), Some(1.0), None, None, Some(true));
let process = gbm.sample();
let malliavin = gbm.malliavin();
plot_2d!(
Expand Down

0 comments on commit f0cb3d5

Please sign in to comment.