s Chapter Contents
s Chapter Introduction
NAG C Library Manual

# NAG Library Function Documentnag_amer_bs_price (s30qcc)

## 1  Purpose

nag_amer_bs_price (s30qcc) computes the Bjerksund and Stensland (2002) approximation to the price of an American option.

## 2  Specification

 #include #include
 void nag_amer_bs_price (Nag_OrderType order, Nag_CallPut option, Integer m, Integer n, const double x[], double s, const double t[], double sigma, double r, double q, double p[], NagError *fail)

## 3  Description

nag_amer_bs_price (s30qcc) computes the price of an American option using the closed form approximation of Bjerksund and Stensland (2002). The time to maturity, $T$, is divided into two periods, each with a flat early exercise boundary, by choosing a time $t\in \left[0,T\right]$, such that $t=\frac{1}{2}\left(\sqrt{5}-1\right)T$. The two boundary values are defined as $\stackrel{~}{x}=\stackrel{~}{X}\left(t\right)$, $\stackrel{~}{X}=\stackrel{~}{X}\left(T\right)$ with
 $X~τ = B0 + B∞ - B0 1 - exp hτ ,$
where
 $hτ = - bτ+2σ⁢τ X2 B∞ - B0 B0 ,$
 $B∞ ≡ β β-1 X , B0 ≡ maxX, rr-b X ,$
 $β = 12 - bσ2 + b σ2 - 12 2 + 2 r σ2 .$
with $b=r-q$, the cost of carry, where $r$ is the risk-free interest rate and $q$ is the annual dividend rate. Here $X$ is the strike price and $\sigma$ is the annual volatility.
The price of an American call option is approximated as
 $Pcall = αX~ Sβ - αX~ ϕ S,t|β,X~,X~+ ϕ S,t|1,X~,X~ - ϕ S,t|1,x~,X~ - X ϕ S,t|0,X~,X~ + X ϕ S,t|0,x~,X~ + α x~ ϕ S,t|β,x~,X~ - αx~ Ψ S,T|β,x~,X~,x~,t + Ψ S,T|1,x~,X~,x~,t - Ψ S,T|1,X,X~,x~,t - X Ψ S,T|0,x~,X~,x~,t + X Ψ S,T|0,X,X~,x~,t ,$
where $\alpha$, $\varphi$ and $\Psi$ are as defined in Bjerksund and Stensland (2002).
The price of a put option is obtained by the put-call transformation,
 $Pput X,S,T,σ,r,q = Pcall S,X,T,σ,q,r .$

## 4  References

Bjerksund P and Stensland G (2002) Closed form valuation of American options Discussion Paper 2002/09 NHH Bergen Norway http://www.nhh.no/
Genz A (2004) Numerical computation of rectangular bivariate and trivariate Normal and $t$ probabilities Statistics and Computing 14 151–160

## 5  Arguments

