Skip to content

Adjust vega by appropriate volatility.#2263

Merged
daminuk merged 5 commits intomasterfrom
topic/adjust-vega
Dec 9, 2020
Merged

Adjust vega by appropriate volatility.#2263
daminuk merged 5 commits intomasterfrom
topic/adjust-vega

Conversation

@daminuk
Copy link
Copy Markdown
Contributor

@daminuk daminuk commented Dec 9, 2020

  • Multiply the vega sensitivites by the appropriate volatility amount.

@daminuk daminuk requested a review from jodastephen December 9, 2020 12:14
ImmutableFixedIborSwapConvention.of("USD-Swap", USD_FIXED_1Y_30U360, USD_IBOR_LIBOR3M);
private static final List<ParameterMetadata> PARAMETER_METADATA =
MapStream.zip(TIMES.stream().boxed(), TENORS.stream().boxed())
.map(SwaptionSurfaceExpiryTenorParameterMetadata::of)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation doesn't look right here

CurrencyParameterSensitivities expectedPv01CalBucketed = pvParamSens.multipliedBy(1e-4);
PointSensitivities pvVegaPointSens = pricer.presentValueSensitivityModelParamsVolatility(RTRADE, provider, VOLS);
CurrencyParameterSensitivities expectedPv01VegaCal = VOLS.parameterSensitivity(pvVegaPointSens);
CurrencyParameterSensitivities expectedPv01VegaCalAdjusted = expectedPv01VegaCal.getSensitivities().stream()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way to use CurrencyParameterSensitivities.toBuilder().filterSensitivity(...) followed by CurrencyParameterSensitivities.mapSensitivities(...) ? If not, then maybe Strata needs an enhancement

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a mapSensitivities(BiFunction<ParameterMetadata, Double, Double>) method to the builder.

@daminuk daminuk requested a review from jodastephen December 9, 2020 14:41
Copy link
Copy Markdown
Contributor

@jodastephen jodastephen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was going to suggest using ObjDoubleToDoubleFunction but on closer look it wouldn't really help as the class is boxed anyway.

@daminuk daminuk merged commit ceba123 into master Dec 9, 2020
@delete-merged-branch delete-merged-branch bot deleted the topic/adjust-vega branch December 9, 2020 15:00
@jodastephen jodastephen added this to the v2.9 milestone Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants