You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CVXR is an R package that provides an object-oriented modeling language for convex optimization, including the Second-Order Cone (SOCP) Optimization required to minimize Coherent Second Moment(CSM) problem, which is not supported by other solvers in PortfolioAnalytics. Hence, CVXR is a significant extension of PortfolioAnalytics.
28
28
29
-
The purpose of this vignette is to demonstrate examples of optimization problems that can be solved in PortfolioAnalytics with CVXR and its many supported solvers. The problem types covered include not only Linear Programming(LP), Quadratic Programming(QP) but also Second-Order Cone Programming(SOCP). Multiple solvers supported by CVXR can be selected according to optimization types. For example, SCS and ECOS can completely cover the types of problems that ROI can deal with, such as mean-variance and ES problem. In order to better understand the functionality and use of PortfolioAnalytics, users are recommended to read the Vignette [*Introduction to PortfolioAnalytics*](https://cran.r-project.org/web/packages/PortfolioAnalytics/vignettes/portfolio_vignette.pdf) first.
29
+
The purpose of this vignette is to demonstrate examples of optimization problems that can be solved in PortfolioAnalytics with CVXR and its many supported solvers. The problem types covered include not only Linear Programming(LP), Quadratic Programming(QP) but also Second-Order Cone Programming(SOCP). Multiple solvers supported by CVXR can be selected according to optimization types. For example, SCS and ECOS can completely cover the types of problems that ROI can deal with, such as mean-variance and ES problem. In order to better understand the functionality and use of PortfolioAnalytics, users are recommended to read the Vignette [*Introduction to PortfolioAnalytics*](https://cran.r-project.orgpackage=PortfolioAnalytics/vignettes/portfolio_vignette.pdf) first.
30
30
31
31
The R code `demo_cvxrPortfolioAnalytics.R` in the PortfolioAnalytics `demo` folder, reproduces the results in this Vignette.
32
32
@@ -105,7 +105,7 @@ Fig 2.1 EDHEC hedge fund style indexes returns from November 2014 to November 2
105
105
\end{center}
106
106
107
107
## 2.4 Optimization Problems
108
-
In this Vignette, all mean vectors and covariance matrices in the optimization formula will use standard sample based estimates. All optimization problems treated will use linear constraints unless stated otherwise. There will be one equality constraint, i.e., the full-investment constraint, and one or more inequality constraints such as the long-only and box constraints. More comprehensive constraint types can be found in Ross Bennett (2018) [*Introduction to PortfolioAnalytics*](https://cran.r-project.org/web/packages/PortfolioAnalytics/vignettes/portfolio_vignette.pdf).
108
+
In this Vignette, all mean vectors and covariance matrices in the optimization formula will use standard sample based estimates. All optimization problems treated will use linear constraints unless stated otherwise. There will be one equality constraint, i.e., the full-investment constraint, and one or more inequality constraints such as the long-only and box constraints. More comprehensive constraint types can be found in Ross Bennett (2018) [*Introduction to PortfolioAnalytics*](https://cran.r-project.orgpackage=PortfolioAnalytics/vignettes/portfolio_vignette.pdf).
109
109
110
110
# 3 Maximizing Mean Return
111
111
The objective to maximize mean return is a linear problem of the form:
Copy file name to clipboardExpand all lines: vignettes/portfolio_vignette.Rnw
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -319,7 +319,7 @@ summary(pspec)
319
319
The PortfolioAnalytics package currently supports random portfolios, DEoptim, pso, GenSA, and ROI as back ends. Note that some of the QP/LP problems are solved directly with Rglpk and quadprog. The solver can be specified with the \code{optimize\_method} argument in \code{optimize.portfolio} and \code{optimize.portfolio.rebalancing}.
320
320
321
321
\subsection{DEoptim}
322
-
PortfolioAnalytics uses the \code{DEoptim} function from the R package \verb"DEoptim". Differential evolution is a stochastic global optimization algorithm. See \code{?DEoptim} and the references contained therein for more information. See also \href{https://cran.r-project.org/web/packages/DEoptim/vignettes/DEoptimPortfolioOptimization.pdf}{Large scale portfolio optimization with DEoptim}.
322
+
PortfolioAnalytics uses the \code{DEoptim} function from the R package \verb"DEoptim". Differential evolution is a stochastic global optimization algorithm. See \code{?DEoptim} and the references contained therein for more information. See also \href{https://cran.r-project.org/package=DEoptim/vignettes/DEoptimPortfolioOptimization.pdf}{Large scale portfolio optimization with DEoptim}.
323
323
\subsection{Random Portfolios}
324
324
PortfolioAnalytics has three methods to generate random portfolios.
Copy file name to clipboardExpand all lines: vignettes/robustCovMatForPA.Rmd
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ The following "custom" robust mean vector and covariance matrix estimator functi
41
41
3.`custom.covRob.Mcd`, using the function `covMcd` in the robustbase package
42
42
4.`custom.covRob.TSGS`, using the function `TSGS` in the GSE package.
43
43
44
-
The above "custom" functions were are made possible by existence of a very useful "custom moments" functionality in PortfolioAnalytics, which is described in the Vignette "Custom Moment and Objective Functions" by Ross Bennett (2018), available on CRAN at <https://cran.r-project.org/web/packages/PortfolioAnalytics/index.html>. In the context of a returns mean vector and covariance matrix, the latter are thought of as the moments of orders one and two, loosely speaking the "mean" and "variance".
44
+
The above "custom" functions were are made possible by existence of a very useful "custom moments" functionality in PortfolioAnalytics, which is described in the Vignette "Custom Moment and Objective Functions" by Ross Bennett (2018), available on CRAN at <https://cran.r-project.org/package=PortfolioAnalytics/index.html>. In the context of a returns mean vector and covariance matrix, the latter are thought of as the moments of orders one and two, loosely speaking the "mean" and "variance".
45
45
46
46
It is important to keep in mind that the methods described herein for using robust covariance matrix estimators, implicitly including corresponding robust mean vector estimators, may be used for other important covariance matrix estimators, such as shrinkage covariance matrix estimators, and covariance matrix estimators for unequal asset returns histories.
This custom estimator is based on the *robustbase* package function `covMcd`, which is a highly developed and well-documented robust covariance matrix estimator. The *Mcd* in `covMcd` stands for *Minimum Covariance Determinant* (MCD). This robust covariance matrix estimator uses a sophisticated fast algorithm to search for ***h*** observations out of ***n*** whose classical covariance matrix has the smallest possible determinant. See @RousseeuwDriessen1999. Then the raw MCD estimates of location and scatter are computed based on the sample mean vector and sample covariance matrix of those ***h*** points. Then covMcd uses a "refinement step" to compute the final robust covariance matrix and mean vector. For more details concerning the covMcd function and its parameters, and its "fast" computation, please see the Reference Manual and the Vignette "covMcd-Generalizing the FastMCD" downloadable from the CRAN robustbase package at <https://cran.r-project.org/web/packages/robustbase/index.html>.
244
+
This custom estimator is based on the *robustbase* package function `covMcd`, which is a highly developed and well-documented robust covariance matrix estimator. The *Mcd* in `covMcd` stands for *Minimum Covariance Determinant* (MCD). This robust covariance matrix estimator uses a sophisticated fast algorithm to search for ***h*** observations out of ***n*** whose classical covariance matrix has the smallest possible determinant. See @RousseeuwDriessen1999. Then the raw MCD estimates of location and scatter are computed based on the sample mean vector and sample covariance matrix of those ***h*** points. Then covMcd uses a "refinement step" to compute the final robust covariance matrix and mean vector. For more details concerning the covMcd function and its parameters, and its "fast" computation, please see the Reference Manual and the Vignette "covMcd-Generalizing the FastMCD" downloadable from the CRAN robustbase package at <https://cran.r-project.org/package=robustbase/index.html>.
## A User Custom Function for covRobOGK in `robustbase`
554
554
555
-
The user function `covRobOGK` presented below computes portfolio assets pairwise robust covariance matrix estimates. This method was originally introduced by @GnanadesikanKettenring1972, and improved with an "orthogonalizing step" by @MaronnaZamar2002. For details, see the `covRobOGK` page in the robustbase Reference Manual at <https://cran.r-project.org/web/packages/robustbase/index.html>. Here is the user function based on the robustbase function `covOGK` with default argument values:\
555
+
The user function `covRobOGK` presented below computes portfolio assets pairwise robust covariance matrix estimates. This method was originally introduced by @GnanadesikanKettenring1972, and improved with an "orthogonalizing step" by @MaronnaZamar2002. For details, see the `covRobOGK` page in the robustbase Reference Manual at <https://cran.r-project.org/package=robustbase/index.html>. Here is the user function based on the robustbase function `covOGK` with default argument values:\
0 commit comments