Publications by Sang-Heon Lee

Bayesian Estimation by using rjags Package

09.04.2022

This post shows how to use rjags R package to perform Bayesian MCMC estimation. As an example, we select a multiple linear regression but rjags can handle lots of highly non-linear models so that it can be extended to various modelings including hierarchical models. Bayesian Estimation by using rjags Package This post will use rjags R...

3350 sym 6 img 3 tbl

Bayesian Estimation of Nelson-Siegel model using rjags R package

12.04.2022

This post shows how to use rjags R package to estimate Nelson-Siegel yield curve model based using a Bayesian MCMC in a compact way. Nelson-Siegel model and rjags R package We installed and used rjags R package and performed a Bayesian estimation of multiple linear regression as an example in the previous post below. Bayesian Estim...

3841 sym 8 img 1 tbl

Forecasting Yield Curves using Dynamic Nelson-Siegel model with R code

22.04.2022

This post explains how to forecast yield curves using Dynamic Nelson-Siegel model given information of estimated parameters. Forecasting of Dynamic Nelson-Siegel model We estimated parameters of dynamic Nelson-Seigel model in the previous post below. Dynamic Nelson-Siegel model with R code Using estimated parameters in the ...

2513 sym 6 img 1 tbl

Carry and Roll-Down on a Yield Curve using R code

03.05.2022

This post shows how to calculate a carry and roll-down on a yield curve using R. In the fixed income, the carry is a current YTM like a dividend yield in stock. But unlike stocks, even though market conditions remain constant over time, the remaining maturity (life) is bound to decrease due to its maturity date. This makes so called the rol...

3042 sym 6 img 2 tbl

Key Rate Duration using R code

06.05.2022

This post explains how to calculate the key rate durations (KRD). Ho (1992) introduces KRD to measure non-parallel movements of the yield curve that the existing duration measures can not describe as these are defined under the assumption of a parallel shift of the yield curve. Key Rate Duration using R code Ho (1992) introduced the con...

5074 sym 6 img 1 tbl

IRRBB Interest Rate Shock Scenarios using R code

14.05.2022

This post explains how to calculate the IRRBB interest rate shock scenarios of BCBS(2016) prior to discussing change in economic value of equity (∆EVE) and net interest income (∆NII). IRRBB Interest Rate Shock Scenarios IRRBB refers to the current or prospective risk to a bank’s capital and to its earnings, arising from the im...

4244 sym 10 img 2 tbl

Non-linear Optimization of Nelson-Siegel model using nloptr R package

21.05.2022

This post shows how to use nloptr R package to solve non-linear optimization problem with or without equality or inequality constraints. Nelson-Siegel yield curve model is used as an target example. Nelson-Siegel model using nloptr R package In this post, the non-linear least squares problem is solved by using nloptr R package. As...

3789 sym 4 img 3 tbl

Non-linear Optimization by using constrOptim.nl R function

31.05.2022

This post shows how to use constrOptim.nl() R function to solve non-linear optimization problem with or without equality or inequality constraints. Nelson-Siegel yield curve model is used as an target example. Its calculation time is faster than nloptr() function. Nelson-Siegel model using constrOptim.nl() R function In this post, t...

3404 sym 4 img 2 tbl

Understanding PCA 3 Factors of the Yield Curve using R code

31.05.2022

This post explains how to decompose a movement of bond yields into 3 factors (level, slope, curvature) which is the work of Litterman and Scheinkman (1991). Using R functions for the principal component analysis and eigen decomposition, we can understand the contributions of these factors. PCA 3 Factors of the Yield Curve Litterman...

5489 sym 6 img 1 tbl

Loan Amortization Schedule using R code

09.06.2022

This post explains and implements major three types of loan amortization or repayment schedule using R code: 1) bullet or balloon payment, 2) equal total payment, and 3) equal principal payment. Loan Amortization or Repayment Schedule There are many types of loan amortization or repayment and among them we deal with popular three ca...

4343 sym 8 img 3 tbl