
stockModel
object that is based on the single index model, the beta parameters may be adjusted using either the Blume or Vasicek technique. This function outputs a new object of class "stockModel"
based on the single index model.
adjustBeta(model, model2 = NULL, method = c("Blume", "Vasicek"))
"stockModel"
that is based on the single index model. If using Blume's method, then this model should be for the first period."stockModel"
that is based on the single index model. If using Blume's method, then this model should be for the second period. If using Vasicek's method, then this model is ignored."Blume"
(default) or "Vasicek"
. Setting it to any character string other than "B"
, "b"
, "Blume"
, "blume"
, or "1"
will result in using the Vasicek method.adjustBeta
returns an object of class "stockModel"
.
getReturns
, stockModel
, optimalPort
#===> build two single index models <===#
data(stock94)
data(stock99)
data(stock94Info)
sim1 <- stockModel(stock94, model='SIM',
industry=stock94Info$industry, index=25)
sim2 <- stockModel(stock99, model='SIM',
industry=stock94Info$industry, index=25)
#===> adjust the betas <===#
# the output is a new stock model
simBlu <- adjustBeta(sim1, sim2)
simVas <- adjustBeta(sim2, method='Vasicek')
#===> build optimal portfolios <===#
opSim <- optimalPort(sim2)
opBlu <- optimalPort(simBlu)
opVas <- optimalPort(simVas)
#===> test portfolios on 2004-9 <===#
data(stock04)
tpSim <- testPort(stock04, opSim)
tpBlu <- testPort(stock04, opBlu)
tpVas <- testPort(stock04, opVas)
#===> compare performances <===#
plot(tpSim, ylim=c(1,2.2))
lines(tpBlu, col=2, lty=2)
lines(tpVas, col=3, lty=3)
legend('topleft', col=1:3, lty=1:3, legend=c('none', 'Blume', 'Vasicek'))
Run the code above in your browser using DataLab