Hi everyone!
I am reading the BLCOP manual, about its
implementation with fPortfolio package. I wonder if you might know if is
possible in
some way to use the backtest function in fPortfolio with BLCOP package?
My code is this (fPortfolio package):
MarkDatab = datatsp
MarkSpecb=portfolioSpec(
model = list(type = "MV", optimize = "minRisk",
estimator = "covEstimator", tailRisk = list(),
params = list(alpha = 0.05)),
portfolio = list(weights = NULL,
targetReturn = NULL, targetRisk = NULL,
riskFreeRate = 0, nFrontierPoints = 50,
status = 0),
optim = list(solver = "solveRquadprog", objective = NULL,
params = list(), control = list(), trace = FALSE))
MarkConstraintsb <- "LongOnly"
MarkBacktestb <- portfolioBacktest()
setSmootherDoubleSmoothing(MarkBacktestb) <- FALSE
setWindowsHorizon(MarkBacktestb) <- "36m"
setSmootherLambda(MarkBacktestb) <- "6m"
setWindowsHorizon(MarkBacktestb) <- "36m"
MarkFormulab <- ACCI ~ MSCI.EAFE+MSCI.USA
MarkPortfoliosb <- portfolioBacktesting(formula = MarkFormulab,
data = MarkDatab, spec = optPorts , constraints = MarkConstraintsb,
backtest = MarkBacktestb, trace = FALSE)
MarkSmoothPortfoliosb <- portfolioSmoothing(object = MarkPortfoliosb,
backtest = MarkBacktestb, trace = FALSE)
backtestPlot(MarkSmoothPortfoliosb, cex = 0.6, font = 1)
The BLCOP code is:
pickMatrix <- matrix(c(1/2, -1, 1/2, rep(0, 3)), nrow = 1, ncol = 6 )
views <- BLViews(P = pickMatrix, q = 0.06,confidences = 100,
assetNames = colnames(datatsp))
views
priorMeans <- rep(0, 6)
priorVarcov <- cov.mcd(datatsp)$cov
marketPosterior <- posteriorEst(views = views, sigma = priorVarcov,
mu = priorMeans, tau = 1/2)
optPorts <- optimalPortfolios.fPort(marketPosterior, optimizer =
"minvariancePortfolio")
If it is possible to backtest Black-Litterman posterior in fPortfolio, how
should I do it?
Thank you very much in advance, if you could lead me in the right direction!
Best Regards and thanks for any comments!
Paul Kushch
[[alternative HTML version deleted]]
_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should
go.