BlackFunctionData used for normal model is confusing

NormalImpliedVolatiltiyFormula.getImpliedVolatility
NormalPriceFunction.getPriceFunction

both make use of BlackFunctionData. My first impression was that one had to pass in Black vol and somewhere within there was a equivalent vol transformation to normal vol. On closer inspection, that is not the case, one has to set normal vol on an object called BlackFunctionData and access it using BlackFunctionData.getBlackVolatility()

Switching to BlackFunctionData.getVolatility() might improve things slightly, but surely you need to use NormalFunctionData to avoid confusion.

I think you aware of this, I see comment in NormalPriceFunction.

Gary

I’ve asked someone in the quant team to take a look at this.

Jim

Gary,

You are right we should have two distinct objects, one for Black log-normal volatility and one for normal (Bachelier) volatility. We know that using the same object for two different purposes was misleading (hence the comment in the code) but we have not corrected it yet. I have added a JIRA on the issue and will correct it in the coming days.

Thanks for you comment.

Marc

The changes are now in the code. There are three objects: BlackFunctionData, NormalFunctionData and CEVFunctionData. It will be available in the 1.1 release to come soon.