2
$\begingroup$

I have created BlackVarianceSurface and enabled extrapolation but unable to change extrapolation type used. It is giving flat extrapolation. Used setInterpolation to change method type but extrapolation still coming out as flat. How can that be modified?

Code is:

black_var_surface = ql.BlackVarianceSurface(calculation_date, calendar, expiration_dates, strikes, implied_vols, day_count)

black_var_surface.setInterpolation("bicubic")

black_var_surface.enableExtrapolation()

$\endgroup$

1 Answer 1

2
$\begingroup$

You can't, at least from Python. Currently, flat extrapolation in time it's hard-coded. To modify that, you'll have to change the underlying C++ code.

(On the other hand, you can select whether extrapolation on the strike axis should use the provided interpolation or go flat. The default is to use the interpolation, and the choice needs to be made when building the curve; see the last two constructor arguments.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.