
P1: JYS
c05 JWBK378-Fletcher May 12, 2009 16:54 Printer: Yet to come
5
Market: Curves and Surfaces
A financial market is made up out of lots of pieces of information. For example, foreign
exchange rates, equity spot prices, yield curves, volatility surfaces and correlation surfaces,
to name a few. In this chapter we discuss simple classes for representing curves and surfaces
provided in the ppf.market subpackage. The chapter is concluded with a discussion of the
market environment which is designed to represent a financial market.
5.1 CURVES
Fundamentally, without regard to the specific market variable being modelled (e.g. discount
factors, forward rates, volatilities at a fixed strike and expiry for a range of tenors), a curve is
the association between a set of points at which the function is known (abscissae), the known
function values at those points (ordinates) and an interpolation algorithm for estimating the
value of the function between the known abscissae. Utilisation of the interpolation algorithms
presented in section 4.3 deals with the ‘heavy lifting’ of curve representation. From the
ppf.market.curve module we have the simple curve
class curve:
def
init (self, times, factors, interp):
self.
impl = interp(times, factors)
def
call (self, t): return self. impl(t)
The following interpreter transcript (simulating a discount factor curve) shows how easily
a curve can be modelled by these components: ...