<commit_before>---
title: Solving the problem
excerpt: "Post-2007 curve solving"
category: "gav"
header:
  overlay_image: solvingtheproblem/header.jpg
  overlay_filter: rgba(50, 50, 50, 0.5)
  teaser: solvingtheproblem/teaser.jpg
tags: [fx, ir, solving]
---

If you haven't read it already it might be worth reading [why](/gav/It-all-started-in-2007/) we need to solve this problem.

# The problem

The problem we need to solve is to find a set of curves which reprice a set of market-quoted instruments, which means they all price to a PV of
zero - the market price is seen as "fair" value and as such neither buyer nor seller would make or lose money when trading at that price.

The curves themselves are just wrapped interpolators where the x-axis is time (usually expressed as a year fraction under
a specified day-count convention), the y-axis is some measure of interest rate and the type of interpolation is also a free choice.
As we will use a rate converter to facilitate any requests for discount factors or rates of different types
from the curves, we are relatively agnostic to exactly what specification is chosen here so we will use log-linear 
interpolation in discount factor space. 

So we have a set of inputs, each of which serves as a constraint in our solving.
And we have a set of outputs - the values we want to solve for at points along each curve.
For our example, we will stick to the case of the number of inputs/constraints being exactly equal to the number of outputs, so it makes sense to assign one point on a curve to each input instrument.  A sensible choice for this is to use the expiry/maturity date of the instrument for this purpose.<commit_msg>Switching the title<commit_after>---
title: Solving the Post 2007 Crisis Rates Curve
excerpt: "Part 2 of the intro to rates curves"
category: "gav"
header:
  overlay_image: solvingtheproblem/header.jpg
  overlay_filter: rgba(50, 50, 50, 0.5)
  teaser: solvingtheproblem/teaser.jpg
tags: [fx, ir, solving]
---

If you haven't read it already it might be worth reading [why](/gav/It-all-started-in-2007/) we need to solve this problem.

# The problem

The problem we need to solve is to find a set of curves which reprice a set of market-quoted instruments, which means they all price to a PV of
zero - the market price is seen as "fair" value and as such neither buyer nor seller would make or lose money when trading at that price.

The curves themselves are just wrapped interpolators where the x-axis is time (usually expressed as a year fraction under
a specified day-count convention), the y-axis is some measure of interest rate and the type of interpolation is also a free choice.
As we will use a rate converter to facilitate any requests for discount factors or rates of different types
from the curves, we are relatively agnostic to exactly what specification is chosen here so we will use log-linear 
interpolation in discount factor space. 

So we have a set of inputs, each of which serves as a constraint in our solving.
And we have a set of outputs - the values we want to solve for at points along each curve.
For our example, we will stick to the case of the number of inputs/constraints being exactly equal to the number of outputs, so it makes sense to assign one point on a curve to each input instrument.  A sensible choice for this is to use the expiry/maturity date of the instrument for this purpose.
{'fraction_non_alphanumeric': 0.04432051658350455, 'fraction_numerical': 0.00968594071030232, 'mean_word_length': 4.124812030075188, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1449697', 'n_tokens_mistral': 917, 'n_tokens_neox': 854, 'n_words': 558}