1:     orderNag_OrderTypeInput
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by ${\mathbf{order}}=\mathrm{Nag_RowMajor}$. See Section 3.2.1.3 in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint: ${\mathbf{order}}=\mathrm{Nag_RowMajor}$ or Nag_ColMajor.
2:     optionNag_CallPutInput
On entry: determines whether the option is a call or a put.
${\mathbf{option}}=\mathrm{Nag_Call}$
A call. The holder has a right to buy.
${\mathbf{option}}=\mathrm{Nag_Put}$
A put. The holder has a right to sell.
Constraint: ${\mathbf{option}}=\mathrm{Nag_Call}$ or $\mathrm{Nag_Put}$.
3:     mIntegerInput
On entry: the number of strike prices to be used.
Constraint: ${\mathbf{m}}\ge 1$.
4:     nIntegerInput
On entry: the number of times to expiry to be used.
Constraint: ${\mathbf{n}}\ge 1$.
5:     x[m]const doubleInput
On entry: ${\mathbf{x}}\left[i-1\right]$ must contain ${X}_{\mathit{i}}$, the $\mathit{i}$th strike price, for $\mathit{i}=1,2,\dots ,{\mathbf{m}}$.
Constraint: ${\mathbf{x}}\left[\mathit{i}-1\right]\ge z\text{​ and ​}{\mathbf{x}}\left[\mathit{i}-1\right]\le 1/z$, where $z={\mathbf{nag_real_safe_small_number}}$, the safe range parameter, for $\mathit{i}=1,2,\dots ,{\mathbf{m}}$.
6:     sdoubleInput
On entry: $S$, the price of the underlying asset.
Constraint: ${\mathbf{s}}\ge z\text{​ and ​}{\mathbf{s}}\le \frac{1}{z}$, where $z={\mathbf{nag_real_safe_small_number}}$, the safe range parameter and ${{\mathbf{s}}}^{\beta }<\frac{1}{z}$ where $\beta$ is as defined in Section 3.
7:     t[n]const doubleInput
On entry: ${\mathbf{t}}\left[i-1\right]$ must contain ${T}_{\mathit{i}}$, the $\mathit{i}$th time, in years, to expiry, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$.
Constraint: ${\mathbf{t}}\left[\mathit{i}-1\right]\ge z$, where $z={\mathbf{nag_real_safe_small_number}}$, the safe range parameter, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$.
On entry: $\sigma$, the volatility of the underlying asset. Note that a rate of 15% should be entered as 0.15.
Constraint: ${\mathbf{sigma}}>0.0$.
9:     rdoubleInput
On entry: $r$, the annual risk-free interest rate, continuously compounded. Note that a rate of 5% should be entered as 0.05.
Constraint: ${\mathbf{r}}\ge 0.0$.
10:   qdoubleInput
On entry: $q$, the annual continuous yield rate. Note that a rate of 8% should be entered as 0.08.
Constraint: ${\mathbf{q}}\ge 0.0$.
11:   p[${\mathbf{m}}×{\mathbf{n}}$]doubleOutput
Note: the $\left(i,j\right)$th element of the matrix $P$ is stored in
• ${\mathbf{p}}\left[\left(j-1\right)×{\mathbf{m}}+i-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{p}}\left[\left(i-1\right)×{\mathbf{n}}+j-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On exit: the $m×n$ array p contains the computed option prices.
12:   failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_INT
On entry, ${\mathbf{m}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{m}}\ge 1$.
On entry, ${\mathbf{n}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{n}}\ge 1$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_REAL
On entry, ${\mathbf{q}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{q}}\ge 0.0$.
On entry, ${\mathbf{r}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{r}}\ge 0.0$.
On entry, ${\mathbf{s}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{s}}\ge 〈\mathit{\text{value}}〉$ and ${\mathbf{s}}\le 〈\mathit{\text{value}}〉$.
On entry, ${\mathbf{s}}=〈\mathit{\text{value}}〉$ and $\beta =〈\mathit{\text{value}}〉$.
Constraint: ${{\mathbf{s}}}^{\beta }<〈\mathit{\text{value}}〉$.
On entry, ${\mathbf{sigma}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{sigma}}>0.0$.
NE_REAL_ARRAY
On entry, ${\mathbf{t}}\left[〈\mathit{\text{value}}〉\right]=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{t}}\left[i\right]\ge 〈\mathit{\text{value}}〉$.
On entry, ${\mathbf{x}}\left[〈\mathit{\text{value}}〉\right]=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{x}}\left[i\right]\ge 〈\mathit{\text{value}}〉$ and ${\mathbf{x}}\left[i\right]\le 〈\mathit{\text{value}}〉$.

## 7  Accuracy

The accuracy of the output will be bounded by the accuracy of the cumulative bivariate Normal distribution function. The algorithm of Genz (2004) is used, as described in the document for nag_bivariate_normal_dist (g01hac), giving a maximum absolute error of less than $5×{10}^{-16}$. The univariate cumulative Normal distribution function also forms part of the evaluation (see nag_cumul_normal (s15abc) and nag_erfc (s15adc)).

None.

## 9  Example

This example computes the price of an American call with a time to expiry of $3$ months, a stock price of $110$ and a strike price of $100$. The risk-free interest rate is $8%$ per year, there is an annual dividend return of $12%$ and the volatility is $20%$ per year.

### 9.1  Program Text

Program Text (s30qcce.c)

### 9.2  Program Data

Program Data (s30qcce.d)

### 9.3  Program Results

Program Results (s30qcce.r)