When did I ever say it was "dirty"?Quote from henderson:
I would be interested in seeing your matlab code for the dirty implementation
Anyways, it's not exactly rocket science right here:
pp = spline(strikes, prices);
ppd = diffPP(pp);
ppdd = diffPP(ppd);
splitIncr = strikeStep / 2;
splitStrikes = [strikes(1)-splitIncr:splitIncr:strikes(end)+splitIncr]';
splitPrices = ppval(ppdd, splitStrikes);
for j = 1:length(strikes)-1
RNProbs(j) = trapz(splitStrikes(j*2-1:j*2+1),splitPrices(j*2-1:j*2+1));
end
This should work, if I haven't screwed anything up. Now I hope I don't go to jail for violating that crazy patent.

.