Skip to content

Commit 55de845

Browse files
authored
Merge pull request #5 from PyFE/code
Test \code and \link
2 parents 421da8b + 46b0026 commit 55de845

12 files changed

+46
-26
lines changed

pkg/R/bachelier_impvol.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#' @param intr interest rate
88
#' @param divr dividend rate
99
#' @param cpsign call/put sign. 1 for call, -1 for put.
10-
#' @param forward forward price. If given, forward overrides spot
11-
#' @param df discount factor. If given, df overrides intr
10+
#' @param forward forward price. If given, \code{forward} overrides \code{spot}
11+
#' @param df discount factor. If given, \code{df} overrides \code{intr}
1212
#' @return Bachelier implied volatility
1313
#'
1414
#' @references Choi, J., Kim, K., & Kwak, M. (2009). Numerical Approximation of the Implied Volatility Under Arithmetic Brownian Motion. Applied Mathematical Finance, 16(3), 261–268.
@@ -25,6 +25,8 @@
2525
#' price <- 20
2626
#' vol <- FER::BachelierImpvol(price, strike, spot, texp, intr=intr)
2727
#'
28+
#' @seealso \code{\link{BachelierPrice}}
29+
#'
2830
BachelierImpvol <- function(
2931
price, strike = forward, spot, texp = 1,
3032
intr = 0, divr = 0, cpsign = 1,

pkg/R/bachelier_price.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#' @param intr interest rate
88
#' @param divr dividend rate
99
#' @param cpsign call/put sign. 1 for call, -1 for put.
10-
#' @param forward forward price. If given, forward overrides spot
11-
#' @param df discount factor. If given, df overrides intr
10+
#' @param forward forward price. If given, \code{forward} overrides \code{spot}
11+
#' @param df discount factor. If given, \code{df} overrides \code{intr}
1212
#' @return option price
1313
#'
1414
#' @export
@@ -21,6 +21,8 @@
2121
#' intr <- 0.05
2222
#' price <- FER::BachelierPrice(strike, spot, texp, sigma, intr=intr)
2323
#'
24+
#' @seealso \code{\link{BachelierImpvol}}
25+
#'
2426
BachelierPrice <- function(
2527
strike = forward, spot, texp = 1, sigma,
2628
intr = 0, divr = 0, cpsign=1,

pkg/R/blackscholes_impvol.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#' @param intr interest rate
88
#' @param divr dividend rate
99
#' @param cpsign call/put sign. 1 for call, -1 for put.
10-
#' @param forward forward price. If given, forward overrides spot
11-
#' @param df discount factor. If given, df overrides intr
10+
#' @param forward forward price. If given, \code{forward} overrides \code{spot}
11+
#' @param df discount factor. If given, \code{df} overrides \code{intr}
1212
#' @return Black-Scholes implied volatility
1313
#'
1414
#' @export
@@ -22,6 +22,8 @@
2222
#' price <- 20
2323
#' vol <- FER::BlackScholesImpvol(price, strike, spot, texp, intr=intr)
2424
#'
25+
#' @seealso \code{\link{BlackScholesPrice}}
26+
#'
2527
BlackScholesImpvol <- function(
2628
price, strike = forward, spot, texp = 1,
2729
intr = 0, divr = 0, cpsign = 1,

pkg/R/blackscholes_price.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#' @param sigma (vector of) volatility
77
#' @param intr interest rate
88
#' @param divr dividend rate
9-
#' @param type option type either 'call' or 'put'
10-
#' @param forward forward price. If given, forward overrides spot
11-
#' @param df discount factor. If given, df overrides intr
9+
#' @param cpsign call/put sign. 1 for call, -1 for put.
10+
#' @param forward forward price. If given, \code{forward} overrides \code{spot}
11+
#' @param df discount factor. If given, \code{df} overrides \code{intr}
1212
#' @return option price
1313
#'
1414
#' @export
@@ -21,6 +21,8 @@
2121
#' intr <- 0.05
2222
#' price <- FER::BlackScholesPrice(strike, spot, texp, sigma, intr=intr)
2323
#'
24+
#' @seealso \code{\link{BlackScholesImpvol}}
25+
#'
2426
BlackScholesPrice <- function(
2527
strike = forward, spot, texp = 1, sigma,
2628
intr = 0, divr = 0, cpsign = 1,

pkg/R/cev_price.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#' @param intr interest rate
99
#' @param divr dividend rate
1010
#' @param cpsign call/put sign. 1 for call, -1 for put.
11-
#' @param forward forward price. If given, forward overrides spot
12-
#' @param df discount factor. If given, df overrides intr
11+
#' @param forward forward price. If given, \code{forward} overrides \code{spot}
12+
#' @param df discount factor. If given, \code{df} overrides \code{intr}
1313
#' @return option price
1414
#'
1515
#' @export

pkg/R/sabr_hagan2002.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#' @param intr interest rate
1111
#' @param divr dividend rate
1212
#' @param cpsign call/put sign. NULL for BS vol (default), 1 for call price, -1 for put price.
13-
#' @param forward forward price. If given, forward overrides spot
14-
#' @param df discount factor. If given, df overrides intr
13+
#' @param forward forward price. If given, \code{forward} overrides \code{spot}
14+
#' @param df discount factor. If given, \code{df} overrides \code{intr}
1515
#' @return BS volatility or option price based on cpsign
1616
#'
1717
#' @references Hagan, P. S., Kumar, D., Lesniewski, A. S., & Woodward, D. E. (2002). Managing Smile Risk. Wilmott, September, 84–108.

pkg/man/BachelierImpvol.Rd

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/man/BachelierPrice.Rd

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/man/BlackScholesImpvol.Rd

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/man/BlackScholesPrice.Rd

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)