constructor for class portfolio
The portfolio object is created with portfolio.spec
. The portfolio
object is an S3 object of class 'portfolio' used to hold the initial asset weights,
constraints, objectives, and other information about the portfolio. The only
required argument to portfolio.spec
is assets
.
portfolio.spec(assets = NULL, category_labels = NULL, weight_seq = NULL, message = FALSE)
assets |
number of assets, or optionally a named vector of assets specifying seed weights. If seed weights are not specified, an equal weight portfolio will be assumed. |
category_labels |
character vector to categorize assets by sector, industry, geography, market-cap, currency, etc. Default NULL |
weight_seq |
seed sequence of weights, see |
message |
TRUE/FALSE. The default is message=FALSE. Display messages if TRUE. |
The portfolio object contains the following elements:
assets
named vector of the seed weights
category_labels
character vector to categorize the assets by sector, geography, etc.
weight_seq
sequence of weights used by random_portfolios
. See generatesequence
constraints
a list of constraints added to the portfolio object with add.constraint
objectives
a list of objectives added to the portfolio object with add.objective
call
the call to portfolio.spec
with all of the specified arguments
an object of class portfolio
Ross Bennett, Brian G. Peterson
data(edhec) pspec <- portfolio.spec(assets=colnames(edhec)) pspec <- portfolio.spec(assets=10, weight_seq=generatesequence())
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.