(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 3810, 112]*) (*NotebookOutlinePosition[ 4885, 149]*) (* CellTagsIndexPosition[ 4841, 145]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{Cell[TextData["Asset Markets"], "Title", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["Hal Varian\nJanuary 1992"], "Subsubtitle", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{Cell[TextData["Mean-Variance Frontier"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "Let's start out by deriving the mean-variance frontier used in the text. We \ want to minimize variance subject to the constraint that we have a portfolio \ and that it has a given return. If there are two risky assets, we have the \ following means and variances"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "var[x1_,x2_,s11_,s12_,s22_] := x1^2 s11 + 2 x1 x2 s12 + x2^2 s22\n\ ER[x1_,x2_,R1_,R2_] := x1 R1 + x2 R2\nL = var[x1,x2,s11,s12,s22] - \ lambda*(ER[x1,x2,R1,R2] - Rp) - \n mu*(x1 + x2 - 1)"], "Input", AspectRatioFixed->True], Cell[TextData[ "solution=Simplify[\n\t\t \ Solve[{D[L,x1]==0,D[L,x2]==0,D[L,lambda]==0,D[L,mu]==0},\n\t\t \ {x1,x2,lambda,mu}]][[1]]\nportfolioVariance[Rp_,R1_,R2_,s11_,s12_,s22_] := \n \ Evaluate[var[x1,x2,s11,s12,s22]/.solution]\n\ portfolioVariance[Rp,R1,R2,s11,s12,s22]\n\n"], "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Now let's plot the return and variance. We use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ParametricPlot.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "ParametricPlot[{portfolioVariance[Rp,0.10,0.15,0.5,0.2,0.4],Rp},\n \ {Rp,-0.1,0.35},AxesOrigin->{0,0}]"], "Input", AspectRatioFixed->True], Cell[TextData[ "In mean-standard-deviation space, the plot looks like this:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "ParametricPlot[{Sqrt[portfolioVariance[Rp,0.10,0.15,0.5,0.2,0.4]],Rp},\n \ {Rp,-0.1,0.35},AxesOrigin->{0,0}]"], "Input", AspectRatioFixed->True]}, Open]]}, Open]] }, FrontEndVersion->"Macintosh 3.0", ScreenRectangle->{{0, 640}, {0, 460}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{520, 365}, WindowMargins->{{12, Automatic}, {Automatic, 31}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, Magnification->1.5, MacintoshSystemPageSetup->"\<\ AVU/IFiQKFD000000V8nh09RAj0000000OXQ<097PXP0AP1Y06`0I@1^0642HSkP 0V97`0000001nR4@0TN2R000000000000000009R?^0000000000000000000000 00000000000000000000000000000000\>" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1731, 51, 88, 2, 70, "Title", Evaluatable->False], Cell[1822, 55, 105, 2, 70, "Subsubtitle", Evaluatable->False], Cell[CellGroupData[{ Cell[1950, 59, 99, 2, 70, "Section", Evaluatable->False], Cell[2052, 63, 340, 6, 70, "Text", Evaluatable->False], Cell[2395, 71, 246, 4, 70, "Input"], Cell[2644, 77, 327, 6, 70, "Input"], Cell[2974, 85, 324, 11, 70, "Text", Evaluatable->False], Cell[3301, 98, 171, 3, 70, "Input"], Cell[3475, 103, 134, 3, 70, "Text", Evaluatable->False], Cell[3612, 108, 177, 3, 70, "Input"] }, Closed]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)