{"id":194987,"date":"2023-08-18T10:25:24","date_gmt":"2023-08-18T14:25:24","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=194987"},"modified":"2025-02-12T10:50:14","modified_gmt":"2025-02-12T15:50:14","slug":"r-nyholm-2018-rotated-nelson-siegel-model","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/","title":{"rendered":"R: Nyholm (2018) Rotated Nelson-Siegel Model"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>Excerpt<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This post implements R code to estimate the Rotated Nelson-Siegel yield curve model of Nyholm (2018).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-rotated-nelson-siegel-model\">Rotated Nelson-Siegel model<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Nyholm (2018) introduced the Rotated Dynamic Nelson-Siegel (RDNS) model with the intention of enhancing the interpretability of yield factors through a more conventional framework. The primary emphasis of this model centers on the short rate component.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the factor loading matrix is the key distinguishing difference between DNS and RDNS models, I opt for the period-by-period OLS estimation of the Rotated Nelson-Siegel model for simplicity, rather than the Rotated DNS model.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The well-known Nelson-Siegel (NS) model has the following form (B is the NS factor loading matrix).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"878\" height=\"165\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-1.png\" alt=\"\" class=\"wp-image-194991 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-1.png 878w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-1-700x132.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-1-300x56.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-1-768x144.png 768w\" data-sizes=\"(max-width: 878px) 100vw, 878px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 878px; aspect-ratio: 878\/165;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In order to rotate the NS factors from [Level, -Slope, Curvature] into [Short Rate, Slope, Curvature], the NS model is augmented with a rotation matrix, denoted by A, which is chosen in such a way that the desired factor-interpretation emerges, and such that&nbsp;I=A\u2212<sup>1<\/sup>A, where I is the identity matrix.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Absolutely, keep in mind that the slope factor is defined as the difference between the long-term and short-term components: slope = long-term &#8211; short-term.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"853\" height=\"193\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-2.png\" alt=\"\" class=\"wp-image-194994 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-2.png 853w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-2-700x158.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-2-300x68.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-2-768x174.png 768w\" data-sizes=\"(max-width: 853px) 100vw, 853px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 853px; aspect-ratio: 853\/193;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In sum, the rotation matrix&nbsp;<em>A<\/em>&nbsp;turns the <em>NS <\/em>yield factors into <em>RNS <\/em>yield factors as follows.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"849\" height=\"67\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-3.png\" alt=\"\" class=\"wp-image-194996 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-3.png 849w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-3-700x55.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-3-300x24.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-3-768x61.png 768w\" data-sizes=\"(max-width: 849px) 100vw, 849px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 849px; aspect-ratio: 849\/67;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Nyholm (2018) rotates the factor structure to enable direct parametrization of the short rate process.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"849\" height=\"396\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-4.png\" alt=\"\" class=\"wp-image-194998 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-4.png 849w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-4-700x327.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-4-300x140.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/R-Nyholm-shleeai-4-768x358.png 768w\" data-sizes=\"(max-width: 849px) 100vw, 849px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 849px; aspect-ratio: 849\/396;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Hence, the RDNS model shares identical statistical properties with the DNS model, rendering it observationally equivalent to the DNS model.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">NS and Rotated NS model<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The following R code estimates the NS and Rotated NS models by using the period-by-period OLS estimation.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#========================================================#\n# Quantitative ALM, Financial Econometrics &amp; Derivatives \n# ML\/DL using R, Python, Tensorflow by Sang-Heon Lee \n#\n# https:\/\/shleeai.blogspot.com\n#--------------------------------------------------------#\n# Nyholm (2018) Rotated Nelson-Siegel Model\n#========================================================#\n \ngraphics.off(); rm(list = ls())\n \nsetwd('D:\/SHLEE\/blog\/R\/Rotated_NS')\n \n# data is located in the following address\n# 'https:\/\/github.com\/Financial-Times\/yield-curve-sonification\/blob\/7d131970377380f118fb9a0e1626f5ed1ecd35ca\/yield-curve-monthly-data.csv'\n \nyield &lt;- as.matrix(read.csv('yield-curve-monthly-data.csv')[,-1])\nmat &lt;- c(1, 3, 6, 12,  24, 36, 60, 84, 120, 240, 360)\n \nvcol &lt;- c(\"darkgray\", \"blue\", \"hotpink\")\n \n#-----------------------------------------------------------\n# NS and Rotated NS models\n#-----------------------------------------------------------\n \n# Factor loading matrix\nNS_factor_loading &lt;-function(la, m) {\n    B &lt;- cbind(\n        rep(1,length(m)), \n        (1-exp(-la*m))\/(la*m), \n        (1-exp(-la*m))\/(la*m)-exp(-la*m))\n    return(B)\n}\nRNS_factor_loading  &lt;-function(la, m) {\n    \n    # short rate, conventional slope, curvature\n    A1 &lt;- c(1, 1, 0)\n    A2 &lt;- c(0,-1, 0)\n    A3 &lt;- c(0, 0, 1)\n    A &lt;- matrix(cbind(A1, A2, A3), 3, 3, byrow = TRUE)\n    G &lt;- NS_factor_loading(la, m)%*%solve(A)\n    return(G)\n}\n \n# fitted yield curve\nfit_NS  &lt;- function(beta, la, m)    { \n    return(NS_factor_loading(la, m)%*%beta) \n}\nfit_RNS  &lt;- function(gamma, la, m)    { \n    return(RNS_factor_loading(la, m)%*%gamma) \n}\n \n# RMSE\nrmse_NS &lt;- function(beta, la, y, m) { \n    return(sqrt(mean((y - fit_NS(beta, la, m))^2)))\n}\nrmse_RNS &lt;- function(gamma, la, y, m) { \n    return(sqrt(mean((y - fit_RNS(gamma, la, m))^2)))\n}\n \n# Cross-sectional OLS\nest_NS_ols &lt;- function(la, y, m) {\n    B    &lt;- NS_factor_loading(la, m)\n    beta &lt;- solve(t(B)%*%B)%*%t(B)%*%y; \n    rmse &lt;- rmse_NS(beta, la, y, m)\n    return(list(beta=beta, la=la, rmse=rmse))\n}\nest_RNS_ols &lt;- function(la, y, m) {\n    G    &lt;- RNS_factor_loading(la, m)\n    gamma &lt;- solve(t(G)%*%G)%*%t(G)%*%y; \n    rmse &lt;- rmse_RNS(gamma, la, y, m)\n    return(list(gamma=gamma, la=la, rmse=rmse))\n}\n \n# period-by-period OLS Estimation\nest_NS_ols_ts &lt;- function(la, y_all, m) {\n    nobs &lt;- nrow(y_all); nmat &lt;- length(m)\n    rmse &lt;- rep(NA,nobs)\n    beta &lt;- matrix(NA, nobs, 3)\n    \n    for(t in 1:nobs) {\n        lt &lt;- est_NS_ols(la,y_all[t,],m)\n        beta[t,] &lt;- lt$beta; rmse[t]  &lt;- lt$rmse\n    }\n    return(list(beta=beta, la=la, rmse=rmse))\n}\nest_RNS_ols_ts &lt;- function(la, y_all, m) {\n    nobs &lt;- nrow(y_all); nmat &lt;- length(m)\n    rmse &lt;- rep(NA,nobs)\n    gamma &lt;- matrix(NA, nobs, 3)\n \n    for(t in 1:nobs) {\n        lt &lt;- est_RNS_ols(la,y_all[t,],m)\n        gamma[t,] &lt;- lt$gamma; rmse[t]  &lt;- lt$rmse\n    }\n    return(list(gamma=gamma, la=la, rmse=rmse))\n}\n \n \n# Estimation\nout_NS  &lt;- est_NS_ols_ts (0.0609, yield, mat)\nout_RNS &lt;- est_RNS_ols_ts(0.0609, yield, mat)\n \n# plot\nx11(width = 16\/2, height = 9\/2.3)\nmatplot(out_NS$beta, type=\"l\", lty=1, lwd=4, col = vcol,\n        main = paste0(\"NS model : Avg. RMSE = \", \n                      round(mean(out_NS$rmse),4)))\nlegend(\"bottomright\", pch = 16, col = vcol, cex = 0.9,\n       bty = \"n\", legend=c(\"Level\",\"-Slope\",\"Curvature\"))\n \nx11(width = 16\/2, height = 9\/2.3)\nmatplot(out_RNS$gamma, type=\"l\", lty=1, lwd=4, col = vcol,\n        main = paste0(\"Rotated NS model : Avg. RMSE = \", \n                      round(mean(out_RNS$rmse),4)))\nlegend(\"bottomright\", pch = 16, col = vcol, cex = 0.9,\n       bty = \"n\", legend=c(\"Short Rate\",\"Slope\",\"Curvature\"))<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Visit <a href=\"https:\/\/shleeai.blogspot.com\/2023\/08\/r-code-nyholm-2018-rotated-nelson_13.html\">SHLee AI Financial Model<\/a> to read the full article.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post implements R code to estimate the Rotated Nelson-Siegel yield curve model of Nyholm (2018).<\/p>\n","protected":false},"author":662,"featured_media":195001,"comment_status":"open","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[339,343,338,341,342],"tags":[806,4922,15812,487,6591],"contributors-categories":[13728],"class_list":["post-194987","post","type-post","status-publish","format-standard","has-post-thumbnail","category-data-science","category-programing-languages","category-ibkr-quant-news","category-quant-development","category-r-development","tag-data-science","tag-econometrics","tag-nyholm-rotated-nelson-siegel-model","tag-r","tag-rstats","contributors-categories-sh-fintech-modeling"],"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v28.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>R: Nyholm (2018) Rotated Nelson-Siegel Model | IBKR Quant<\/title>\n<meta name=\"description\" content=\"This post implements R code to estimate the Rotated Nelson-Siegel yield curve model of Nyholm (2018).\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/194987\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"R: Nyholm (2018) Rotated Nelson-Siegel Model | IBKR Campus US\" \/>\n<meta property=\"og:description\" content=\"This post implements R code to estimate the Rotated Nelson-Siegel yield curve model of Nyholm (2018).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-18T14:25:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-12T15:50:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-splash-of-colors-background.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sang-Heon Lee\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sang-Heon Lee\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Sang-Heon Lee\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0a959ff9de7f0465a07baa1fe1ae0200\"\n\t            },\n\t            \"headline\": \"R: Nyholm (2018) Rotated Nelson-Siegel Model\",\n\t            \"datePublished\": \"2023-08-18T14:25:24+00:00\",\n\t            \"dateModified\": \"2025-02-12T15:50:14+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/\"\n\t            },\n\t            \"wordCount\": 271,\n\t            \"commentCount\": 0,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/r-splash-of-colors-background.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"Econometrics\",\n\t                \"Nyholm Rotated Nelson-Siegel Model\",\n\t                \"R\",\n\t                \"rstats\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Quant\",\n\t                \"Quant Development\",\n\t                \"R Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/\",\n\t            \"name\": \"R: Nyholm (2018) Rotated Nelson-Siegel Model | IBKR Campus US\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/r-splash-of-colors-background.jpg\",\n\t            \"datePublished\": \"2023-08-18T14:25:24+00:00\",\n\t            \"dateModified\": \"2025-02-12T15:50:14+00:00\",\n\t            \"description\": \"This post implements R code to estimate the Rotated Nelson-Siegel yield curve model of Nyholm (2018).\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/r-nyholm-2018-rotated-nelson-siegel-model\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/r-splash-of-colors-background.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/r-splash-of-colors-background.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Quant\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0a959ff9de7f0465a07baa1fe1ae0200\",\n\t            \"name\": \"Sang-Heon Lee\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/sang-heonlee\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"R: Nyholm (2018) Rotated Nelson-Siegel Model | IBKR Quant","description":"This post implements R code to estimate the Rotated Nelson-Siegel yield curve model of Nyholm (2018).","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/194987\/","og_locale":"en_US","og_type":"article","og_title":"R: Nyholm (2018) Rotated Nelson-Siegel Model | IBKR Campus US","og_description":"This post implements R code to estimate the Rotated Nelson-Siegel yield curve model of Nyholm (2018).","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/","og_site_name":"IBKR Campus US","article_published_time":"2023-08-18T14:25:24+00:00","article_modified_time":"2025-02-12T15:50:14+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-splash-of-colors-background.jpg","type":"image\/jpeg"}],"author":"Sang-Heon Lee","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sang-Heon Lee","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/"},"author":{"name":"Sang-Heon Lee","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0a959ff9de7f0465a07baa1fe1ae0200"},"headline":"R: Nyholm (2018) Rotated Nelson-Siegel Model","datePublished":"2023-08-18T14:25:24+00:00","dateModified":"2025-02-12T15:50:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/"},"wordCount":271,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-splash-of-colors-background.jpg","keywords":["Data Science","Econometrics","Nyholm Rotated Nelson-Siegel Model","R","rstats"],"articleSection":["Data Science","Programming Languages","Quant","Quant Development","R Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/","name":"R: Nyholm (2018) Rotated Nelson-Siegel Model | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-splash-of-colors-background.jpg","datePublished":"2023-08-18T14:25:24+00:00","dateModified":"2025-02-12T15:50:14+00:00","description":"This post implements R code to estimate the Rotated Nelson-Siegel yield curve model of Nyholm (2018).","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/r-nyholm-2018-rotated-nelson-siegel-model\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-splash-of-colors-background.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-splash-of-colors-background.jpg","width":1000,"height":563,"caption":"Quant"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0a959ff9de7f0465a07baa1fe1ae0200","name":"Sang-Heon Lee","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/sang-heonlee\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/08\/r-splash-of-colors-background.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/194987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/662"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=194987"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/194987\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/195001"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=194987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=194987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=194987"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=194987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}