volatility model code