Publications by Sang-Heon Lee
Yield to Maturity and Reinvestment Risk
This post shows how the reinvestment risk affect the holding period return of coupon bond using R code Coupon Bond and Reinvestment Risk using R code At first, we need to make a distinction between par yield and YTM (Yield to Maturity). Par Yield The par yield is the coupon rate of a par bond at an issuance. A par bond has a price su...
6746 sym 10 img 4 tbl
Benchmark Bond Portfolio Returns using R code
This post calculates the holding period returns of four benchmark zero coupon bonds portfolios such as bullet, barbell, ladder and buy-and-hold using R code Benchmark Bond Portfolio Strategies Bond portfolio strategies are too many to enumerate. But there are benchmark bond strategies which are frequently introduced to textbook. Among ...
6372 sym 8 img 1 tbl
Using R code in Java Eclipse with rJava
This post shows how to use R code in Eclipse IDE for Java with rJava package. But this work requires several environment setting which is a little bit confusing. Although there are some good posts regarding this issue, we use a step by step guide with detailed screen captures for clear understanding. Using R code in Java Eclipse with rJava O...
5046 sym 40 img 1 tbl
rJava with User-defined R Functions in Eclipse
This post shows how to call user-defined functions in R script from Eclipse Java with rJava package. This work will improve code readability and minimize the likelihood of errors in such a way that it reduces multiples lines of R codes. rJava with user-defined R functions We’ve learned how to insert R commands to Eclipse Java in the p...
4408 sym 10 img 6 tbl
Using NEOS Optimization Solver in R code
This post explains how to use ROI and ROI.plugin.neos packages in R code, which provide an interface to NEOS. NEOS (Network-Enabled Optimization System) Server is a free internet-based service for solving numerical optimization problems. For understanding how to use ROI package, we implement R code for portfolio optimization problem. NEOS...
5126 sym 6 img 6 tbl
ETF Tracking Error Minimization using R code
This post explains how to construct ETF tracking error (TE) minimization and introduce R packages which perform (sparse) index tracking. ETF (Exchange Traded Fund) is a traded fund listed on the exchange. ETF tries to mimic or follow a target benchmark index (BM) such as S&P500. This is called the tracking error (TE) minimization. ETF Tra...
8197 sym 8 img 3 tbl
Interest Rate Swap Pricing using R code
This post explains how to price an interest rate swap (IRS) using R code and Excel’s illustrations. We use swap rates, zero curve data from Bloomberg. We consider 5-Year Libor 3M IRS without OIS discounting as an pre-crisis IRS example. Libor Interest Rate Swap Pricing using R code Swap Pricing A fixed versus floating interest rate sw...
7745 sym 6 img 1 tbl
Delta Sensitivity of Interest Rate Swap
This post explains how to calculate delta sensitivities or delta vector of interest rate swap, especially delta. delta can be calculated by either 1) zero delta or 2) market delta. To the best of our knowledge, FRTB can use these two methods but SIMM use the market Greeks. We implement R code for two approaches Delta Sensitivity of LIBOR ...
6373 sym 12 img 1 tbl
RDCOMClient : read and write Excel, and call VBA macro in R
This post gives an short introduction to the RDCOMClient R package, which provides a variety of functionalities. Our focus is on reading from and writing to Excel, and call VBA macro function in R. Introduction Using RDCOMClient R package, we can read from and write to Excel spreadsheet, furthermore, call VBA macro function in R. Of cour...
2392 sym 6 img 2 tbl
RDCOMClient : A Simple Libor IRS Pricing with OIS Discounting
This post shows a simple example which uses the RDCOMClient R package. As an example, A Libor IRS pricing with OIS discounting is presented with the help of a VBA macro code from Mikael Katajamäki’s source with proper citation (this should be always). Introduction In the previous post, we have used the RDCOMClient R package for comm...
3472 sym 6 img 2 tbl