[R] Change SetClass in R (library fPortoflio)?
00alex00
alessandro_niglio at yahoo.it
Sun Jul 19 02:19:32 CEST 2015
Hi,
I am using the library fPortfolio e and I would like to change an SetClass.
In particular this function portolioSpec() that as default is:
Model List:
Type: MV
Optimize: minRisk
Estimator: covEstimator
Params: alpha = 0.05 a = 1
Portfolio List:
Target Weights: NULL
Target Return: NULL
Target Risk: NULL
Risk-Free Rate: 0
Number of Frontier Points: 50
Status: NA
Optim List:
Solver: solveRquadprog
Objective: portfolioObjective portfolioReturn portfolioRisk
Options: meq = 2
Trace: FALSE
I want to change the Optimize in "maxReturn". In the .pdf I read:
To optimize a portfolio of assets we first have to specify it. All settings
which specify a portfolio of assets are respresented by a S4 class named
fPFOLIOSPEC.
setClass("fPFOLIOSPEC", representation(
model = "list", portfolio = "list", optim = "list") )
The default settings are as follows:
model = list( type = "MV",
optimize = "minRisk", estimator = "covEstimator", tailRisk = list(), params
= list(alpha = 0.05, a = 2)),
portfolio = list( weights = NULL,
targetReturn = NULL, targetRisk = NULL, riskFreeRate = 0, nFrontierPoints =
50, status = NA),
optim = list( solver = "solveRquadprog", objective = NULL, parames = list(),
control = list(meq = 2), trace = FALSE)
What to optimize?
The list entry optimize from the @model slot describes what should be
optimized. Two choices are possible. Either
\code{"minRisk"}
which minimizes the risk if the target returns is given, or
\code{"maxReturn"}
How I can change in maxReturn, I tried different things but nothing.
Thank you
--
View this message in context: http://r.789695.n4.nabble.com/Change-SetClass-in-R-library-fPortoflio-tp4710034.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list