google / google/tf-quant-finance

IRS Delta

Open
#76 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.5k
Forks
698
PR merge metrics
No merged PRs in 30d

Description

In
https://github.com/google/tf-quant-finance/tree/master/tf_quant_finance/experimental/pricing_platform/framework/rate_instruments/interest_rate_swap/interest_rate_swap_impl.py

under def ir_delta it says
raise NotImplementedError("Coming soon.")

In ir_delta_parallel_leg, I see that:
if shock_size is None:
bump = tf.constant(0, dtype=self._dtype,
name="bump")
return tff_math.fwd_gradient(price_fn, bump)

So when no shocks are supplied - its just fwd_gradient. Isn't that the AAD equiv of the bump and reval change in PV?

But when a shock size is supplied, you bump the base curve (as a parallel bump) and then:
price_no_bump = leg.price(processed_market_data)
price_with_bump = price_fn(shock_size)
delta = (price_with_bump - price_no_bump) / shock_size
return delta

So in effect, ir_delta_parallel has the potential to supply both delta's? (AAD equiv and parallel shocked

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.