Skip to content

Commit b0a1325

Browse files
committed
FEATURE: fixing tests
1 parent 9c3a484 commit b0a1325

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pdesolvers/tests/test_options_pricing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def mc_pricing_params():
1010
return {
1111
'S0': 100.0,
1212
'strike_price': 100.0,
13-
'r': 0.05,
13+
'mu': 0.05,
1414
'sigma': 0.2,
1515
'T': 1.0,
1616
'time_steps': 252,
@@ -31,7 +31,7 @@ def test_get_european_call_option_price(self, mock_simulate_gbm, mc_pricing_para
3131
)
3232

3333
mock_payoffs = np.maximum(np.array([110, 120, 90, 105, 115]) - mc_pricing_params['strike_price'], 0)
34-
expected_price = np.exp(-mc_pricing_params['r'] * mc_pricing_params['T']) * np.mean(mock_payoffs)
34+
expected_price = np.exp(-mc_pricing_params['mu'] * mc_pricing_params['T']) * np.mean(mock_payoffs)
3535

3636
actual_price = test_mc.get_monte_carlo_option_price()
3737

@@ -49,7 +49,7 @@ def test_get_european_put_option_price(self, mock_simulate_gbm, mc_pricing_param
4949
)
5050

5151
mock_payoffs = np.maximum(mc_pricing_params['strike_price'] - np.array([110, 120, 90, 105, 115]), 0)
52-
expected_price = np.exp(-mc_pricing_params['r'] * mc_pricing_params['T']) * np.mean(mock_payoffs)
52+
expected_price = np.exp(-mc_pricing_params['mu'] * mc_pricing_params['T']) * np.mean(mock_payoffs)
5353

5454
actual_price = test_mc.get_monte_carlo_option_price()
5555

0 commit comments

Comments
 (0)