portfolio-class {portfolio}R Documentation

Class "portfolio"

Description

Class "portfolio" extends class "portfolioBasic" to include price and share information. Price information must be included in the supplementary "data" slot.

Objects from the Class

Objects can be created by calls of the form new("portfolio", ...).

Slots

equity:
Object of class "numeric" containing the equity for this portfolio.e
file:
Object of class "character" containing the file from which this portfolio was loaded, if applicable.
price.var:
Object of class "character" containing the name of the column in the "data" slot to be used in share and weight calculations.
shares:
Object of class "data.frame" containing a data frame of shares for each position. Must have a unique column called "id".
name:
Object of class "character" containing the name for this portfolio.
date:
Object of class "Date" containing a date for this portfolio.
data:
Object of class "data.frame" containing supplementary information about the positions in this portfolio. Must include a unique "id" column.
id.var:
Object of class "character" containing the name of the column in the data slot to be used as a unique identifier.
symbol.var:
Object of class "character" containing the name of the column in the "data" slot to be used as a descriptive symbol.
in.var:
Object of class "character" containing the name of the column in the "data" slot to be used as a rank vector in calls to create.
weight.var:
Object of class "character" containing the name of the column in the "data" slot to be used as weight overrides in calls to create.
ret.var:
Object of class "character" containing the name of the column in the "data" slot to be used as the return in calls to performance.
type:
Object of class "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:
Object of class "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:
Object of class "data.frame" containing the data frame of weights for this portfolio's positions. Must contain a unique column called "id".

Extends

Class "portfolioBasic", directly.

Methods

+
signature(e1 = "portfolio", e2 = "portfolio")
calcShares
signature(object = "portfolio"): calculate shares from price and weight information, and store the results in the shares slot.
calcWeights
signature(object = "portfolio"): calculate weights from share and price information, and store the results in the weights slot.
create
signature(object = "portfolio"): create a portfolio object in the same manner as portfolioBasic, but also compute share amounts.
securityInfo
signature(object = "portfolio", id = "character"): display information about position id within this portfolio.

Author(s)

Jeff Enos jeff@kanecap.com


[Package portfolio version 0.2-2 Index]