optimalPort: Estimate the optimal portfolio

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

optimalPort estimates the optimal portfolio based on a stock model and data set.

Usage

1
optimalPort(model, Rf = NULL, shortSell = NULL, eps = 10^(-4))

Arguments

model

An object of class "stockModel".

Rf

An optional argument to update the risk free rate.

shortSell

An optional argument to update short-selling.

eps

An error term to be used in evaluating whether the risk-free rate is acceptable. This argument should not be adjusted except by advanced users.

Details

When the function returns an error regarding the validity of Rf, the risk free rate of return, this is not a bug. That error message means the Rf is too large; it is larger than the expected return of the vertex of the portfolio possibilities curve (the left-most point on this curve). When this occurs, no tangent line can be created along the efficient frontier. The implication is that a lower Rf should be specified to identify a portfolio along the efficient frontier of the portfolio possibilities curve.

This Rf issue has happened relatively frequently with stocks in the last few years. So many stocks are down, which sometimes results in a minimum risk portfolios with an expected return that is negative.

Value

optimalPort outputs an object of class "optimalPortfolio", which is a list of

model

An object of class "stockModel".

X

The allocation of the optimal portfolio.

R

The estimated return associated with allocation X.

risk

The estimated risk associated with allocation X.

Author(s)

David Diez and Nicolas Christou

References

Markowitz, Harry. "Portfolio Selection Efficient Diversification of Investments." New York: John Wiley and Sons, 1959.

Elton, Edwin, J., Gruber, Martin, J., Padberg, Manfred, W. "Simple Criteria for Optimal Portfolio Selection," Journal of Finance, XI, No. 5 (Dec. 1976), pp. 1341-1357.

Elton, Edwin, J., Gruber, Martin, J., Padberg, Manfred, W. "Simple Rules for Optimal Portfolio Selection: The Multi Group Case," Journal of Financial and Quantitative Analysis, XII, No. 3 (Sept. 1977), pp. 329-345.

Elton, Edwin, J., Gruber, Martin, J., Padberg, Manfred, W. "Simple Criteria for Optimal Portfolio Selection: Tracing Out the Efficient Frontier," Journal of Finance, XIII, No. 1 (March 1978), pp. 296-302.

See Also

getReturns, stockModel, testPort

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#===> obtain data <===#
data(stock99)
data(stock94Info)
mgm <- stockModel(stock99, drop=25, model='MGM', industry=stock94Info$industry)

#===> build optimal portfolios <===#
opMgm1 <- optimalPort(mgm)
opMgm2 <- optimalPort(mgm, Rf=0.004)
print(opMgm1)
summary(opMgm1)

#===> plot the optimal porfolios <===#
par(mfrow=c(1,2))
# these plots provide a "head coloring" of
# the allocation by optimalPort
plot(opMgm1)
plot(opMgm2)

#===> additional plotting 1 <===#
par(mfrow=c(1,1))
plot(opMgm1, addNames=TRUE)

#===> additional plotting 2 <===#
plot(opMgm1, optPortOnly=TRUE, colOP=2, pchOP=2)
points(opMgm2, colOP=2, pchOP=4)

#=====> Watch out -- choosing Rf too large causes errors <=====#
data(stock99)
data(stock94Info)
non <- stockModel(stock99, drop=25, model='none',
	industry=stock94Info$industry)
portPossCurve(non)
opTemp <- optimalPort(non, Rf=-10^5)
points(opTemp)
## Error if Rf >= vertex (y value)
#  optimalPort(non, 0.02)
#  optimalPort(non, opTemp$R)
#  optimalPort(non, opTemp$R+0.01)
#  optimalPort(non, opTemp$R-0.01)
## May give error if Rf too close to vertex
#  optimalPort(non, opTemp$R-0.0001)

Example output

Model: multigroup model
Expected return: 0.02261405 
Risk estimate:   0.03694855 

Portfolio allocation:
           C          KEY          WFC          JPM           SO          DUK 
 0.052569458  0.045999119  0.084356562 -0.051159342  0.187128916 -0.088369996 
           D           HE          EIX          LUV          CAL          AMR 
 0.075165315  0.228350880 -0.039051104  0.037223443 -0.052259504 -0.011640518 
        AMGN         GILD         CELG         GENZ         BIIB          CAT 
-0.004808095  0.062024637  0.032316476  0.023034502  0.041623387  0.061097421 
          DE          HIT          IMO          MRO          HES          YPF 
 0.107607556 -0.061847168  0.324097960 -0.010479446 -0.031476213 -0.011504248 
Model: multigroup model
Expected return: 0.02261405 
Risk estimate:   0.03694855 

stockPortfolio documentation built on May 29, 2017, 11:32 a.m.