{"id":1859,"date":"2021-01-05T12:59:36","date_gmt":"2021-01-05T12:59:36","guid":{"rendered":"https:\/\/ricovictor.com\/?p=1859"},"modified":"2021-01-08T15:56:11","modified_gmt":"2021-01-08T15:56:11","slug":"teoria-de-markowitz-en-r-cartera-tangencial","status":"publish","type":"post","link":"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/","title":{"rendered":"Teor\u00eda de Markowitz en R : Cartera Tangencial"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1859\" class=\"elementor elementor-1859\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-6c60f2f4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"6c60f2f4\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-wide\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-6e70e855\" data-id=\"6e70e855\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-19f0a255 elementor-widget elementor-widget-text-editor\" data-id=\"19f0a255\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Dentro de la Teor\u00eda Moderna de Carteras de H.Markowitz hay varios tipos de portafolios que podemos crear. De uno de ellos ya habl\u00e9 en el post anterior donde expliqu\u00e9 el porftolio de <a href=\"https:\/\/ricovictor.com\/index.php\/2020\/12\/28\/teoria-de-carteras-de-markowitz-en-r-media-varianza\/\"><strong>Media-Varianza<\/strong><\/a> .<\/p><p>Otro tipo es el llamado <strong>Tangencial<\/strong>, cuyo objetivo es encontrar aquella combinaci\u00f3n de activos y pesos que maximiza el ratio de Sharpe. En este v\u00eddeo tienes un ejemplo en R usando pares de divisas. M\u00e1s abajo tienes el c\u00f3digo usado para copiarlo si lo deseas.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-4f65dd3e\" data-id=\"4f65dd3e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-601d12d5 elementor-widget elementor-widget-video\" data-id=\"601d12d5\" data-element_type=\"widget\" data-settings=\"{&quot;youtube_url&quot;:&quot;https:\\\/\\\/www.youtube.com\\\/watch?v=txHHcx5RbUM&quot;,&quot;video_type&quot;:&quot;youtube&quot;,&quot;controls&quot;:&quot;yes&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-wrapper elementor-open-inline\">\n\t\t\t<div class=\"elementor-video\"><\/div>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-417e902b elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"417e902b\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-445533ac elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"445533ac\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-764cd7db\" data-id=\"764cd7db\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-24823b62 elementor-view-stacked elementor-shape-circle elementor-widget elementor-widget-icon\" data-id=\"24823b62\" data-element_type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<div class=\"elementor-icon\">\n\t\t\t<i aria-hidden=\"true\" class=\"fas fa-arrow-circle-down\"><\/i>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-375a3a1d elementor-widget elementor-widget-text-editor\" data-id=\"375a3a1d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<h2>Codigo R<\/h2><p>\u00a0<\/p><p>## CARTERA DE MARKOWITZ &#8212; TANGENCIAL<\/p><p><br \/>## C\u00d3NOCIDA COMO M\u00c1XIMO SHARPE<\/p><p><br \/>### entre todo el conjunto de posibilidades que tenemos<br \/>## elegiremos aquella &#8212; max atio sharpe<\/p><p><br \/>#install.packages(\u00abquantmod\u00bb)<\/p><p>library(quantmod)<\/p><p>#getFX(\u00abEUR\/USD\u00bb)<\/p><p>library(\u00abtseries\u00bb)<\/p><p>library(\u00abfImport\u00bb)<br \/>library(\u00aburca\u00bb)<br \/>library(\u00abvars\u00bb)<\/p><p><br \/>getSymbols(\u00abCADCHF=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2017-02-18\u00bb)<br \/>getSymbols(\u00abAUDNZD=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2017-02-18\u00bb)<br \/>getSymbols(\u00abAUDUSD=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2017-02-18\u00bb)<br \/>getSymbols(\u00abEURCHF=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2017-02-18\u00bb)<br \/>getSymbols(\u00abEURGBP=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2017-02-18\u00bb)<br \/>getSymbols(\u00abEURCAD=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2017-02-18\u00bb)<\/p><p>getSymbols(\u00abCADCHF=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2019-01-01\u00bb)<br \/>getSymbols(\u00abAUDNZD=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2019-01-01\u00bb)<br \/>getSymbols(\u00abAUDUSD=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2019-01-01\u00bb)<br \/>getSymbols(\u00abEURCHF=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2019-01-01\u00bb)<br \/>getSymbols(\u00abEURGBP=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2019-01-01\u00bb)<br \/>getSymbols(\u00abEURCAD=X\u00bb,src=\u00bbyahoo\u00bb,from = \u00ab2019-01-01\u00bb)<\/p><p>\u00a0<\/p><p>CADCHF= `CADCHF=X`[,4] # precios diarios de cierre<br \/>AUDNZD= `AUDNZD=X`[,4]<br \/>AUDUSD= `AUDUSD=X`[,4]<br \/>EURCHF= `EURCHF=X`[,4]<br \/>EURGBP= `EURGBP=X`[,4]<br \/>EURCAD= `EURCAD=X`[,4]<\/p><p><br \/>#### tabla<\/p><p>forex_mark &lt;-na.omit(cbind(CADCHF,AUDNZD,AUDUSD,EURCHF,EURGBP,EURCAD))<\/p><p>plot(forex_mark)<\/p><p>#Calculamos los retornos y x 100 para calcularlos en %<\/p><p>forex_mark_ret=na.omit(returns(forex_mark))<br \/>forex_mark_ret = 100 * forex_mark_ret<\/p><p>Forex_ret&lt;-as.timeSeries(forex_mark_ret)<\/p><p>names(Forex_ret)&lt;- cbind(\u00abCADCHF\u00bb,\u00bbAUDNZD\u00bb,\u00bbAUDUSD\u00bb,\u00bbEURCHF\u00bb,\u00bbEURGBP\u00bb,\u00bbEURCAD\u00bb)<\/p><p>plot(Forex_ret)<\/p><p>apply(Forex_ret,2,mean) #\u2660 media diaria<\/p><p><br \/>assetReturns &lt;- Forex_ret[, 1:6]<br \/>names(assetReturns)<\/p><p><br \/>#### pasarlo a positivo y hacer con longonly<\/p><p><br \/>#### codigo sharpe<\/p><p><br \/>library(quadprog)<\/p><p><br \/>portfolioWeights &lt;- function(assetReturns, targetReturn)<br \/>{<br \/>nAssets = ncol(assetReturns)<br \/>portfolio = solve.QP(<br \/>Dmat = cov(assetReturns),<br \/>dvec = rep(0, times=nAssets),<br \/>Amat = t(rbind(Return=colMeans(assetReturns),<br \/>Budget=rep(1, nAssets))), #LongOnly=diag(nAssets)<br \/>bvec = c(Return=targetReturn, budget=1),<br \/>#LongOnly=rep(0, times=nAssets)),<br \/>meq=2)<br \/>weights = portfolio$solution<br \/>weights<br \/>}<\/p><p>\u00a0<\/p><p><br \/>tangencyPortfolio &lt;- function (assetReturns, riskFreeRate=0)<br \/>{<br \/># 1 Funci\u00f3n de c\u00e1lculo del Sharpe Ratio:<br \/><br \/>sharpeRatio &lt;- function(x, assetReturns, riskFreeRate)<br \/>{<br \/>targetReturn = x<br \/>weights = portfolioWeights(assetReturns, targetReturn)<br \/>targetRisk = sqrt( weights %*% cov(assetReturns) %*% weights )[[1]]<br \/>ratio = (targetReturn &#8211; riskFreeRate)\/targetRisk<br \/>attr(ratio, \u00abweights\u00bb) &lt;- weights<br \/>attr(ratio, \u00abtargetRisk\u00bb) &lt;- targetRisk<br \/>ratio<br \/>}<br \/><br \/># 2 Optimizaci\u00f3n :<br \/><br \/>nAssets = ncol(assetReturns)<br \/>mu = colMeans(assetReturns)<br \/>Cov = cov(assetReturns)<br \/>tgPortfolio &lt;- optimize(<br \/>f=sharpeRatio, interval=range(mu), maximum=TRUE,<br \/>assetReturns=assetReturns, riskFreeRate=riskFreeRate)<br \/><br \/># 3 Salida y caracteristica:<br \/><br \/>tgReturn = tgPortfolio$maximum<br \/>tgRisk = attr(tgPortfolio$objective, \u00abtargetRisk\u00bb)<br \/>tgWeights = attr(tgPortfolio$objective, \u00abweights\u00bb)<br \/>sharpeRatio = sharpeRatio(tgReturn, assetReturns, riskFreeRate)[[1]]<br \/># Return Value:<br \/>list(<br \/>sharpeRatio=sharpeRatio,<br \/>tgRisk=tgRisk, tgReturn=tgReturn, tgWeights=tgWeights)<br \/>}<br \/><br \/><br \/><br \/>tangencyPortfolio(assetReturns, riskFreeRate = 0)<br \/><br \/><br \/>tangencial&lt;- tangencyPortfolio(assetReturns, riskFreeRate = 0)<br \/><br \/>tangencial$tgWeights*100<br \/><br \/><br \/>sum(tangencial$tgWeights)<\/p><p>apply(Forex_ret,2,mean) #\u2660 media diaria<br \/><br \/><br \/><br \/><br \/><br \/>abs(tangencial$tgWeights)*100<br \/><br \/><br \/>sum(abs(tangencial$tgWeights))*100<br \/><br \/>456.4795\/100<br \/><br \/>pesos_equi&lt;- abs(tangencial$tgWeights)*100\/4.5647<br \/>pesos_equi<br \/><br \/>sum(pesos_equi)<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Dentro de la Teor\u00eda Moderna de Carteras de H.Markowitz hay varios tipos de portafolios que podemos crear. De uno de ellos ya habl\u00e9 en el post anterior donde expliqu\u00e9 el porftolio de Media-Varianza . Otro tipo es el llamado Tangencial, cuyo objetivo es encontrar aquella combinaci\u00f3n de activos y pesos que maximiza el ratio de &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/\"> <span class=\"screen-reader-text\">Teor\u00eda de Markowitz en R : Cartera Tangencial<\/span> Leer m\u00e1s &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1861,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[24],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Teor\u00eda de Markowitz en R : Cartera Tangencial - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Teor\u00eda de Markowitz en R : Cartera Tangencial - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\" \/>\n<meta property=\"og:description\" content=\"Dentro de la Teor\u00eda Moderna de Carteras de H.Markowitz hay varios tipos de portafolios que podemos crear. De uno de ellos ya habl\u00e9 en el post anterior donde expliqu\u00e9 el porftolio de Media-Varianza . Otro tipo es el llamado Tangencial, cuyo objetivo es encontrar aquella combinaci\u00f3n de activos y pesos que maximiza el ratio de &hellip; Teor\u00eda de Markowitz en R : Cartera Tangencial Leer m\u00e1s &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/\" \/>\n<meta property=\"og:site_name\" content=\"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/VictorRicoA\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-05T12:59:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-08T15:56:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ricovictor.com\/wp-content\/uploads\/2021\/01\/night-1927265_640.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"426\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Victor A.Rico\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/RicoVictor_\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Victor A.Rico\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/\"},\"author\":{\"name\":\"Victor A.Rico\",\"@id\":\"https:\/\/ricovictor.com\/#\/schema\/person\/019a6d632b4c12d438e84d000f68ae38\"},\"headline\":\"Teor\u00eda de Markowitz en R : Cartera Tangencial\",\"datePublished\":\"2021-01-05T12:59:36+00:00\",\"dateModified\":\"2021-01-08T15:56:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/\"},\"wordCount\":532,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ricovictor.com\/#organization\"},\"articleSection\":[\"Finanzas Cuantitativas\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/\",\"url\":\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/\",\"name\":\"Teor\u00eda de Markowitz en R : Cartera Tangencial - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\",\"isPartOf\":{\"@id\":\"https:\/\/ricovictor.com\/#website\"},\"datePublished\":\"2021-01-05T12:59:36+00:00\",\"dateModified\":\"2021-01-08T15:56:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/ricovictor.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Teor\u00eda de Markowitz en R : Cartera Tangencial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ricovictor.com\/#website\",\"url\":\"https:\/\/ricovictor.com\/\",\"name\":\"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/ricovictor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ricovictor.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ricovictor.com\/#organization\",\"name\":\"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\",\"url\":\"https:\/\/ricovictor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/ricovictor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ricovictor.com\/wp-content\/uploads\/2026\/02\/cropped-ChatGPT-Image-4-feb-2026-12_41_28.png\",\"contentUrl\":\"https:\/\/ricovictor.com\/wp-content\/uploads\/2026\/02\/cropped-ChatGPT-Image-4-feb-2026-12_41_28.png\",\"width\":1402,\"height\":474,\"caption\":\"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas\"},\"image\":{\"@id\":\"https:\/\/ricovictor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/ricovictor.com\/#\/schema\/person\/019a6d632b4c12d438e84d000f68ae38\",\"name\":\"Victor A.Rico\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/ricovictor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/aafb747906a8c3309189616a81e1481e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/aafb747906a8c3309189616a81e1481e?s=96&d=mm&r=g\",\"caption\":\"Victor A.Rico\"},\"description\":\"Diplomado en Ciencias Empresariales y Operador del Mercado Espa\u00f1ol de Futuros y Opciones\",\"sameAs\":[\"https:\/\/www.facebook.com\/VictorRicoA\/\",\"https:\/\/www.instagram.com\/victor_a.rico\",\"https:\/\/www.linkedin.com\/in\/ricovictor\/\",\"https:\/\/twitter.com\/https:\/\/www.twitter.com\/RicoVictor_\",\"https:\/\/www.youtube.com\/VictorARico\"],\"url\":\"https:\/\/ricovictor.com\/index.php\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Teor\u00eda de Markowitz en R : Cartera Tangencial - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","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:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/","og_locale":"es_ES","og_type":"article","og_title":"Teor\u00eda de Markowitz en R : Cartera Tangencial - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","og_description":"Dentro de la Teor\u00eda Moderna de Carteras de H.Markowitz hay varios tipos de portafolios que podemos crear. De uno de ellos ya habl\u00e9 en el post anterior donde expliqu\u00e9 el porftolio de Media-Varianza . Otro tipo es el llamado Tangencial, cuyo objetivo es encontrar aquella combinaci\u00f3n de activos y pesos que maximiza el ratio de &hellip; Teor\u00eda de Markowitz en R : Cartera Tangencial Leer m\u00e1s &raquo;","og_url":"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/","og_site_name":"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","article_author":"https:\/\/www.facebook.com\/VictorRicoA\/","article_published_time":"2021-01-05T12:59:36+00:00","article_modified_time":"2021-01-08T15:56:11+00:00","og_image":[{"width":640,"height":426,"url":"https:\/\/ricovictor.com\/wp-content\/uploads\/2021\/01\/night-1927265_640.jpg","type":"image\/jpeg"}],"author":"Victor A.Rico","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/RicoVictor_","twitter_misc":{"Escrito por":"Victor A.Rico","Tiempo de lectura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/#article","isPartOf":{"@id":"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/"},"author":{"name":"Victor A.Rico","@id":"https:\/\/ricovictor.com\/#\/schema\/person\/019a6d632b4c12d438e84d000f68ae38"},"headline":"Teor\u00eda de Markowitz en R : Cartera Tangencial","datePublished":"2021-01-05T12:59:36+00:00","dateModified":"2021-01-08T15:56:11+00:00","mainEntityOfPage":{"@id":"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/"},"wordCount":532,"commentCount":0,"publisher":{"@id":"https:\/\/ricovictor.com\/#organization"},"articleSection":["Finanzas Cuantitativas"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/","url":"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/","name":"Teor\u00eda de Markowitz en R : Cartera Tangencial - V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","isPartOf":{"@id":"https:\/\/ricovictor.com\/#website"},"datePublished":"2021-01-05T12:59:36+00:00","dateModified":"2021-01-08T15:56:11+00:00","breadcrumb":{"@id":"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ricovictor.com\/index.php\/2021\/01\/05\/teoria-de-markowitz-en-r-cartera-tangencial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/ricovictor.com\/"},{"@type":"ListItem","position":2,"name":"Teor\u00eda de Markowitz en R : Cartera Tangencial"}]},{"@type":"WebSite","@id":"https:\/\/ricovictor.com\/#website","url":"https:\/\/ricovictor.com\/","name":"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","description":"","publisher":{"@id":"https:\/\/ricovictor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ricovictor.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/ricovictor.com\/#organization","name":"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas","url":"https:\/\/ricovictor.com\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/ricovictor.com\/#\/schema\/logo\/image\/","url":"https:\/\/ricovictor.com\/wp-content\/uploads\/2026\/02\/cropped-ChatGPT-Image-4-feb-2026-12_41_28.png","contentUrl":"https:\/\/ricovictor.com\/wp-content\/uploads\/2026\/02\/cropped-ChatGPT-Image-4-feb-2026-12_41_28.png","width":1402,"height":474,"caption":"V\u00edctor A. Rico \u2014 Econometr\u00eda y Finanzas Cuantitativas"},"image":{"@id":"https:\/\/ricovictor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/ricovictor.com\/#\/schema\/person\/019a6d632b4c12d438e84d000f68ae38","name":"Victor A.Rico","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/ricovictor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/aafb747906a8c3309189616a81e1481e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/aafb747906a8c3309189616a81e1481e?s=96&d=mm&r=g","caption":"Victor A.Rico"},"description":"Diplomado en Ciencias Empresariales y Operador del Mercado Espa\u00f1ol de Futuros y Opciones","sameAs":["https:\/\/www.facebook.com\/VictorRicoA\/","https:\/\/www.instagram.com\/victor_a.rico","https:\/\/www.linkedin.com\/in\/ricovictor\/","https:\/\/twitter.com\/https:\/\/www.twitter.com\/RicoVictor_","https:\/\/www.youtube.com\/VictorARico"],"url":"https:\/\/ricovictor.com\/index.php\/author\/admin\/"}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/posts\/1859"}],"collection":[{"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/comments?post=1859"}],"version-history":[{"count":4,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/posts\/1859\/revisions"}],"predecessor-version":[{"id":1864,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/posts\/1859\/revisions\/1864"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/media\/1861"}],"wp:attachment":[{"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/media?parent=1859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/categories?post=1859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ricovictor.com\/index.php\/wp-json\/wp\/v2\/tags?post=1859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}