diff --git a/pfhedge/instruments/primary/brownian.py b/pfhedge/instruments/primary/brownian.py index f8ddf9e8..94b4e83d 100644 --- a/pfhedge/instruments/primary/brownian.py +++ b/pfhedge/instruments/primary/brownian.py @@ -12,6 +12,9 @@ class BrownianStock(Primary): The drift of the spot prices is assumed to be vanishing. + See :func:`pfhedge.stochastic.generate_geometric_brownian` + for details of the process. + Args: volatility (float, default=0.2): The volatility of the price. cost (float, default=0.0): The transaction cost rate. diff --git a/pfhedge/instruments/primary/heston.py b/pfhedge/instruments/primary/heston.py index 4c606d34..82d5d817 100644 --- a/pfhedge/instruments/primary/heston.py +++ b/pfhedge/instruments/primary/heston.py @@ -10,7 +10,7 @@ class HestonStock(Primary): """A stock of which spot price and variance follow Heston process. - See :func:`pfhedge.stochastic.generate_heston` for details of the Heston process. + See :func:`pfhedge.stochastic.generate_heston` for details of the process. Args: kappa (float, default=1.0): The parameter :math:`\\kappa`. diff --git a/pfhedge/nn/modules/bs/american_binary.py b/pfhedge/nn/modules/bs/american_binary.py index 48882b46..93880352 100644 --- a/pfhedge/nn/modules/bs/american_binary.py +++ b/pfhedge/nn/modules/bs/american_binary.py @@ -43,6 +43,10 @@ class BSAmericanBinaryOption(BSModuleMixin): tensor([[1.1285], [0.0000], [0.0000]]) + + References: + Dai, M., 2000. A closed-form solution for perpetual American floating strike + lookback options. Journal of Computational Finance, 4(2), pp.63-68. """ def __init__(self, call: bool = True, strike: float = 1.0): diff --git a/pfhedge/nn/modules/bs/european.py b/pfhedge/nn/modules/bs/european.py index 2a8d0723..df6ddc46 100644 --- a/pfhedge/nn/modules/bs/european.py +++ b/pfhedge/nn/modules/bs/european.py @@ -41,6 +41,9 @@ class BSEuropeanOption(BSModuleMixin): tensor([[0.4497], [0.5126], [0.5752]]) + + References: + John C. Hull, 2003. Options futures and other derivatives. Pearson. """ def __init__(self, call: bool = True, strike: float = 1.0): @@ -142,7 +145,6 @@ def price( Args: log_moneyness (torch.Tensor): Log moneyness of the underlying asset. - max_log_moneyness (torch.Tensor): Cumulative maximum of the log moneyness. expiry_time (torch.Tensor): Time to expiry of the option. volatility (torch.Tensor): Volatility of the underlying asset. diff --git a/pfhedge/nn/modules/bs/european_binary.py b/pfhedge/nn/modules/bs/european_binary.py index 68f94eb1..c124062c 100644 --- a/pfhedge/nn/modules/bs/european_binary.py +++ b/pfhedge/nn/modules/bs/european_binary.py @@ -42,6 +42,9 @@ class BSEuropeanBinaryOption(BSModuleMixin): tensor([[6.2576], [6.3047], [6.1953]]) + + References: + John C. Hull, 2003. Options futures and other derivatives. Pearson. """ def __init__(self, call: bool = True, strike: float = 1.0): diff --git a/pfhedge/nn/modules/bs/lookback.py b/pfhedge/nn/modules/bs/lookback.py index 04d374cb..b083c30e 100644 --- a/pfhedge/nn/modules/bs/lookback.py +++ b/pfhedge/nn/modules/bs/lookback.py @@ -44,6 +44,10 @@ class BSLookbackOption(BSModuleMixin): tensor([[0.9208], [1.0515], [1.0515]]) + + References: + Conze, A., 1991. Path dependent options: The case of lookback options. + The Journal of Finance, 46(5), pp.1893-1907. """ def __init__(self, call: bool = True, strike: float = 1.0): diff --git a/pfhedge/stochastic/brownian.py b/pfhedge/stochastic/brownian.py index c9e65d40..f8443c85 100644 --- a/pfhedge/stochastic/brownian.py +++ b/pfhedge/stochastic/brownian.py @@ -17,6 +17,12 @@ def generate_brownian( The drift of the time series is assumed to be vanishing. + The time evolution of the process is given by: + + .. math :: + + dS(t) = \\sigma dW(t) \\,. + Args: n_paths (int): The number of simulated paths. n_steps (int): The number of time steps. @@ -66,6 +72,12 @@ def generate_geometric_brownian( The drift of the time series is assumed to be vanishing. + The time evolution of the process is given by: + + .. math :: + + dS(t) = \\sigma S(t) dW(t) \\,. + Args: n_paths (int): The number of simulated paths. n_steps (int): The number of time steps. diff --git a/pfhedge/stochastic/cir.py b/pfhedge/stochastic/cir.py index f84730a0..f27f196b 100644 --- a/pfhedge/stochastic/cir.py +++ b/pfhedge/stochastic/cir.py @@ -15,12 +15,14 @@ def generate_cir( ) -> Tensor: """Returns time series following Cox-Ingersoll-Ross process. - The time evolution of CIR process is given by: + The time evolution of the process is given by: .. math :: dX(t) = \\kappa (\\theta - X(t)) + \\sigma \\sqrt{X(t)} dW(t) \\,. + Time-series is generated by Andersen's QE-M method (See Reference for details). + Args: n_paths (int): The number of simulated paths. n_steps (int): The number of time steps. diff --git a/pfhedge/stochastic/heston.py b/pfhedge/stochastic/heston.py index fcb00056..b3376e21 100644 --- a/pfhedge/stochastic/heston.py +++ b/pfhedge/stochastic/heston.py @@ -21,7 +21,7 @@ def generate_heston( ) -> Tuple[Tensor, Tensor]: """Returns time series following Heston model. - The time evolution of Heston process is given by: + The time evolution of the process is given by: .. math :: @@ -29,7 +29,8 @@ def generate_heston( dV(t) = \\kappa (\\theta - V(t)) + \\sigma \\sqrt{V(t)} dW_2(t) \\,. The correlation between :math:`dW_1` and :math:`dW_2` is :math:`\\rho`. - The correlation between :math:`dW_1` and :math:`dW_2` is `\\rho`. + + Time-series is generated by Andersen's QE-M method (See Reference for details). Args: n_paths (int): The number of simulated paths. diff --git a/pyproject.toml b/pyproject.toml index d4df0eb3..e736671c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pfhedge" -version = "0.7.3" +version = "0.7.4" description = "Deep Hedging in PyTorch" authors = ["Shota Imaki "] license = "MIT"