Usage: |
vol = ImplVolaFX(X, S, K, rd, rf, tau, cp{, a0{, b0{, xtol{, maxiter}}}})
|
Input: |
| X | scalar, option price
|
| S | scalar, spot FX rate
|
| K | scalar, exercise price
|
| rd | scalar, domestic riskless interest rate (annualized)
|
| rf | scalar, foreign riskless interest rate (annualized)
|
| tau | scalar, time to expiration (in years)
|
| cp | scalar, option type
cp=1 for call option
cp=-1 for put option
|
| a0 | optional scalar, distinct initial points bracketing a root,
default a0 = 0.001
|
| b0 | optional scalar, distinct initial points bracketing a root,
default b0 = 1
|
| xtol | optional scalar, tolerance - absolute precision of the minimum,
default xtol = 1e-8
|
| maxiter | optional scalar, maximal number of iterations,
default maxiter = 100
|
Output: |
| vol | scalar, implied volatility |