drawFigure: Efficient frontier and return distribution figures

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

View source: R/drawFigure.R

Description

Plots the efficient frontiers of risky investments and all investments. The optimum points corresponding to the risk aversion coefficient are indicated by dots. Further, the function plots a predictive return distribution figure.

Usage

1
2
3
drawFigure(symbol, yield, vol, beta, r = 1, 
  total = 1, indexVol = 20, nStocks = 7, balanceInt = 12, A = 10, 
  riskfree = FALSE, bor = FALSE)

Arguments

symbol

character vector of the symbols of the risky investments

yield

vector of yields (%)

vol

vector of volatilities (%)

beta

vector of betas (%)

r

risk-free interest rate (%)

total

total investment (for example in euros)

indexVol

volatility of market portfolio (%)

nStocks

number of risky investments in the portfolio

balanceInt

balancing interval of the portfolio in months

A

risk aversion coefficient (see details)

riskfree

is risk-free investment included in the portfolio (logical)

bor

is borrowing (negative risk-free investment) allowed (logical)

Details

The function uses the single-index model and Markovitz portfolio optimization model to find the optimum risky portfolio. The returns are assumed to be log-normally distributed. The maximized function is mu - 0.5*A*var where mu is expected return, A is risk aversion coefficient, and var is return variance.

Value

portfolio

allocation of the total investment (in euros)

returnExpectation

expected portfolio return

returnDeviation

standard deviation of the portfolio

Author(s)

Arto Luoma <arto.luoma@wippies.com>

References

Bodie, Kane, and Marcus (2014) Investments, 10th Global Edition, McGraw-Hill Education, (see Section 7.4 The Markowitz Portfolio Optimization Model and Section 8.2 The Single-Index Model).

See Also

portfOptim

Examples

1
2
3
4
data(stockData, package="RcmdrPlugin.RiskDemo")
with(stockData,drawFigure(symbol=rownames(stockData),yield=divYield,
  vol=vol,beta=beta,r=1,total=100,indexVol=10, 
  nStocks=5,balanceInt=12,A=10,riskfree=TRUE,bor=FALSE))

Example output

Loading required package: rgl
Loading required package: demography
Loading required package: forecast
This is demography 1.22 

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 
4: no DISPLAY variable so Tk is not available 
$portfolio
Risk-free    FORTUM       DNA    KESKOA     ELISA     SAMPO 
 16.55945  21.61110  18.27348  14.85242  14.85242  13.85113 

$returnExpectation
[1] 6.173314

$returnDeviation
         [,1]
[1,] 7.192575

$VaR
      0.5%         1%         5%        10%        50% 
-11.122617  -9.353528  -5.132715  -2.787497   5.961396 

RcmdrPlugin.RiskDemo documentation built on April 6, 2021, 5:06 p.m.