# Curve optimization to predict monetary policy path (OIS Curve)

This is a question about a relatively undeveloped market (Chile) in which Camara the O/N rate is daily compounded (OIS Curve).

The available instruments in the market are short term rates ie 1m 2m 3m 6m 9m 1y 18m and 2y where up to 2y these trade as ZC and the 2y as S/A, the meeting dates are known but there are no instruments similar to FF Futures in order to predict and calculate the probability of the cut/hike and the magnitude. Instead what is used is a manual process to try and match market rates in the liquid tenors (3m 6m 9m 1y 18m and 2y).

The rate changes in 25bps increments, but more often than not the market will not trade at the exact magnitude.

What would be the best approach to optimize (I assume excel "solver" is one) this type of problem. The idea is then to use these hike/cut assumption to create a scenario analysis and derive a correct ZC curve that take into account the intermeeting jumps as a "tradeable instrument"

The idea behind this is no different to the other currencies. I will just make up some data.

First assume a Curve that has constant overnight forward rates between the MPC policy effective dates. This curve has specified these dates as its nodes (control parameters):

from rateslib import Curve, IRS, dt, Solver  # Python package on PyPi

curve = Curve(
nodes={
dt(2023, 9, 13): 1.0,
dt(2023, 9, 28): 1.0,
dt(2023, 11, 15): 1.0,
dt(2023, 12, 28): 1.0,
dt(2024, 2, 15): 1.0,
dt(2024, 4, 15): 1.0,
dt(2024, 8, 25): 1.0,
dt(2024, 11, 15): 1.0,
},
convention="act360",
)


The next task is to use an optimization routine with available calibrating instruments. This can be quite general, in this instance these instruments are carefully chosen to provide, mathematically, enough information to the Solver to uniquely determine the Curve parameters (I have simply used the config for SOFR swaps here for convenience):

solver = Solver(
curves=[curve],
instruments=[
IRS(dt(2023, 9, 13), "1M", spec="usd_irs", curves=curve),
IRS(dt(2023, 9, 13), "2M", spec="usd_irs", curves=curve),
IRS(dt(2023, 9, 13), "3M", spec="usd_irs", curves=curve),
IRS(dt(2023, 9, 13), "6M", spec="usd_irs", curves=curve),
IRS(dt(2023, 9, 13), "9M", spec="usd_irs", curves=curve),
IRS(dt(2023, 9, 13), "12M", spec="usd_irs", curves=curve),
IRS(dt(2023, 9, 13), "15M", spec="usd_irs", curves=curve),
],
s=[4.8, 4.9, 4.95, 4.75, 4.47, 4.3, 4.1]
)
SUCCESS: func_tol reached after 3 iterations (levenberg_marquardt) , f_val: 1.4657340193432848e-13, time: 0.0299s


If you do this in excel you can use the global solver provided you setup all of the data structures and formulae to derive swap rates from the discount factors on the curve you create. Its not that much harder than this here, but this is essentially 3 or 4 lines of Python code versus creating a whole spreadsheet from scratch and using a really slow Excel solver.

The solved curve will show you the expected jumps. Sometimes there is a difference between the policy rate and the OIS rate so a comparison with a shifted curve will show the policy rate path more clearly. Here it is assumed for example purposes that the policy rate is 6bps higher than the OIS.

curve.plot("1b", comparators=[curve.shift(6)])