[Introcompfinr-commits] r11 - / pkg/IntroCompFinR/R pkg/IntroCompFinR/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Feb 20 01:32:34 CET 2015
Author: bethanyyollin
Date: 2015-02-20 01:32:34 +0100 (Fri, 20 Feb 2015)
New Revision: 11
Removed:
text.R
Modified:
pkg/IntroCompFinR/R/efficient.frontier.R
pkg/IntroCompFinR/R/efficient.portfolio.R
pkg/IntroCompFinR/R/getPortfolio.R
pkg/IntroCompFinR/R/globalMin.portfolio.R
pkg/IntroCompFinR/R/plot.Markowitz.R
pkg/IntroCompFinR/R/print.Markowitz.R
pkg/IntroCompFinR/R/print.portfolio.R
pkg/IntroCompFinR/R/summary.Markowitz.R
pkg/IntroCompFinR/R/summary.portfolio.R
pkg/IntroCompFinR/R/tangency.portfolio.R
pkg/IntroCompFinR/man/efficient.frontier.Rd
pkg/IntroCompFinR/man/efficient.portfolio.Rd
pkg/IntroCompFinR/man/getPortfolio.Rd
pkg/IntroCompFinR/man/globalMin.portfolio.Rd
pkg/IntroCompFinR/man/plot.Markowitz.Rd
pkg/IntroCompFinR/man/print.Markowitz.Rd
pkg/IntroCompFinR/man/print.portfolio.Rd
pkg/IntroCompFinR/man/summary.Markowitz.Rd
pkg/IntroCompFinR/man/summary.portfolio.Rd
pkg/IntroCompFinR/man/tangency.portfolio.Rd
Log:
Improved documentation.
Modified: pkg/IntroCompFinR/R/efficient.frontier.R
===================================================================
--- pkg/IntroCompFinR/R/efficient.frontier.R 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/R/efficient.frontier.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -3,29 +3,37 @@
#' @author Eric Zivot
#'
#' @description
-#' The function constructs the set of efficient portfolios using this method (see details) for a
-#' collection of alpha values.
+#' The function constructs the set of mean-variance efficient portfolios that either allow all assets to be
+#' sold short or not allow any asset to be sold short. The returned object is of class \samp{Markowitz} for
+#' which there are \code{print}, \code{summary} and \code{plot} methods.
#'
#' @details
-#' The the set of efficient portfolios of risky assets can be computed as a convex combination of
+#' If short sales are allowed (negative weights) then the set of efficient portfolios of risky assets
+#' can be computed as a convex combination of
#' any two efficient portfolios. It is convenient to use the global minimum variance portfolio as
#' one portfolio and an efficient portfolio with target expected return equal to the maximum
#' expected return of the assets under consideration as the other portfolio. Call these portfolios
-#' \eqn{m} and \eqn{x}, respectively. For any number alpha, another efficient
-#' portfolio can be computed as \eqn{z=\alpha m+(1-\alpha)x}
+#' \eqn{m} and \eqn{x}, respectively. Then for any number \samp{alpha}, another efficient
+#' portfolio can be computed as \eqn{z=\alpha m+(1-\alpha)x}. If short sales are not allowed, then the set
+#' of efficient portfolios is computed by repeated calls to the function \code{efficient.portfolio()},
+#' with \code{shorts=FALSE}, for a
+#' grid of target expected returns starting at the expected return of the global minimum variance portfolio
+#' (not allowing short sales) and ending at the expected return equal to the maximum expected return of
+#' the assets under consideration.
#'
-#' @param er N x 1 vector of expected returns
-#' @param cov.mat N x N return covariance matrix
+#' @param er \samp{N x 1} vector of expected returns
+#' @param cov.mat \samp{N x N} return covariance matrix
#' @param nport scalar, number of efficient portfolios to compute
-#' @param alpha.min minimum value of alpha, default is -.5
-#' @param alpha.max maximum value of alpha, defualt is 1.5
-#' @param shorts logical, allow shorts is \code{TRUE}
+#' @param alpha.min minimum value of \samp{alpha}, default is \code{-.5}
+#' @param alpha.max maximum value of \samp{alpha}, default is \code{1.5}
+#' @param shorts logical, if \code{TRUE} then short sales (negative portfolio weights)
+#' are allowed. If \code{FALSE} then no asset is allowed to be sold short
#'
#' @return
#' \item{call}{captures function call}
-#' \item{er}{nport x 1 vector of expected returns on efficient porfolios}
-#' \item{sd}{nport x 1 vector of std deviations on efficient portfolios}
-#' \item{weights}{nport x N matrix of weights on efficient portfolios}
+#' \item{er}{\samp{nport x 1} vector of expected returns of efficient porfolios}
+#' \item{sd}{\samp{nport x 1} vector of standard deviations of efficient portfolios}
+#' \item{weights}{\samp{nport x N} matrix of weights of efficient portfolios}
#'
#' @examples
#' # construct the data
Modified: pkg/IntroCompFinR/R/efficient.portfolio.R
===================================================================
--- pkg/IntroCompFinR/R/efficient.portfolio.R 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/R/efficient.portfolio.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -3,23 +3,29 @@
#' @author Eric Zivot
#'
#' @description
-#' Compute minimum variance portfolio subject to target return.
+#' Compute minimum variance portfolio subject to target return either allowing all assets
+#' to be sold short or not allowing any asset to be sold short. The returned object is
+#' of class \samp{portfolio}.
#'
#' @details
-#' A mean-variance efficient portfolio \eqn{x} that achieves the target expected return \eqn{\mu_0}
+#' A mean-variance efficient portfolio \eqn{x} allowing short sales (negative weights)
+#' that achieves the target expected return \eqn{\mu_0}
#' solves the optimization problem: min \eqn{t(x)\Sigma x} s.t. \eqn{t(x)1=1} and
-#' \eqn{t(x)\mu=\mu_0}
+#' \eqn{t(x)\mu=\mu_0}, for which there is an analytic solution using matrix algebra.
+#' If short sales are not allowed then the portfolio is computed numerically using the
+#' function \code{solve.QP()} from the \samp{quadprog} package.
#'
-#' @param er N x 1 vector of expected returns
-#' @param cov.mat N x N return covariance matrix
+#' @param er \samp{N x 1} vector of expected returns
+#' @param cov.mat \samp{N x N} return covariance matrix
#' @param target.return scalar, target expected return
-#' @param shorts logical, allow shorts is \code{TRUE}
+#' @param shorts logical, if \code{TRUE} then short sales (negative portfolio weights)
+#' are allowed. If \code{FALSE} then no asset is allowed to be sold short.
#'
#' @return
#' \item{call}{captures function call}
#' \item{er}{portfolio expected return}
#' \item{sd}{portfolio standard deviation}
-#' \item{weights}{N x 1 vector of portfolio weights}
+#' \item{weights}{\samp{N x 1} vector of portfolio weights}
#'
#' @examples
#' # construct the data
Modified: pkg/IntroCompFinR/R/getPortfolio.R
===================================================================
--- pkg/IntroCompFinR/R/getPortfolio.R 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/R/getPortfolio.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -3,21 +3,24 @@
#' @author Eric Zivot
#'
#' @description
-#' Construct the portfolio with expected return vector and covariance matrix.
+#' Create a portfolio object from expected return vector, covariance matrix, and weight vector.
#'
#' @details
#' To specify a portfolio, an expected return vector and covariance matrix for the assets under
-#' consideration as well as a vector of portfolio weights are needed.
+#' consideration as well as a vector of portfolio weights are needed. The result of \code{getPortfolio}
+#' is a \samp{portfolio} object, which is list with components for the portfolio expected return,
+#' portfolio standard deviation, and portfolio weights. There are \code{print}, \code{summary} and \code{plot}
+#' methods.
#'
-#' @param er N x 1 vector of expected returns
-#' @param cov.mat N x N return covariance matrix
-#' @param weights N x 1 vector of portfolio weights
+#' @param er \samp{N x 1} vector of expected returns
+#' @param cov.mat \samp{N x N} return covariance matrix
+#' @param weights \samp{N x 1} vector of portfolio weights
#'
#' @return
#' \item{call}{captures function call}
#' \item{er}{portfolio expected return}
#' \item{sd}{portfolio standard deviation}
-#' \item{weights}{N x 1 vector of portfolio weights}
+#' \item{weights}{\samp{N x 1} vector of portfolio weights}
#'
#' @examples
#' # construct the data
Modified: pkg/IntroCompFinR/R/globalMin.portfolio.R
===================================================================
--- pkg/IntroCompFinR/R/globalMin.portfolio.R 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/R/globalMin.portfolio.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -3,21 +3,27 @@
#' @author Eric Zivot
#'
#' @description
-#' Compute global minimum variance portfolio.
+#' Compute global minimum variance portfolio given expected return vector and
+#' covariance matrix. The portfolio can allow all assets to be shorted
+#' or not allow any assets to be shorted. The returned object is of class \samp{portfolio}.
#'
#' @details
-#' The global minimum variance portfolio (allowing for short sales) \eqn{m} solves the optimization
-#' problem: min \eqn{t(m)\Sigma m} s.t. \eqn{t(m)1=1}.
+#' The global minimum variance portfolio \eqn{m} allowing for short sales solves the optimization
+#' problem: min \eqn{t(m)\Sigma m} s.t. \eqn{t(m)1=1} for which there is an analytic solution
+#' using matrix algebra. If short sales are not allowed
+#' then the portfolio is computed numerically using the function \code{solve.QP()}
+#' from the \samp{quadprog} package.
#'
-#' @param er N x 1 vector of expected returns
-#' @param cov.mat N x N return covariance matrix
-#' @param shorts logical, allow shorts is \code{TRUE}
+#' @param er \samp{N x 1} vector of expected returns
+#' @param cov.mat \samp{N x N} return covariance matrix
+#' @param shorts logical, if \code{TRUE} then short sales (negative portfolio weights)
+#' are allowed. If \code{FALSE} then no asset is allowed to be sold short.
#'
#' @return
#' \item{call}{captures function call}
#' \item{er}{portfolio expected return}
#' \item{sd}{portfolio standard deviation}
-#' \item{weights}{N x 1 vector of portfolio weights}
+#' \item{weights}{\samp{N x 1} vector of portfolio weights}
#'
#' @examples
#' # construct the data
Modified: pkg/IntroCompFinR/R/plot.Markowitz.R
===================================================================
--- pkg/IntroCompFinR/R/plot.Markowitz.R 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/R/plot.Markowitz.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -3,10 +3,12 @@
#' @author Eric Zivot
#'
#' @description
-#' Plot efficient frontier.
+#' Plot efficient frontier. The efficient frontier is a plot of portfolio expected return vs. portfolio
+#' standard deviation for a collection of mean-variance efficient portfolios - portfolios that minimize vriance
+#' subject to a target expected return.
#'
#' @param object object of class Markowitz
-#' @param plot.assets if \code{TRUE} then plot asset \code{sd} and \code{er}
+#' @param plot.assets if \code{TRUE} then plot asset \code{sd} and \code{er} with asset name labels
#' @param ... additional arguments passed to \code{plot()}
#'
#' @examples
Modified: pkg/IntroCompFinR/R/print.Markowitz.R
===================================================================
--- pkg/IntroCompFinR/R/print.Markowitz.R 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/R/print.Markowitz.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -3,7 +3,7 @@
#' @author Eric Zivot
#'
#' @description
-#' Print efficient frontier
+#' Print method for \samp{Markowitz} objects.
#'
#' @param object object of class Markowitz
#' @param ... additional arguments passed to \code{print()}
Modified: pkg/IntroCompFinR/R/print.portfolio.R
===================================================================
--- pkg/IntroCompFinR/R/print.portfolio.R 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/R/print.portfolio.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -3,7 +3,7 @@
#' @author Eric Zivot
#'
#' @description
-#' Print method of class portfolio.
+#' Print method for objects of class \samp{portfolio}.
#'
#' @param object object of class portfolio
#' @param ... additional arguments passed to \code{print()}
Modified: pkg/IntroCompFinR/R/summary.Markowitz.R
===================================================================
--- pkg/IntroCompFinR/R/summary.Markowitz.R 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/R/summary.Markowitz.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -3,7 +3,9 @@
#' @author Eric Zivot
#'
#' @description
-#' Summary method of efficient frontier function. The weights of the portfolio will be shown. The
+#' Summary method for objects of class \samp{Markowitz}. For all portfolios on the efficient frontier,
+#' the expected return, standard deviation and asset weights are shown. If \code{risk.free} is given then
+#' efficient portfolios that are combinations of the risk free asset and the tangency portfolio are computed. The
#' class \code{summary.Markozitz} will be created.
#'
#' @param object object of class Markowitz
Modified: pkg/IntroCompFinR/R/summary.portfolio.R
===================================================================
--- pkg/IntroCompFinR/R/summary.portfolio.R 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/R/summary.portfolio.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -3,7 +3,9 @@
#' @author Eric Zivot
#'
#' @description
-#' Summary method of class portfolio.
+#' Summary method for objects of class \samp{portfolio}. The output is the same
+#' as the \code{print}. If \code{risk.free} is specified then the portfolio Sharpe
+#' ratio is also returned.
#'
#' @param object object of class portfolio
#' @param risk.free numeric, risk free rate
Modified: pkg/IntroCompFinR/R/tangency.portfolio.R
===================================================================
--- pkg/IntroCompFinR/R/tangency.portfolio.R 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/R/tangency.portfolio.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -3,23 +3,27 @@
#' @author Eric Zivot
#'
#' @description
-#' Compute tangency portfolio.
+#' Compute tangency (maximum Sharpe ratio) portfolio. The portfolio can allow all assets to be shorted
+#' or not allow any assets to be shorted.
#'
#' @details
-#' The tangency portfolio t is the portfolio of risky assets with the highest Sharpe's slope and
+#' The tangency portfolio \samp{t} is the portfolio of risky assets with the highest Sharpe's slope and
#' solves the optimization problem: max \eqn{(t(t)\mu-r_f)/(t(t)\Sigma t^{1/2})} s.t. \eqn{t(t)1=1}
-#' where \eqn{r_f} denotes the risk-free rate.
+#' where \eqn{r_f} denotes the risk-free rate. If short sales are allowed then there is an analytic
+#' solution using matrix algebra. If short sales are not allowed then the maximum sharpe ratio portfolio must
+#' be computed numerically.
#'
-#' @param er N x 1 vector of expected returns
-#' @param cov.mat N x N return covariance matrix
+#' @param er \samp{N x 1} vector of expected returns
+#' @param cov.mat \samp{N x N} return covariance matrix
#' @param risk.free numeric, risk free rate
-#' @param shorts logical, allow shorts is \code{TRUE}
+#' @param shorts logical, if \code{TRUE} then short sales (negative portfolio weights)
+#' are allowed. If \code{FALSE} then no asset is allowed to be sold short.
#'
#' @return
#' \item{call}{captures function call}
#' \item{er}{portfolio expected return}
#' \item{sd}{portfolio standard deviation}
-#' \item{weights}{N x 1 vector of portfolio weights}
+#' \item{weights}{\samp{N x 1} vector of portfolio weights}
#'
#' @examples
#' # construct the data
Modified: pkg/IntroCompFinR/man/efficient.frontier.Rd
===================================================================
--- pkg/IntroCompFinR/man/efficient.frontier.Rd 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/man/efficient.frontier.Rd 2015-02-20 00:32:34 UTC (rev 11)
@@ -8,35 +8,43 @@
alpha.max = 1.5, shorts = TRUE)
}
\arguments{
-\item{er}{N x 1 vector of expected returns}
+\item{er}{\samp{N x 1} vector of expected returns}
-\item{cov.mat}{N x N return covariance matrix}
+\item{cov.mat}{\samp{N x N} return covariance matrix}
\item{nport}{scalar, number of efficient portfolios to compute}
-\item{alpha.min}{minimum value of alpha, default is -.5}
+\item{alpha.min}{minimum value of \samp{alpha}, default is \code{-.5}}
-\item{alpha.max}{maximum value of alpha, defualt is 1.5}
+\item{alpha.max}{maximum value of \samp{alpha}, default is \code{1.5}}
-\item{shorts}{logical, allow shorts is \code{TRUE}}
+\item{shorts}{logical, if \code{TRUE} then short sales (negative portfolio weights)
+are allowed. If \code{FALSE} then no asset is allowed to be sold short}
}
\value{
\item{call}{captures function call}
- \item{er}{nport x 1 vector of expected returns on efficient porfolios}
- \item{sd}{nport x 1 vector of std deviations on efficient portfolios}
- \item{weights}{nport x N matrix of weights on efficient portfolios}
+ \item{er}{\samp{nport x 1} vector of expected returns of efficient porfolios}
+ \item{sd}{\samp{nport x 1} vector of standard deviations of efficient portfolios}
+ \item{weights}{\samp{nport x N} matrix of weights of efficient portfolios}
}
\description{
-The function constructs the set of efficient portfolios using this method (see details) for a
-collection of alpha values.
+The function constructs the set of mean-variance efficient portfolios that either allow all assets to be
+sold short or not allow any asset to be sold short. The returned object is of class \samp{Markowitz} for
+which there are \code{print}, \code{summary} and \code{plot} methods.
}
\details{
-The the set of efficient portfolios of risky assets can be computed as a convex combination of
+If short sales are allowed (negative weights) then the set of efficient portfolios of risky assets
+can be computed as a convex combination of
any two efficient portfolios. It is convenient to use the global minimum variance portfolio as
one portfolio and an efficient portfolio with target expected return equal to the maximum
expected return of the assets under consideration as the other portfolio. Call these portfolios
-\eqn{m} and \eqn{x}, respectively. For any number alpha, another efficient
-portfolio can be computed as \eqn{z=\alpha m+(1-\alpha)x}
+\eqn{m} and \eqn{x}, respectively. Then for any number \samp{alpha}, another efficient
+portfolio can be computed as \eqn{z=\alpha m+(1-\alpha)x}. If short sales are not allowed, then the set
+of efficient portfolios is computed by repeated calls to the function \code{efficient.portfolio()},
+with \code{shorts=FALSE}, for a
+grid of target expected returns starting at the expected return of the global minimum variance portfolio
+(not allowing short sales) and ending at the expected return equal to the maximum expected return of
+the assets under consideration.
}
\examples{
# construct the data
Modified: pkg/IntroCompFinR/man/efficient.portfolio.Rd
===================================================================
--- pkg/IntroCompFinR/man/efficient.portfolio.Rd 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/man/efficient.portfolio.Rd 2015-02-20 00:32:34 UTC (rev 11)
@@ -7,27 +7,33 @@
efficient.portfolio(er, cov.mat, target.return, shorts = TRUE)
}
\arguments{
-\item{er}{N x 1 vector of expected returns}
+\item{er}{\samp{N x 1} vector of expected returns}
-\item{cov.mat}{N x N return covariance matrix}
+\item{cov.mat}{\samp{N x N} return covariance matrix}
\item{target.return}{scalar, target expected return}
-\item{shorts}{logical, allow shorts is \code{TRUE}}
+\item{shorts}{logical, if \code{TRUE} then short sales (negative portfolio weights)
+are allowed. If \code{FALSE} then no asset is allowed to be sold short.}
}
\value{
\item{call}{captures function call}
\item{er}{portfolio expected return}
\item{sd}{portfolio standard deviation}
- \item{weights}{N x 1 vector of portfolio weights}
+ \item{weights}{\samp{N x 1} vector of portfolio weights}
}
\description{
-Compute minimum variance portfolio subject to target return.
+Compute minimum variance portfolio subject to target return either allowing all assets
+to be sold short or not allowing any asset to be sold short. The returned object is
+of class \samp{portfolio}.
}
\details{
-A mean-variance efficient portfolio \eqn{x} that achieves the target expected return \eqn{\mu_0}
+A mean-variance efficient portfolio \eqn{x} allowing short sales (negative weights)
+that achieves the target expected return \eqn{\mu_0}
solves the optimization problem: min \eqn{t(x)\Sigma x} s.t. \eqn{t(x)1=1} and
-\eqn{t(x)\mu=\mu_0}
+\eqn{t(x)\mu=\mu_0}, for which there is an analytic solution using matrix algebra.
+If short sales are not allowed then the portfolio is computed numerically using the
+function \code{solve.QP()} from the \samp{quadprog} package.
}
\examples{
# construct the data
Modified: pkg/IntroCompFinR/man/getPortfolio.Rd
===================================================================
--- pkg/IntroCompFinR/man/getPortfolio.Rd 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/man/getPortfolio.Rd 2015-02-20 00:32:34 UTC (rev 11)
@@ -7,24 +7,27 @@
getPortfolio(er, cov.mat, weights)
}
\arguments{
-\item{er}{N x 1 vector of expected returns}
+\item{er}{\samp{N x 1} vector of expected returns}
-\item{cov.mat}{N x N return covariance matrix}
+\item{cov.mat}{\samp{N x N} return covariance matrix}
-\item{weights}{N x 1 vector of portfolio weights}
+\item{weights}{\samp{N x 1} vector of portfolio weights}
}
\value{
\item{call}{captures function call}
\item{er}{portfolio expected return}
\item{sd}{portfolio standard deviation}
- \item{weights}{N x 1 vector of portfolio weights}
+ \item{weights}{\samp{N x 1} vector of portfolio weights}
}
\description{
-Construct the portfolio with expected return vector and covariance matrix.
+Create a portfolio object from expected return vector, covariance matrix, and weight vector.
}
\details{
To specify a portfolio, an expected return vector and covariance matrix for the assets under
-consideration as well as a vector of portfolio weights are needed.
+consideration as well as a vector of portfolio weights are needed. The result of \code{getPortfolio}
+is a \samp{portfolio} object, which is list with components for the portfolio expected return,
+portfolio standard deviation, and portfolio weights. There are \code{print}, \code{summary} and \code{plot}
+methods.
}
\examples{
# construct the data
Modified: pkg/IntroCompFinR/man/globalMin.portfolio.Rd
===================================================================
--- pkg/IntroCompFinR/man/globalMin.portfolio.Rd 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/man/globalMin.portfolio.Rd 2015-02-20 00:32:34 UTC (rev 11)
@@ -7,24 +7,30 @@
globalMin.portfolio(er, cov.mat, shorts = TRUE)
}
\arguments{
-\item{er}{N x 1 vector of expected returns}
+\item{er}{\samp{N x 1} vector of expected returns}
-\item{cov.mat}{N x N return covariance matrix}
+\item{cov.mat}{\samp{N x N} return covariance matrix}
-\item{shorts}{logical, allow shorts is \code{TRUE}}
+\item{shorts}{logical, if \code{TRUE} then short sales (negative portfolio weights)
+are allowed. If \code{FALSE} then no asset is allowed to be sold short.}
}
\value{
\item{call}{captures function call}
\item{er}{portfolio expected return}
\item{sd}{portfolio standard deviation}
- \item{weights}{N x 1 vector of portfolio weights}
+ \item{weights}{\samp{N x 1} vector of portfolio weights}
}
\description{
-Compute global minimum variance portfolio.
+Compute global minimum variance portfolio given expected return vector and
+covariance matrix. The portfolio can allow all assets to be shorted
+or not allow any assets to be shorted. The returned object is of class \samp{portfolio}.
}
\details{
-The global minimum variance portfolio (allowing for short sales) \eqn{m} solves the optimization
-problem: min \eqn{t(m)\Sigma m} s.t. \eqn{t(m)1=1}.
+The global minimum variance portfolio \eqn{m} allowing for short sales solves the optimization
+problem: min \eqn{t(m)\Sigma m} s.t. \eqn{t(m)1=1} for which there is an analytic solution
+using matrix algebra. If short sales are not allowed
+then the portfolio is computed numerically using the function \code{solve.QP()}
+from the \samp{quadprog} package.
}
\examples{
# construct the data
Modified: pkg/IntroCompFinR/man/plot.Markowitz.Rd
===================================================================
--- pkg/IntroCompFinR/man/plot.Markowitz.Rd 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/man/plot.Markowitz.Rd 2015-02-20 00:32:34 UTC (rev 11)
@@ -9,12 +9,14 @@
\arguments{
\item{object}{object of class Markowitz}
-\item{plot.assets}{if \code{TRUE} then plot asset \code{sd} and \code{er}}
+\item{plot.assets}{if \code{TRUE} then plot asset \code{sd} and \code{er} with asset name labels}
\item{...}{additional arguments passed to \code{plot()}}
}
\description{
-Plot efficient frontier.
+Plot efficient frontier. The efficient frontier is a plot of portfolio expected return vs. portfolio
+standard deviation for a collection of mean-variance efficient portfolios - portfolios that minimize vriance
+subject to a target expected return.
}
\examples{
# construct the data
Modified: pkg/IntroCompFinR/man/print.Markowitz.Rd
===================================================================
--- pkg/IntroCompFinR/man/print.Markowitz.Rd 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/man/print.Markowitz.Rd 2015-02-20 00:32:34 UTC (rev 11)
@@ -12,7 +12,7 @@
\item{...}{additional arguments passed to \code{print()}}
}
\description{
-Print efficient frontier
+Print method for \samp{Markowitz} objects.
}
\examples{
# construct the data
Modified: pkg/IntroCompFinR/man/print.portfolio.Rd
===================================================================
--- pkg/IntroCompFinR/man/print.portfolio.Rd 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/man/print.portfolio.Rd 2015-02-20 00:32:34 UTC (rev 11)
@@ -12,7 +12,7 @@
\item{...}{additional arguments passed to \code{print()}}
}
\description{
-Print method of class portfolio.
+Print method for objects of class \samp{portfolio}.
}
\examples{
# construct the data
Modified: pkg/IntroCompFinR/man/summary.Markowitz.Rd
===================================================================
--- pkg/IntroCompFinR/man/summary.Markowitz.Rd 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/man/summary.Markowitz.Rd 2015-02-20 00:32:34 UTC (rev 11)
@@ -12,7 +12,9 @@
\item{risk.free}{numeric, risk free rate}
}
\description{
-Summary method of efficient frontier function. The weights of the portfolio will be shown. The
+Summary method for objects of class \samp{Markowitz}. For all portfolios on the efficient frontier,
+the expected return, standard deviation and asset weights are shown. If \code{risk.free} is given then
+efficient portfolios that are combinations of the risk free asset and the tangency portfolio are computed. The
class \code{summary.Markozitz} will be created.
}
\examples{
Modified: pkg/IntroCompFinR/man/summary.portfolio.Rd
===================================================================
--- pkg/IntroCompFinR/man/summary.portfolio.Rd 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/man/summary.portfolio.Rd 2015-02-20 00:32:34 UTC (rev 11)
@@ -14,7 +14,9 @@
\item{...}{additional arguments passed to \code{summary()}}
}
\description{
-Summary method of class portfolio.
+Summary method for objects of class \samp{portfolio}. The output is the same
+as the \code{print}. If \code{risk.free} is specified then the portfolio Sharpe
+ratio is also returned.
}
\examples{
# construct the data
Modified: pkg/IntroCompFinR/man/tangency.portfolio.Rd
===================================================================
--- pkg/IntroCompFinR/man/tangency.portfolio.Rd 2015-02-19 19:06:05 UTC (rev 10)
+++ pkg/IntroCompFinR/man/tangency.portfolio.Rd 2015-02-20 00:32:34 UTC (rev 11)
@@ -7,27 +7,31 @@
tangency.portfolio(er, cov.mat, risk.free, shorts = TRUE)
}
\arguments{
-\item{er}{N x 1 vector of expected returns}
+\item{er}{\samp{N x 1} vector of expected returns}
-\item{cov.mat}{N x N return covariance matrix}
+\item{cov.mat}{\samp{N x N} return covariance matrix}
\item{risk.free}{numeric, risk free rate}
-\item{shorts}{logical, allow shorts is \code{TRUE}}
+\item{shorts}{logical, if \code{TRUE} then short sales (negative portfolio weights)
+are allowed. If \code{FALSE} then no asset is allowed to be sold short.}
}
\value{
\item{call}{captures function call}
\item{er}{portfolio expected return}
\item{sd}{portfolio standard deviation}
- \item{weights}{N x 1 vector of portfolio weights}
+ \item{weights}{\samp{N x 1} vector of portfolio weights}
}
\description{
-Compute tangency portfolio.
+Compute tangency (maximum Sharpe ratio) portfolio. The portfolio can allow all assets to be shorted
+or not allow any assets to be shorted.
}
\details{
-The tangency portfolio t is the portfolio of risky assets with the highest Sharpe's slope and
+The tangency portfolio \samp{t} is the portfolio of risky assets with the highest Sharpe's slope and
solves the optimization problem: max \eqn{(t(t)\mu-r_f)/(t(t)\Sigma t^{1/2})} s.t. \eqn{t(t)1=1}
-where \eqn{r_f} denotes the risk-free rate.
+where \eqn{r_f} denotes the risk-free rate. If short sales are allowed then there is an analytic
+solution using matrix algebra. If short sales are not allowed then the maximum sharpe ratio portfolio must
+be computed numerically.
}
\examples{
# construct the data
Deleted: text.R
===================================================================
--- text.R 2015-02-19 19:06:05 UTC (rev 10)
+++ text.R 2015-02-20 00:32:34 UTC (rev 11)
@@ -1 +0,0 @@
-print("Hello world!")
\ No newline at end of file
More information about the Introcompfinr-commits
mailing list