# optstocksensbyrgw

Determine American call option prices or sensitivities using Roll-Geske-Whaley option pricing model

## Syntax

``PriceSens = optstocksensbyrgw(RateSpec,StockSpec,Settle,Maturity,OptSpec,Strike)``
``PriceSens = optstocksensbyrgw(___,Name,Value)``

## Description

example

````PriceSens = optstocksensbyrgw(RateSpec,StockSpec,Settle,Maturity,OptSpec,Strike)` computes American call option prices or sensitivities using the Roll-Geske-Whaley option pricing model. Note`optstocksensbyrgw` computes prices of American calls with a single cash dividend using the Roll-Geske-Whaley option pricing model. All sensitivities are evaluated by computing a discrete approximation of the partial derivative. This means that the option is revalued with a fractional change for each relevant parameter, and the change in the option value divided by the increment, is the approximated sensitivity value. ```

example

````PriceSens = optstocksensbyrgw(___,Name,Value)` adds an optional name-value pair argument for `OutSpec`.```

## Examples

collapse all

This example shows how to compute American call option prices and sensitivities using the Roll-Geske-Whaley option pricing model. Consider an American stock option with an exercise price of \$82 on January 1, 2008 that expires on May 1, 2008. Assume the underlying stock pays dividends of \$4 on April 1, 2008. The stock is trading at \$80 and has a volatility of 30% per annum. The risk-free rate is 6% per annum. Using this data, calculate the price and the value of `delta` and `gamma` of the American call using the Roll-Geske-Whaley option pricing model.

```AssetPrice = 80; Settle = 'Jan-01-2008'; Maturity = 'May-01-2008'; Strike = 82; Rate = 0.06; Sigma = 0.3; DivAmount = 4; DivDate = 'Apr-01-2008'; % define the RateSpec and StockSpec StockSpec = stockspec(Sigma, AssetPrice, {'cash'}, DivAmount, DivDate); RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle,... 'EndDates', Maturity, 'Rates', Rate, 'Compounding', -1, 'Basis', 1); % define the OutSpec OutSpec = {'Price', 'Delta', 'Gamma'}; [Price, Delta, Gamma] = optstocksensbyrgw(RateSpec, StockSpec, Settle,... Maturity, Strike,'OutSpec', OutSpec)```
```Price = 4.3860 ```
```Delta = 0.5022 ```
```Gamma = 0.0336 ```

## Input Arguments

collapse all

Interest-rate term structure (annualized and continuously compounded), specified by the `RateSpec` obtained from `intenvset`. For information on the interest-rate specification, see `intenvset`.

Data Types: `struct`

Stock specification for the underlying asset. For information on the stock specification, see `stockspec`.

`stockspec` handles several types of underlying assets. For example, for physical commodities the price is `StockSpec.Asset`, the volatility is `StockSpec.Sigma`, and the convenience yield is `StockSpec.DividendAmounts`.

Data Types: `struct`

Settlement or trade date, specified as serial date number or date character vector using a `NINST`-by-`1` vector.

Data Types: `double` | `char`

Maturity date for option, specified as serial date number or date character vector using a `NINST`-by-`1` vector.

Data Types: `double` | `char`

Definition of the option as `'call'` or `'put'`, specified as a `NINST`-by-`1` cell array of character vectors with values `'call'` or `'put'`.

Data Types: `char` | `cell`

Option strike price value, specified as a nonnegative `NINST`-by-`1` vector.

Data Types: `double`

### Name-Value Pair Arguments

Specify optional comma-separated pairs of `Name,Value` arguments. `Name` is the argument name and `Value` is the corresponding value. `Name` must appear inside quotes. You can specify several name and value pair arguments in any order as `Name1,Value1,...,NameN,ValueN`.

Example: ```[Delta,Gamma,Price] = optstocksensbyrgw(RateSpec,StockSpec,Settle,Maturity,OptSpec,Strike,'OutSpec',OutSpec)```

Define outputs, specified as the comma-separated pair consisting of `'OutSpec'` and a `NOUT`- by-`1` or `1`-by-`NOUT` cell array of character vectors with possible values of `'Price'`, `'Delta'`, `'Gamma'`, `'Vega'`, `'Lambda'`, `'Rho'`, `'Theta'`, and `'All'`.

`OutSpec = {'All'}` specifies that the output should be `Delta`, `Gamma`, `Vega`, `Lambda`, `Rho`, `Theta`, and `Price`, in that order. This is the same as specifying `OutSpec` to include each sensitivity:

Example: ```OutSpec = {'delta','gamma','vega','lambda','rho','theta','price'}```

Data Types: `char` | `cell`

## Output Arguments

collapse all

Expected future prices or sensitivities values, returned as a `NINST`-by-`1` vector.

Data Types: `double`

collapse all

### Vanilla Option

A vanilla option is a category of options that includes only the most standard components.

A vanilla option has an expiration date and straightforward strike price. American-style options and European-style options are both categorized as vanilla options.

The payoff for a vanilla option is as follows:

• For a call: $\mathrm{max}\left(St-K,0\right)$

• For a put: $\mathrm{max}\left(K-St,0\right)$

where:

St is the price of the underlying asset at time t.

K is the strike price.