portfolio.spec | R Documentation |
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,
name = "portfolio",
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. |
name |
give the portfolio a name, the default name will be 'portfolio' |
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
add.constraint
,
add.objective
,
optimize.portfolio
data(edhec)
pspec <- portfolio.spec(assets=colnames(edhec))
pspec <- portfolio.spec(assets=10, weight_seq=generatesequence())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.