Fit piecewise constant volatilities to a set of equity options
Fit piecewise constant volatilities to a set of equity options
Given a set of equity options with increasing tenors, along with target prices for those options, and a set of equity-lined default SDE parameters, fit a vector of piecewise constant volatilities and an associated cumulative variance function to them.
eq_options: A list of options to find prices for. Each must have fields callput, maturity, and strike. This list must be in strictly increasing order of maturity.
mid_prices: Prices to match
spreads: Spreads within which any match is tolerable
initial_vols_guess: Initial set of volatilities to try in the root finder
use_impvol: Judge fit quality on implied vol distance rather than price distance
relative_spread_tolerance: Tolerance multiplier on bid-ask spreads taken from vol normalization
force_same_grid: Price all options on the same grid, rather than having smaller timestep sizes for earlier maturities
num_time_steps: Minimum number of time steps in the grid
const_short_rate: A constant to use for the instantaneous interest rate in case discount_factor_fcn
is not given
const_default_intensity: A constant to use for the instantaneous default intensity in case default_intensity_fcn
is not given
discount_factor_fcn: A function for computing present values to time t of various cashflows occurring, with arguments T, t
survival_probability_fcn: A function for probability of survival, with arguments T, t and T>t. E.g. with a constant volatility s this takes the form (T−t)s2. This argument is only used in normalization of prices to vols for root finder tolerance, and is therefore entirely optional
default_intensity_fcn: A function for computing default intensity occurring during this timestep, dependent on time and stock price, with arguments t, S. Should be consistent with survival_probability_fcn if specified
dividends: A data.frame with columns time, fixed, and proportional. Dividend size at the given time is
borrow_cost: Stock borrow cost, affecting the drift rate
dividend_rate: Continuous dividend rate, affecting the drift rate
...: Futher arguments to find_present_value
Returns
A list with two elements, volatilities and cumulation_function. The cumulation_function will be a 2-parameter function giving cumulated variances, as created by codevariance_cumulation_from_vols
Details
By default, the fitting happens in implied Black-Scholes volatility space for better normalization. That is to say, the fitting does pricing using the full SDE and PDE solver via find_present_value, but judges fit quality on the basis of running resulting prices through a nonlinear transformation that just happens to come from the straight Black-Scholes model.