0

I am trying to solve a linear programming problem. My goal is to minimize the interest rate risk of a given bond at various parts of the interest rate curve, using Tsy futures. fut_dur = the total risk of 5 different Tsy futures, fut_krd = the partial risks across 9 points on the rate curve for the Tsy futures, index_krd = the partial risks across the 9 points that I would like to be neutralized with futures.

What I am trying to do is solve for the amount of futures (fut_dur) to sell in order to get each point within index_krd close to or equal to zero, and for the total product of fut_dur to equal index_krd (which is 3.029)

fut_dur <- c(4.28,1.86,6.32,12.2,18.7)
fut_krd <- 
   matrix(c(0,0,.01,.01,0,0,.25,.02,.03,.02,.01,1.61,.04,.07,.05,1.49,0,.1,.16,.12,2.78,0,.9,.32,.24,0,0, 
         5.25,.57,.42,0,0,0,1.23,.9,0,0,0,7.68,1.42,0,0,0,2.08,15.49),nrow = 9,byrow = TRUE)

index_krd <- c(.09576,.22796,.28565,.27707,.29751,.39966,.38434,.53814,.523)

rate_hedge <-lp("min",fut_dur,rbind(fut_krd,fut_dur),c(rep(">=",9),"="),rbind(index_krd,sum(index_krd)))

I just get five 0s when I solve this problem.

thank you so much in advance for the help!

MLavoie
  • 9,671
  • 41
  • 36
  • 56

0 Answers0