portfolio-class {portfolio} | R Documentation |
Class "portfolio" extends class "portfolioBasic" to include price and share information. Price information must be included in the supplementary "data" slot.
Objects can be created by calls of the form new("portfolio", ...)
.
equity
:"numeric"
containing
the equity for this portfolio.efile
:"character"
containing
the file from which this portfolio was loaded, if applicable. price.var
:"character"
containing the name of the column in the "data" slot to be used in
share and weight calculations.shares
:"data.frame"
containing
a data frame of shares for each position. Must have a unique column
called "id".name
:"character"
containing
the name for this portfolio.date
:"Date"
containing a date
for this portfolio.data
:"data.frame"
containing
supplementary information about the positions in this portfolio.
Must include a unique "id" column. id.var
:"character"
containing the name of the column in the data
slot to be used as
a unique identifier. symbol.var
:"character"
containing the name of the column in the "data" slot to be used as
a descriptive symbol. in.var
:"character"
containing
the name of the column in the "data" slot to be used as a rank
vector in calls to create
. weight.var
:"character"
containing the name of the column in the "data" slot to be used as
weight overrides in calls to create
.ret.var
:"character"
containing
the name of the column in the "data" slot to be used as the return
in calls to performance
.type
:"character"
containing
the type of weight formation to use in calls to create
.
May be one of "relative", "equal", "linear", "sigmoid",
"centroid", or "complex".
Defaults to equal
. size
:"characterOrNumeric"
containing the size of the portfolio to use in calls to
create
. May either contain the number of securities per
side or one of "decile", "quintile", "quartile", "tercile", or
"demile". Defaults to quintile
. weights
:"data.frame"
containing the data frame of weights for this portfolio's
positions. Must contain a unique column called "id".
Class "portfolioBasic"
, directly.
signature(e1 = "portfolio", e2 = "portfolio")
signature(object = "portfolio")
: calculate
shares from price and weight information, and store the results in
the shares
slot.signature(object = "portfolio")
: calculate
weights from share and price information, and store the results in
the weights
slot.signature(object = "portfolio")
: create a
portfolio object in the same manner as portfolioBasic
, but
also compute share amounts.signature(object = "portfolio", id =
"character")
: display information about position id
within this portfolio.
Jeff Enos jeff@kanecap.com