Skip to content

Commit cf47222

Browse files
Merge pull request CamDavidsonPilon#347 from rsvp/devis-277-Ch6-portfolio-opt
Fix CamDavidsonPilon#277 Ch6 portfolio optimization equation
2 parents 465e7e1 + a140735 commit cf47222

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Chapter6_Priorities/Ch6_Priors_PyMC2.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@
13781378
"\n",
13791379
"With this Bayesian analysis of the stock market, we can throw it into a Mean-Variance optimizer (which I cannot stress enough to not use with frequentist point estimates) and find the minimum. This optimizer balances the tradeoff between a high return and high variance.\n",
13801380
"\n",
1381-
"$$ w_{opt} = \\min_{w} \\frac{1}{N}\\left( \\sum_{i=0}^N \\mu_i^T w - \\frac{\\lambda}{2}w^T\\Sigma_i w \\right)$$\n",
1381+
"$$ w_{opt} = \\max_{w} \\frac{1}{N}\\left( \\sum_{i=0}^N \\mu_i^T w - \\frac{\\lambda}{2}w^T\\Sigma_i w \\right)$$\n",
13821382
"\n",
13831383
"where $\\mu_i$ and $\\Sigma_i$ are the $i$th posterior estimate of the mean returns and the covariance matrix. This is another example of loss function optimization."
13841384
]

Chapter6_Priorities/Ch6_Priors_PyMC3.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@
13781378
"\n",
13791379
"With this Bayesian analysis of the stock market, we can throw it into a Mean-Variance optimizer (which I cannot stress enough, do not use with frequentist point estimates) and find the minimum. This optimizer balances the tradeoff between a high return and high variance.\n",
13801380
"\n",
1381-
"$$ w_{opt} = \\min_{w} \\frac{1}{N}\\left( \\sum_{i=0}^N \\mu_i^T w - \\frac{\\lambda}{2}w^T\\Sigma_i w \\right)$$\n",
1381+
"$$ w_{opt} = \\max_{w} \\frac{1}{N}\\left( \\sum_{i=0}^N \\mu_i^T w - \\frac{\\lambda}{2}w^T\\Sigma_i w \\right)$$\n",
13821382
"\n",
13831383
"where $\\mu_i$ and $\\Sigma_i$ are the $i$th posterior estimate of the mean returns and the covariance matrix. This is another example of loss function optimization."
13841384
]

0 commit comments

Comments
 (0)