From 745cc7611964afb01bc499c25ce219d18187619a Mon Sep 17 00:00:00 2001 From: makari <46679773+kano5266@users.noreply.github.com> Date: Sat, 12 Oct 2024 16:57:04 +0900 Subject: [PATCH 1/8] Update brownian.py --- pfhedge/instruments/primary/brownian.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfhedge/instruments/primary/brownian.py b/pfhedge/instruments/primary/brownian.py index ffde5e8f..dd500da2 100644 --- a/pfhedge/instruments/primary/brownian.py +++ b/pfhedge/instruments/primary/brownian.py @@ -137,7 +137,7 @@ def simulate( spot = generate_geometric_brownian( n_paths=n_paths, - n_steps=ceil(time_horizon / self.dt + 1), + n_steps=ceil(round(time_horizon / self.dt, 8) + 1), init_state=init_state, sigma=self.sigma, mu=self.mu, From b55d006f00ed0a4220c4a7c3f504c9573f6903ec Mon Sep 17 00:00:00 2001 From: makari <46679773+kano5266@users.noreply.github.com> Date: Sat, 12 Oct 2024 16:58:25 +0900 Subject: [PATCH 2/8] Update cir.py --- pfhedge/instruments/primary/cir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfhedge/instruments/primary/cir.py b/pfhedge/instruments/primary/cir.py index 51560c78..2b2be8f6 100644 --- a/pfhedge/instruments/primary/cir.py +++ b/pfhedge/instruments/primary/cir.py @@ -106,7 +106,7 @@ def simulate( spot = generate_cir( n_paths=n_paths, - n_steps=ceil(time_horizon / self.dt + 1), + n_steps=ceil(round(time_horizon / self.dt, 8) + 1), init_state=init_state, kappa=self.kappa, theta=self.theta, From 9554faa8bb1debe02818022ad408d33d823df84d Mon Sep 17 00:00:00 2001 From: makari <46679773+kano5266@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:00:01 +0900 Subject: [PATCH 3/8] Update local_volatility.py --- pfhedge/instruments/primary/local_volatility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfhedge/instruments/primary/local_volatility.py b/pfhedge/instruments/primary/local_volatility.py index 4dfeebc7..25ed77de 100644 --- a/pfhedge/instruments/primary/local_volatility.py +++ b/pfhedge/instruments/primary/local_volatility.py @@ -123,7 +123,7 @@ def simulate( output = generate_local_volatility_process( n_paths=n_paths, - n_steps=ceil(time_horizon / self.dt + 1), + n_steps=ceil(round(time_horizon / self.dt, 8) + 1), sigma_fn=self.sigma_fn, init_state=init_state, dt=self.dt, From fb159f4b7918ad372406b18f91c0b82805c9afd4 Mon Sep 17 00:00:00 2001 From: makari <46679773+kano5266@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:00:35 +0900 Subject: [PATCH 4/8] Update vasicek.py --- pfhedge/instruments/primary/vasicek.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfhedge/instruments/primary/vasicek.py b/pfhedge/instruments/primary/vasicek.py index 4416f457..9bb2a15b 100644 --- a/pfhedge/instruments/primary/vasicek.py +++ b/pfhedge/instruments/primary/vasicek.py @@ -88,7 +88,7 @@ def simulate( spot = generate_vasicek( n_paths=n_paths, - n_steps=ceil(time_horizon / self.dt + 1), + n_steps=ceil(round(time_horizon / self.dt, 8) + 1), init_state=init_state, kappa=self.kappa, theta=self.theta, From aab0c74e37fad6e75d517bf15f8c17029fa8b54a Mon Sep 17 00:00:00 2001 From: makari <46679773+kano5266@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:01:05 +0900 Subject: [PATCH 5/8] Update rough_bergomi.py --- pfhedge/instruments/primary/rough_bergomi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfhedge/instruments/primary/rough_bergomi.py b/pfhedge/instruments/primary/rough_bergomi.py index 631f76c7..ed54be88 100644 --- a/pfhedge/instruments/primary/rough_bergomi.py +++ b/pfhedge/instruments/primary/rough_bergomi.py @@ -129,7 +129,7 @@ def simulate( output = generate_rough_bergomi( n_paths=n_paths, - n_steps=ceil(time_horizon / self.dt + 1), + n_steps=ceil(round(time_horizon / self.dt, 8) + 1), init_state=init_state, alpha=self.alpha, rho=self.rho, From 5c7b824442b53dfc8e0a371f6f3004cdfe2ee58c Mon Sep 17 00:00:00 2001 From: makari <46679773+kano5266@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:01:41 +0900 Subject: [PATCH 6/8] Update merton_jump.py --- pfhedge/instruments/primary/merton_jump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfhedge/instruments/primary/merton_jump.py b/pfhedge/instruments/primary/merton_jump.py index 3384c2ce..0dcdc685 100644 --- a/pfhedge/instruments/primary/merton_jump.py +++ b/pfhedge/instruments/primary/merton_jump.py @@ -150,7 +150,7 @@ def simulate( output = generate_merton_jump( n_paths=n_paths, - n_steps=ceil(time_horizon / self.dt + 1), + n_steps=ceil(round(time_horizon / self.dt, 8) + 1), init_state=init_state, sigma=self.sigma, mu=self.mu, From e02124b20f524016be17e32b7badb839ce1b8f1a Mon Sep 17 00:00:00 2001 From: makari <46679773+kano5266@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:02:10 +0900 Subject: [PATCH 7/8] Update kou_jump.py --- pfhedge/instruments/primary/kou_jump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfhedge/instruments/primary/kou_jump.py b/pfhedge/instruments/primary/kou_jump.py index 786bf605..f811e3c8 100644 --- a/pfhedge/instruments/primary/kou_jump.py +++ b/pfhedge/instruments/primary/kou_jump.py @@ -159,7 +159,7 @@ def simulate( spot = generate_kou_jump( n_paths=n_paths, - n_steps=ceil(time_horizon / self.dt + 1), + n_steps=ceil(round(time_horizon / self.dt, 8) + 1), init_state=init_state, sigma=self.sigma, mu=self.mu, From 946c6f468464fc0561fe4fc35ccf6dc52869a203 Mon Sep 17 00:00:00 2001 From: makari <46679773+kano5266@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:02:40 +0900 Subject: [PATCH 8/8] Update heston.py --- pfhedge/instruments/primary/heston.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfhedge/instruments/primary/heston.py b/pfhedge/instruments/primary/heston.py index 56c77a92..f74b7258 100644 --- a/pfhedge/instruments/primary/heston.py +++ b/pfhedge/instruments/primary/heston.py @@ -129,7 +129,7 @@ def simulate( output = generate_heston( n_paths=n_paths, - n_steps=ceil(time_horizon / self.dt + 1), + n_steps=ceil(round(time_horizon / self.dt, 8) + 1), init_state=init_state, kappa=self.kappa, theta=self.theta,