Portfolio
创建 Portfolio 对象以进行均值-方差投资组合优化和分析
说明
使用 Portfolio
函数创建一个 Portfolio
对象,用于均值-方差投资组合优化。
投资组合优化的主要工作流是创建一个 Portfolio
对象实例来完整指定一个投资组合优化问题,并使用支持的函数对 Portfolio
对象进行运算,以求取和分析有效投资组合。有关此工作流的详细信息,请参阅 Portfolio 对象工作流。
您可通过几种方式使用 Portfolio
对象。要使用 Portfolio
对象创建投资组合优化问题,最简单的语法是:
p = Portfolio;
Portfolio
对象 p
,其中所有对象属性都为空。
Portfolio
对象也接受用一系列名称-值对组参量指定属性及其值。Portfolio
对象接受采用以下一般语法的输入作为属性:
p = Portfolio('property1',value1,'property2',value2, ... );
如果已有 Portfolio
对象,则该语法允许且仅允许 Portfolio
对象的第一个参量为已有对象,后续名称-值对组参量则表示要添加或修改的属性。例如,假定已有 Portfolio
对象 p
,一般语法为:
p = Portfolio(p,'property1',value1,'property2',value2, ... );
输入参量名称不区分大小写,但必须完整指定。此外,部分属性可采用简写参量名称指定(请参阅 简写属性名称)。Portfolio
对象会尝试从输入中检测问题的维度,一旦确定,则对后续输入进行各种标量或矩阵扩展运算,从而简化构建问题的整个过程。此外,Portfolio
对象是值对象,因此,假定有投资组合 p
,则以下代码将创建一个不同于 p
的新对象 q
:
q = Portfolio(p, ...)
创建 Portfolio
对象后,您可以使用关联的对象函数来设置投资组合约束,分析有效边界并验证投资组合模型。
有关均值-方差优化理论基础的详细信息,请参阅 投资组合优化理论。
创建对象
描述
创建一个空的 p
= PortfolioPortfolio
对象,用于均值-方差投资组合优化和分析。然后,您可以使用支持的 "add" 和 "set" 函数将元素添加到 Portfolio
对象。有关详细信息,请参阅创建 Portfolio 对象。
输入参量
属性
对象函数
setAssetList | Set up list of identifiers for assets |
setInitPort | Set up initial or current portfolio |
setDefaultConstraints | 使用总和为 1 的非负权重设置投资组合约束 |
getAssetMoments | 从 Portfolio 对象获取资产收益的均值和协方差 |
setAssetMoments | 设置 Portfolio 对象资产收益的矩(均值和协方差) |
estimateAssetMoments | Estimate mean and covariance of asset returns from data |
setCosts | Set up proportional transaction costs for portfolio |
addEquality | Add linear equality constraints for portfolio weights to existing constraints |
addGroupRatio | Add group ratio constraints for portfolio weights to existing group ratio constraints |
addGroups | Add group constraints for portfolio weights to existing group constraints |
addInequality | Add linear inequality constraints for portfolio weights to existing constraints |
getBounds | Obtain bounds for portfolio weights from portfolio object |
getBudget | Obtain budget constraint bounds from portfolio object |
getCosts | Obtain buy and sell transaction costs from portfolio object |
getEquality | Obtain equality constraint arrays from portfolio object |
getGroupRatio | Obtain group ratio constraint arrays from portfolio object |
getGroups | Obtain group constraint arrays from portfolio object |
getInequality | Obtain inequality constraint arrays from portfolio object |
getOneWayTurnover | Obtain one-way turnover constraints from portfolio object |
setGroups | Set up group constraints for portfolio weights |
setInequality | Set up linear inequality constraints for portfolio weights |
setBounds | Set up bounds for portfolio weights for portfolio |
setBudget | Set up budget constraints for portfolio |
setCosts | Set up proportional transaction costs for portfolio |
setEquality | Set up linear equality constraints for portfolio weights |
setGroupRatio | Set up group ratio constraints for portfolio weights |
setInitPort | Set up initial or current portfolio |
setOneWayTurnover | Set up one-way portfolio turnover constraints |
setTurnover | Set up maximum portfolio turnover constraint |
setTrackingPort | Set up benchmark portfolio for tracking error constraint |
setTrackingError | Set up maximum portfolio tracking error constraint |
setMinMaxNumAssets | Set cardinality constraints on the number of assets invested in a portfolio |
checkFeasibility | Check feasibility of input portfolios against portfolio object |
estimateBounds | Estimate global lower and upper bounds for set of portfolios |
estimateFrontier | 估计有效边界上指定数量的最优投资组合 |
estimateFrontierByReturn | Estimate optimal portfolios with targeted portfolio returns |
estimateFrontierByRisk | Estimate optimal portfolios with targeted portfolio risks |
estimateFrontierLimits | Estimate optimal portfolios at endpoints of efficient frontier |
plotFrontier | 绘制有效边界 |
estimateMaxSharpeRatio | 估计有效投资组合以最大化 Portfolio 对象的夏普比率 |
estimatePortMoments | 估计 Portfolio 对象的投资组合收益矩 |
estimatePortReturn | 估计投资组合收益均值 |
estimatePortRisk | Estimate portfolio risk according to risk proxy associated with corresponding object |
estimateCustomObjectivePortfolio | Estimate optimal portfolio for user-defined objective function for
Portfolio object |
setSolver | Choose main solver and specify associated solver options for portfolio optimization |
setSolverMINLP | Choose mixed integer nonlinear programming (MINLP) solver for portfolio optimization |
示例
详细信息
参考
[1] For a complete list of references for the Portfolio object, see Portfolio Optimization.
版本历史记录
在 R2011a 中推出
另请参阅
plotFrontier
| estimateFrontier
| PortfolioCVaR
| PortfolioMAD
| nearcorr
| covarianceShrinkage
| covarianceDenoising
主题
- 创建 Portfolio 对象
- Working with Portfolio Constraints Using Defaults
- 估计 Portfolio 对象整个有效边界上的有效投资组合
- Estimate Efficient Frontiers for Portfolio Object
- Asset Allocation Case Study
- 使用 Financial Toolbox 的投资组合优化示例
- Portfolio Optimization with Semicontinuous and Cardinality Constraints
- Black-Litterman Portfolio Optimization Using Financial Toolbox
- Portfolio Optimization Using Factor Models
- Bond Portfolio Optimization Using Portfolio Object
- Use Extended Formulation of OuterApproximation Solver Type
- Single Period Goal-Based Wealth Management
- Dynamic Portfolio Allocation in Goal-Based Wealth Management for Multiple Time Periods
- Multiperiod Goal-Based Wealth Management Using Reinforcement Learning
- 投资组合优化理论
- Portfolio 对象工作流
- Portfolio Object Properties and Functions
- Working with Portfolio Objects
- Setting and Getting Properties
- Displaying Portfolio Objects
- Saving and Loading Portfolio Objects
- Estimating Efficient Portfolios and Frontiers
- Arrays of Portfolio Objects
- Subclassing Portfolio Objects
- Conventions for Representation of Data
- 使用 Portfolio 对象进行投资组合优化支持的约束
- Role of Convexity in Portfolio Problems
- When to Use Portfolio Objects Over Optimization Toolbox
- Choosing and Controlling the Solver for Mean-Variance Portfolio Optimization
- Choose MINLP Solvers for Portfolio Problems