Skip to content

Commit

Permalink
Removed greek characters from nm_solver
Browse files Browse the repository at this point in the history
  • Loading branch information
domokane committed Jul 27, 2021
1 parent 287ce1e commit 674fb18
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
Binary file modified docs/FinancePyManual.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/makeUserGuide.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,4 +870,4 @@ def parseType(pType):
# print("Moving ", pdfFileName1, " to ", pdfFileName2)
# shutil.move(pdfFileName1, pdfFileName2)
# print(pdfFileName2)
# open_file(pdfFileName2)
open_file(pdfFileName1)
20 changes: 10 additions & 10 deletions financepy/utils/solver_nm.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,23 +307,23 @@ def _initialize_simplex(x0, bounds):
###############################################################################

@njit(cache=True, fastmath=True)
def _check_params(ρ, χ, γ, σ, bounds, n):
def _check_params(rho, chi, v, sigma, bounds, n):
"""
Checks whether the parameters for the Nelder-Mead algorithm are valid.
JIT-compiled in `nopython` mode using Numba.
Parameters
----------
ρ : scalar(float)
rho : scalar(float)
Reflection parameter. Must be strictly greater than 0.
χ : scalar(float)
chi : scalar(float)
Expansion parameter. Must be strictly greater than max(1, roh).
γ : scalar(float)
v : scalar(float)
Contraction parameter. Must be stricly between 0 and 1.
σ : scalar(float)
sigma : scalar(float)
Shrinkage parameter. Must be strictly between 0 and 1.
bounds: ndarray(float, ndim=2)
Expand All @@ -333,15 +333,15 @@ def _check_params(ρ, χ, γ, σ, bounds, n):
Number of independent variables.
"""
if ρ < 0:
if rho < 0:
raise ValueError("roh must be strictly greater than 0.")
if χ < 1:
if chi < 1:
raise ValueError("chi must be strictly greater than 1.")
if χ < ρ:
if chi < rho:
raise ValueError("chi must be strictly greater than roh.")
if γ < 0 or γ > 1:
if v < 0 or v > 1:
raise ValueError("v must be strictly between 0 and 1.")
if σ < 0 or σ > 1:
if sigma < 0 or sigma > 1:
raise ValueError("sigma must be strictly between 0 and 1.")

if not (bounds.shape == (0, 2) or bounds.shape == (n, 2)):
Expand Down
17 changes: 9 additions & 8 deletions tests_golden/TestFinEquityAsianOption.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
# Copyright (C) 2018, 2019, 2020 Dominic O'Kane
###############################################################################

import time
from financepy.utils.global_types import OptionTypes
from financepy.products.equity.equity_asian_option import EquityAsianOption
from financepy.products.equity.equity_asian_option import AsianOptionValuationMethods
from financepy.market.curves.discount_curve_flat import DiscountCurveFlat
from financepy.models.black_scholes import BlackScholes
from financepy.utils.date import Date
from FinTestCases import FinTestCases, globalTestCaseMode

import sys
sys.path.append("..")

from FinTestCases import FinTestCases, globalTestCaseMode
from financepy.utils.date import Date
from financepy.models.black_scholes import BlackScholes
from financepy.market.curves.discount_curve_flat import DiscountCurveFlat
from financepy.products.equity.equity_asian_option import AsianOptionValuationMethods
from financepy.products.equity.equity_asian_option import EquityAsianOption
from financepy.utils.global_types import OptionTypes
import time

testCases = FinTestCases(__file__, globalTestCaseMode)

Expand Down

0 comments on commit 674fb18

Please sign in to comment.