{"id":183892,"date":"2023-01-12T15:04:00","date_gmt":"2023-01-12T20:04:00","guid":{"rendered":"https:\/\/ibkrcampus.com\/traders-insight\/exclusive-lasso-and-group-lasso-using-r-code\/"},"modified":"2024-08-13T16:05:23","modified_gmt":"2024-08-13T20:05:23","slug":"exclusive-lasso-and-group-lasso-using-r-code","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/","title":{"rendered":"Exclusive Lasso and Group Lasso Using R code"},"content":{"rendered":"\n<p>This post shows how to use the R packages for estimating an exclusive lasso and a group lasso. These lasso variants have a given grouping order in common but differ in how this grouping constraint is functioning when a variable selection is performed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Lasso, Group Lasso, and Exclusive Lasso<\/h3>\n\n\n\n<p>While LASSO (least absolute shrinkage and selection operator) has many variants and extensions, our focus is on two lasso models:&nbsp;<strong>Group Lasso<\/strong>&nbsp;and&nbsp;<strong>Exclusive Lasso<\/strong>. Before we dive into the specifics, let&#8217;s go over the similarities and differences of these two lasso variants from the following figure.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/illustrative_variables-sh-fintech.png\" alt=\" class=\" class=\"wp-image-173065 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/figure>\n\n\n\n<p>In the above figure, 15 variables are categorized into four groups. Lasso selects important features irrespective of the grouping. Of course, lasso did not select Group 2 and 4&#8217;s variables but it is not intended but just an estimation result.&nbsp;<strong>While group lasso selects all or none in specific group, exclusive lasso selects at least one variable in each group<\/strong>.<\/p>\n\n\n\n<p><strong>From a perspective of competition, group lasso implements a completion across groups and on the contrary, exclusive lasso makes variables in the same group compete with each other within each group.<\/strong><\/p>\n\n\n\n<p>Since we can grasp the main characteristics of two lasso modes from the above figure, let&#8217;s turn to the mathematical expressions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Equations<\/h3>\n\n\n\n<p>There are some various expressions for these models and the next equations are for lasso, group lasso, and exclusive Lasso following Qiu&nbsp;<em>et al<\/em>. (2021).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/lasso-r-sh-fintech.png\" alt=\" class=\" class=\"wp-image-173066 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/figure>\n\n\n\n<p>where the coefficient in&nbsp;<em>\u03b2<\/em>&nbsp;are divided into&nbsp;<em>G<\/em>&nbsp;groups and&nbsp;<em>\u03b2<sub>g<\/sub><\/em>&nbsp;denotes the coefficient vector of the&nbsp;<em>g-<\/em>th group.<\/p>\n\n\n\n<p>In the group lasso,&nbsp;<em>l<sub>2,1<\/sub><\/em>-norm consists of the intra-group non-sparsity via&nbsp;<em>l<sub>2<\/sub><\/em>-norm and inter-group sparsity via&nbsp;<em>l<sub>1<\/sub><\/em>-norm. Therefore, variables of each group will be either selected or discarded entirely. Refer to Yuan and Lin (2006) for more information on the group lasso.<\/p>\n\n\n\n<p>In exclusive lasso,&nbsp;<em>l<sub>1,2<\/sub><\/em>-norm consists of the intra-group sparsity via&nbsp;l<sub>1<\/sub>-norm and inter-group non-sparsity via&nbsp;<em>l<sub>2<\/sub><\/em>-norm. Exclusive lasso selects at least one variable from each group. Refer to Zhou&nbsp;<em>et al<\/em>. (2010) for more information on the exclusive lasso.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">R code<\/h3>\n\n\n\n<p>The following R code implements lasso, group lasso, and exclusive lasso for an artificial data set with a given group index. Required R packages are&nbsp;<strong>glmnet<\/strong>&nbsp;for lasso,&nbsp;<strong>gglasso<\/strong>&nbsp;for group lasso, and&nbsp;<strong>ExclusiveLasso<\/strong>&nbsp;for exclusive lasso.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#========================================================#\n# Quantitative ALM, Financial Econometrics &amp; Derivatives \n# ML\/DL using R, Python, Tensorflow by Sang-Heon Lee \n#\n# https:\/\/kiandlee.blogspot.com\n#--------------------------------------------------------#\n# Group Lasso and Exclusive Lasso\n#========================================================#\n \nlibrary(glmnet)\nlibrary(gglasso)\nlibrary(ExclusiveLasso)\n \ngraphics.off()  # clear all graphs\nrm(list = ls()) # remove all files from your workspace\n \nset.seed(1234)\n \n#--------------------------------------------\n# X and y variable\n#--------------------------------------------\n \nN = 500 # number of observations\np = 20  # number of variables\n \n# random generated X\nX = matrix(rnorm(N*p), ncol=p)\n \n# standardization : mean = 0, std=1\nX = scale(X)\n \n# artificial coefficients\nbeta = c(0.15,-0.33,0.25,-0.25,0.05,0,0,0,0.5,0.2,\n        -0.25, 0.12,-0.125,0,0,0,0,0,0,0)\n \n# Y variable, standardized Y\ny = X%*%beta + rnorm(N, sd=0.5)\n#y = scale(y)\n \n# group index for X variables\nv.group &lt;- c(1,1,1,1,1,2,2,2,2,2,\n             3,3,3,3,3,4,4,4,4,4)\n \n#--------------------------------------------\n# Model with a given lambda\n#--------------------------------------------\n \n# lasso\nla &lt;- glmnet(X, y, lambda = 0.1,\n             family=\"gaussian\", alpha=1,\n             intercept = F) \n# group lasso\ngr &lt;- gglasso(X, y, lambda = 0.2,\n             group = v.group, loss=\"ls\",\n             intercept = F)\n# exclusive lasso\nex &lt;- exclusive_lasso(X, y,lambda = 0.2, \n             groups = v.group, family=\"gaussian\", \n             intercept = F) \n# Results\ndf.comp &lt;- data.frame(\n    group = v.group, beta = beta,\n    Lasso     = la$beta&#91;,1],\n    Group     = gr$beta&#91;,1],\n    Exclusive = ex$coef&#91;,1]\n)\ndf.comp\n \n#------------------------------------------------\n# Run cross-validation &amp; select lambda\n#------------------------------------------------\n# lambda.min : minimal MSE\n# lambda.1se : the largest \u03bb at which the MSE is \n#   within one standard error of the minimal MSE.\n \n# lasso\nla_cv &lt;- cv.glmnet(x=X, y=y, family='gaussian',\n            alpha=1, intercept = F, nfolds=5)\nx11(); plot(la_cv)\npaste(la_cv$lambda.min, la_cv$lambda.1se)\n \n# group lasso\ngr_cv &lt;- cv.gglasso(x=X, y=y, group=v.group, \n            loss=\"ls\", pred.loss=\"L2\", \n            intercept = F, nfolds=5)\nx11(); plot(gr_cv)\npaste(gr_cv$lambda.min, gr_cv$lambda.1se)\n \n# exclusive lasso\nex_cv &lt;- cv.exclusive_lasso(\n            X, y, groups = v.group,\n            intercept = F, nfolds=5)\nx11(); plot(ex_cv)\npaste(ex_cv$lambda.min, ex_cv$lambda.1se)\n \n \n#--------------------------------------------\n# Model with selected lambda\n#--------------------------------------------\n \n# lasso\nla &lt;- glmnet(X, y, lambda = la_cv$lambda.1se,\n             family=\"gaussian\", alpha=1,\n             intercept = F) \n# group lasso\ngr &lt;- gglasso(X, y, lambda = gr_cv$lambda.1se+0.1,\n             group = v.group, loss=\"ls\",\n             intercept = F)\n# exclusive lasso\nex &lt;- exclusive_lasso(X, y,lambda = ex_cv$lambda.1se, \n             groups = v.group, family=\"gaussian\", \n             intercept = F) \n# Results\ndf.comp.lambda.1se &lt;- data.frame(\n    group = v.group, beta = beta,\n    Lasso     = la$beta&#91;,1],\n    Group     = gr$beta&#91;,1],\n    Exclusive = ex$coef&#91;,1]\n)\ndf.comp.lambda.1se<\/code><\/pre>\n\n\n\n<p>The first output from the above R code is the table of coefficients of all models with given each initial&nbsp;\u03bb&nbsp;parameter. We can easily find the model-specific pattern of each model. I add horizontal dotted lines for separating each group just for exposition purpose.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt; df.comp\n\n    group   beta       Lasso        Group    Exclusive\nV1      1  0.150  0.01931728  0.016938769  0.013555753\nV2      1 -0.330 -0.18832916 -0.047695924 -0.184065967\nV3      1  0.250  0.17261562  0.042254702  0.169516525\nV4      1 -0.250 -0.16322025 -0.043994211 -0.153730137\nV5      1  0.050  0.00000000  0.009673207  0.000000000\n--------------------------------------------------------\nV6      2  0.000  0.00000000  0.001067915  0.000000000\nV7      2  0.000  0.00000000  0.001355834  0.000000000\nV8      2  0.000  0.00000000  0.014211932  0.000000000\nV9      2  0.500  0.38757370  0.101900169  0.385382905\nV10     2  0.200  0.11146785  0.044591933  0.110731304\n--------------------------------------------------------\nV11     3 -0.250 -0.15010738  0.000000000 -0.186626541\nV12     3  0.120  0.00000000  0.000000000  0.003117881\nV13     3 -0.125 -0.08305582  0.000000000 -0.120458426\nV14     3  0.000  0.00000000  0.000000000  0.000000000\nV15     3  0.000  0.00000000  0.000000000  0.000000000\n--------------------------------------------------------\nV16     4  0.000  0.00000000  0.000000000  0.000000000\nV17     4  0.000  0.00000000  0.000000000  0.000000000\nV18     4  0.000  0.00000000  0.000000000  0.010918904\nV19     4  0.000  0.00000000  0.000000000  0.015330520\nV20     4  0.000  0.00000000  0.000000000  0.013591628<\/code><\/pre>\n\n\n\n<p>The second output is the table of coefficients of all models with each selected lambda which is a result of cross validation. I add horizontal dotted lines for separating each group just for exposition purpose.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt; df.comp.lambda.1se\n\n    group   beta       Lasso         Group   Exclusive\nV1      1  0.150  0.07776181  4.779605e-02  0.08297141\nV2      1 -0.330 -0.24670209 -1.257863e-01 -0.25235238\nV3      1  0.250  0.22825029  1.130749e-01  0.23282822\nV4      1 -0.250 -0.21384666 -1.168170e-01 -0.21582154\nV5      1  0.050  0.03733144  2.717197e-02  0.04139150\n-------------------------------------------------------\nV6      2  0.000  0.00000000  2.184575e-03  0.00000000\nV7      2  0.000  0.00000000  3.353260e-03  0.00000000\nV8      2  0.000  0.01031027  2.950791e-02  0.02043597\nV9      2  0.500  0.43538564  2.200230e-01  0.44419164\nV10     2  0.200  0.16649806  9.620757e-02  0.17844727\n-------------------------------------------------------\nV11     3 -0.250 -0.20316169 -1.886308e-02 -0.22419384\nV12     3  0.120  0.03113405  4.430739e-03  0.05392923\nV13     3 -0.125 -0.13474237 -1.468172e-02 -0.15506193\nV14     3  0.000  0.00000000 -3.646683e-05  0.00000000\nV15     3  0.000  0.00000000 -1.311539e-03  0.00000000\n-------------------------------------------------------\nV16     4  0.000  0.00000000  0.000000e+00  0.00000000\nV17     4  0.000  0.00000000  0.000000e+00 -0.01087451\nV18     4  0.000  0.00000000  0.000000e+00  0.00000000\nV19     4  0.000  0.00000000  0.000000e+00  0.01946948\nV20     4  0.000  0.00000000  0.000000e+00  0.01318269<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">An Interesting Property of Exclusive Lasso<\/h3>\n\n\n\n<p>As stated earlier, the exclusive lasso selects at least one variable from each group. Let&#8217;s check if this argument holds true with the next R code by&nbsp;<strong>setting&nbsp;\u03bb&nbsp;to a higher value (100), which prevents from selecting variables<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># lasso\nla &lt;- glmnet(X, y, lambda = 100,\n             family=\"gaussian\", alpha=1,\n             intercept = F) \n# group lasso\ngr &lt;- gglasso(X, y, lambda = 100,\n             group = v.group, loss=\"ls\",\n             intercept = F)\n# exclusive lasso\nex &lt;- exclusive_lasso(X, y,lambda = 100, \n             groups = v.group, family=\"gaussian\", \n             intercept = F) <\/code><\/pre>\n\n\n\n<p>The following result is sufficient for supporting the above explanation.&nbsp;<strong>While lasso and group lasso discard all variables with a higher&nbsp;\u03bb, exclusive lasso select one variable from each group.<\/strong>&nbsp;I add horizontal dotted lines for separating each group just for exposition purpose.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt; df.comp.higher.lambda\n\n    group   beta Lasso Group     Exclusive\nV1      1  0.150     0     0  0.0000000000\nV2      1 -0.330     0     0 -0.0031930017\nV3      1  0.250     0     0  0.0000000000\nV4      1 -0.250     0     0  0.0000000000\nV5      1  0.050     0     0  0.0000000000\n-------------------------------------------\nV6      2  0.000     0     0  0.0000000000\nV7      2  0.000     0     0  0.0000000000\nV8      2  0.000     0     0  0.0000000000\nV9      2  0.500     0     0  0.0051059151\nV10     2  0.200     0     0  0.0000000000\n-------------------------------------------\nV11     3 -0.250     0     0 -0.0026019669\nV12     3  0.120     0     0  0.0000000000\nV13     3 -0.125     0     0  0.0000000000\nV14     3  0.000     0     0  0.0000000000\nV15     3  0.000     0     0  0.0000000000\n-------------------------------------------\nV16     4  0.000     0     0  0.0000000000\nV17     4  0.000     0     0  0.0000000000\nV18     4  0.000     0     0  0.0006854416\nV19     4  0.000     0     0  0.0000000000\nV20     4  0.000     0     0  0.0000000000<\/code><\/pre>\n\n\n\n<p>This is interesting and may be useful when we want to&nbsp;<strong>select one security in each sector when forming a diversified asset portfolio with many investment sectors<\/strong>. Of course, a further analysis is necessary to select arbitrary predetermined number of securities from each sector.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Concluding Remarks<\/h3>\n\n\n\n<p>This post shows how to use group lasso and exclusive lasso using R code. In particular, I think that the exclusive lasso delivers some interesting result which will be investigated furthermore in following research such as sector-based asset allocation (sectoral diversification).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Reference<\/h3>\n\n\n\n<p>Yuan, M. and L. Lin (2006), Model Selection and Estimation in Regression with Grouped Variables,&nbsp;<em>Journal of the Royal Statistical Society<\/em>, Series B 68, pp. 49\u201367.<\/p>\n\n\n\n<p>Zhou, Y., R. Jin, and S. Hoi (2010), Exclusive Lasso for Multi-task Feature Selection.&nbsp;<em>In International Conference on Artificial Intelligence and Statistics<\/em>, pp. 988-995.<\/p>\n\n\n\n<p>Qiu, L., Y. Qu, C. Shang, L. Yang, F. Chao, and Q. Shen (2021), Exclusive Lasso-Based k-Nearest Neighbors Classification.&nbsp;<em>Neural Computing and Applications<\/em>, pp. 1-15.&nbsp;<\/p>\n\n\n\n<p><em>Visit <a href=\"https:\/\/kiandlee.blogspot.com\/2021\/10\/exclusive-lasso-and-group-lasso-using-r.html\">SH Fintech Modeling<\/a> to learn more about this topic.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post shows how to use the R packages for estimating an exclusive lasso and a group lasso.<\/p>\n","protected":false},"author":662,"featured_media":183071,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,338,350,341,344,342],"tags":[4922,14409,14410,14411,14412,14413,6808,487,6591],"contributors-categories":[13728],"class_list":{"0":"post-183892","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-ibkr-quant-news","10":"category-quant-asia-pacific","11":"category-quant-development","12":"category-quant-regions","13":"category-r-development","14":"tag-econometrics","15":"tag-exclusive-lasso","16":"tag-exclusivelasso","17":"tag-gglasso","18":"tag-glmnet","19":"tag-group-lasso","20":"tag-lasso","21":"tag-r","22":"tag-rstats","23":"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 v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Exclusive Lasso and Group Lasso Using R code | IBKR Quant<\/title>\n<meta name=\"description\" content=\"This post shows how to use the R packages for estimating an exclusive lasso and a group lasso.\" \/>\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\/183892\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exclusive Lasso and Group Lasso Using R code\" \/>\n<meta property=\"og:description\" content=\"This post shows how to use the R packages for estimating an exclusive lasso and a group lasso.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-12T20:04:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-13T20:05:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/digital-cube-numbers.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\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:title\" content=\"Exclusive Lasso and Group Lasso Using R code\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sang-Heon Lee\" \/>\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\\\/exclusive-lasso-and-group-lasso-using-r-code\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/exclusive-lasso-and-group-lasso-using-r-code\\\/\"\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\": \"Exclusive Lasso and Group Lasso Using R code\",\n\t            \"datePublished\": \"2023-01-12T20:04:00+00:00\",\n\t            \"dateModified\": \"2024-08-13T20:05:23+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/exclusive-lasso-and-group-lasso-using-r-code\\\/\"\n\t            },\n\t            \"wordCount\": 755,\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\\\/exclusive-lasso-and-group-lasso-using-r-code\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/digital-cube-numbers.jpg\",\n\t            \"keywords\": [\n\t                \"Econometrics\",\n\t                \"Exclusive Lasso\",\n\t                \"ExclusiveLasso\",\n\t                \"gglasso\",\n\t                \"glmnet\",\n\t                \"Group Lasso\",\n\t                \"Lasso\",\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 Asia Pacific\",\n\t                \"Quant Development\",\n\t                \"Quant Regions\",\n\t                \"R Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/exclusive-lasso-and-group-lasso-using-r-code\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/exclusive-lasso-and-group-lasso-using-r-code\\\/\",\n\t            \"name\": \"Exclusive Lasso and Group Lasso Using R code\",\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\\\/exclusive-lasso-and-group-lasso-using-r-code\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/exclusive-lasso-and-group-lasso-using-r-code\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/digital-cube-numbers.jpg\",\n\t            \"datePublished\": \"2023-01-12T20:04:00+00:00\",\n\t            \"dateModified\": \"2024-08-13T20:05:23+00:00\",\n\t            \"description\": \"This post shows how to use the R packages for estimating an exclusive lasso and a group lasso.\",\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\\\/exclusive-lasso-and-group-lasso-using-r-code\\\/\"\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\\\/exclusive-lasso-and-group-lasso-using-r-code\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/digital-cube-numbers.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/digital-cube-numbers.jpg\",\n\t            \"width\": 900,\n\t            \"height\": 550,\n\t            \"caption\": \"Algorithmic Trading in India: Resources, Regulations, and Future \u2013 Part II\"\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":"Exclusive Lasso and Group Lasso Using R code | IBKR Quant","description":"This post shows how to use the R packages for estimating an exclusive lasso and a group lasso.","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\/183892\/","og_locale":"en_US","og_type":"article","og_title":"Exclusive Lasso and Group Lasso Using R code","og_description":"This post shows how to use the R packages for estimating an exclusive lasso and a group lasso.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/","og_site_name":"IBKR Campus US","article_published_time":"2023-01-12T20:04:00+00:00","article_modified_time":"2024-08-13T20:05:23+00:00","og_image":[{"width":900,"height":550,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/digital-cube-numbers.jpg","type":"image\/jpeg"}],"author":"Sang-Heon Lee","twitter_card":"summary_large_image","twitter_title":"Exclusive Lasso and Group Lasso Using R code","twitter_misc":{"Written by":"Sang-Heon Lee"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/"},"author":{"name":"Sang-Heon Lee","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0a959ff9de7f0465a07baa1fe1ae0200"},"headline":"Exclusive Lasso and Group Lasso Using R code","datePublished":"2023-01-12T20:04:00+00:00","dateModified":"2024-08-13T20:05:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/"},"wordCount":755,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/digital-cube-numbers.jpg","keywords":["Econometrics","Exclusive Lasso","ExclusiveLasso","gglasso","glmnet","Group Lasso","Lasso","R","rstats"],"articleSection":["Data Science","Programming Languages","Quant","Quant Asia Pacific","Quant Development","Quant Regions","R Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/","name":"Exclusive Lasso and Group Lasso Using R code","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/digital-cube-numbers.jpg","datePublished":"2023-01-12T20:04:00+00:00","dateModified":"2024-08-13T20:05:23+00:00","description":"This post shows how to use the R packages for estimating an exclusive lasso and a group lasso.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/exclusive-lasso-and-group-lasso-using-r-code\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/digital-cube-numbers.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/digital-cube-numbers.jpg","width":900,"height":550,"caption":"Algorithmic Trading in India: Resources, Regulations, and Future \u2013 Part II"},{"@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\/02\/digital-cube-numbers.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/183892","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=183892"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/183892\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/183071"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=183892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=183892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=183892"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=183892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}