[−][src]Function fang_oost_option::option_pricing::fang_oost_call_theta
pub fn fang_oost_call_theta<'a, S>(
num_u: usize,
asset: f64,
strikes: &'a [f64],
max_strike: f64,
rate: f64,
t_maturity: f64,
cf: S
) -> Vec<f64> where
S: Fn(&Complex<f64>) -> Complex<f64> + Sync + Send,
Returns theta of a call for the series of strikes
Remarks
The theta of a call will only be accurate for non-time changed Levy processes. For a time-changed Levy process (eg, Heston's model) the theta is not accurate.
Examples
extern crate num_complex; use num_complex::Complex; extern crate fang_oost_option; use fang_oost_option::option_pricing; let num_u:usize = 256; let asset = 50.0; let strikes = vec![75.0, 50.0, 40.0]; let rate = 0.03; let t_maturity = 0.5; let volatility:f64 = 0.3; let max_strike = 5000.0; //needs to be "large enough" to integrate over space //As an example, cf is standard diffusion let cf = |u: &Complex<f64>| { ((rate-volatility*volatility*0.5)*t_maturity*u+volatility*volatility*t_maturity*u*u*0.5).exp() }; let deltas = option_pricing::fang_oost_call_theta( num_u, asset, &strikes, max_strike, rate, t_maturity, &cf );