Publications by Sang-Heon Lee

Lasso Regression Model with R code

19.05.2021

Tibshirani (1996) introduces the so called LASSO (Least Absolute Shrinkage and Selection Operator) model for the selection and shrinkage of parameters. This model is very useful when we analyze big data. In this post, we learn how to set up the Lasso model and estimate it using glmnet R package. Tibshirani (1996) introduces the LASSO (Least ...

6471 sym 8 img 1 tbl

Sign Constrained Lasso with R code

19.05.2021

This post explains how to implement the sign constrained lasso with ridge, and linear regression model. The restrictions of expected sign is of great importance in the case when building an econometric model with meaningful interpretation. We can easily incorporate sign restrictions to the above regression models using glmnet R package. It ...

2133 sym 2 img 1 tbl

Review of IAIS DNS Shock Generating Algorithm Update

19.05.2021

This post reviews the update of IAIS DNS Shock Generating Algorithm of IAIS(2018, 2019). This update have some modificatoin which is related to the expression of conditional covariance. But this expression needs to be more refined in the mathematical manner. This post try to explain it. IAIS DNS Shock Generating Algorithm : update In previou...

4463 sym 9 tbl

Markowitz v.s. Michaud Portfolio Optimization with R code

22.05.2021

This post shows how to perform asset allocation based on the Markowitz’s mean-variance (MV) portfolio model which is the benchmark framework. This model is based on the diversification effect. Another alternative Michaud’s Resampled Efficiency (RE) portfolio model is also discussed. These two models are implemented using a quadratic optimiz...

4847 sym R (5719 sym/1 pcs) 6 img

Construction of SOFR Index from SOFR Rates

24.05.2021

This post replicates the construction process of the SOFR index from daily SOFR rates. Since this index is published in a daily basis officially, there is no need to make it. But in the process of pricing SOFR swaps and floating rate notes, this sort of calculation is needed. SOFR Rates and Index LIBOR will transition to an alternative re...

1751 sym

Smith-Wilson Extrapolation with R code

25.05.2021

This post explains how to implement the Smith-Wilson extrapolation by which deterministic DNS shock scenarios are generated. Smith-Wilson Extrapolation Deterministic DNS shock scenarios under ICS (K-ICS) are the term structure of annually compounding spot rates which spans from 1-month to 1440-month (120-year) or longer. This is used to dis...

5697 sym 2 img 2 tbl

Understanding Logistic Regression

27.05.2021

This post explains the logistic regression and implements R code for the estimation of its parameters. Logistic Regression Logistic Regression is a benchmark machine learning model. This model have a binary response variable (\(Y\)) which takes on 0 or 1. We can find lots of this kind of variables, among them are sucess/failure, bankrupcy/so...

5693 sym 2 img 1 tbl

Capitalization of Names using R code

12.06.2021

This post shows simple R trick for capitalization of names, which may have some delimiter. Problem Problem is to apply capitalization to names separated by punctuation mark (“.”). For example, “BABACAR.THIOMBANE” is to converted to “Babacar.Thiombane” as follows. 1234567891011–––––––––––––––�...

2151 sym 4 tbl

Coupon Bearing Bond Pricing using R code

13.06.2021

This post explains how to calculate the price of some complicated coupon bearing bond using R code. Pricing of Coupon Bond using R code There are pricing formula for coupon bond as well as discount bond which are used among practioners under the market convention. Bond Pricing Formula Discount Bond \[\begin{align} P = \fr...

4754 sym 6 img 2 tbl

Hull-White 1-factor model using R code

13.06.2021

This post explains how to simulate short rates, discount factors, future spot rates, and so on using the Hull-White 1 factor model with given calibrated parameters. We summarize important model blocks using previous post for clear understanding and finally implement them sequentially for simulation using R code. Hull-White 1-factor model u...

13899 sym 14 img 1 tbl