portReturn: Estimate return and risk of a portfolio

Description Usage Arguments Value Author(s) See Also Examples

Description

Given a portfolio allocation X and a model, identify the estimated return and risk associated with X.

Usage

1
portReturn(model, X)

Arguments

model

An object of class "stockModel".

X

The portfolio allocation.

Value

portReturn returns a list of the following items:

R

The estimated return.

V

The estimated risk squared.

X

The allocation, which is the second argument.

ticker

The tickers from the model.

model

An object of class "stockModel", which is the same model provided to the function.

Author(s)

David Diez

See Also

stockModel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#===> basics <===#
data(stock94)
sm <- stockModel(stock94, model='SIM', index=25)
op <- optimalPort(sm)
prOp <- portReturn(sm, op$X)
prUn <- portReturn(sm, rep(1, 24)/24)
print(prOp)
summary(prOp)
summary(prUn)

#===> plotting a "portReturn" object <===#
par(mfrow=c(2,2))
plot(prOp) # provides a heat map of the allocation
plot(prUn) # a boring heat map of allocation
plot(prOp, col=2:5) # many random colors
plot(prUn, col=1) # all black

jankcorn/stockPortfolio documentation built on May 14, 2019, 9:35 a.m.