[Returnanalytics-commits] r2332 - in pkg/PortfolioAttribution: . man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 30 10:31:01 CET 2013


Author: braverock
Date: 2013-03-30 10:31:01 +0100 (Sat, 30 Mar 2013)
New Revision: 2332

Added:
   pkg/PortfolioAttribution/man/logLinking.Rd
   pkg/PortfolioAttribution/man/logLinking.zoo.Rd
   pkg/PortfolioAttribution/man/period.apply.EZ.Rd
   pkg/PortfolioAttribution/man/relativeAttribution.Rd
   pkg/PortfolioAttribution/man/relativeAttributionWithoutFactors.Rd
Modified:
   pkg/PortfolioAttribution/
   pkg/PortfolioAttribution/DESCRIPTION
   pkg/PortfolioAttribution/NAMESPACE
Log:
- update roxygen docs
- remove unneeded Suggests


Property changes on: pkg/PortfolioAttribution
___________________________________________________________________
Added: svn:ignore
   + .Rproj.user
.Rhistory
.RData


Modified: pkg/PortfolioAttribution/DESCRIPTION
===================================================================
--- pkg/PortfolioAttribution/DESCRIPTION	2013-03-29 17:47:30 UTC (rev 2331)
+++ pkg/PortfolioAttribution/DESCRIPTION	2013-03-30 09:31:01 UTC (rev 2332)
@@ -1,46 +1,43 @@
-Package: attribution
-Type: Package
-Title: Econometric tools for performance and risk analysis.
-Version: 0.1
-Date: $Date: 2012-06-06 15:18:48 -0500 (Wed, 06 Jun 2012) $
-Author: Andrii Babii
-Maintainer: Brian G. Peterson <brian at braverock.com>
-Description: GSoC stub for attribution
-Depends:
-    R (>= 2.14.0),
-    zoo,
-    xts (>= 0.8),
-    PerformanceAnalytics(>= 1.0.4.3)
-Suggests:
-    Hmisc,
-    MASS,
-    tseries,
-    quadprog,
-    sn,
-    robustbase,
-    quantreg,
-    gplots,
-    ff
-License: GPL
-URL: http://r-forge.r-project.org/projects/returnanalytics/
-Copyright: (c) 2004-2012
-Collate:
-    'Attribution.geometric.R'
-    'attribution.levels.R'
-    'attribution.R'
-    'AttributionFixedIncome.R'
-    'CAPM.dynamic.R'
-    'Carino.R'
-    'Conv.option.R'
-    'DaviesLaker.R'
-    'Frongello.R'
-    'Grap.R'
-    'HierarchyQuintiles.R'
-    'Menchero.R'
-    'Modigliani.R'
-    'Return.annualized.excess.R'
-    'Return.level.R'
-    'MarketTiming.R'
-    'Weight.level.R'
-    'Weight.transform.R'
-    'AcctReturns.R'
+Package: PortfolioAttribution
+Type: Package
+Title: Econometric tools for performance and risk analysis.
+Version: 0.2
+Date: $Date: 2012-06-06 15:18:48 -0500 (Wed, 06 Jun 2012) $
+Author: Andrii Babii
+Maintainer: Brian G. Peterson <brian at braverock.com>
+Description: Portfolio Attribution methods from Bacon, Carino, etc. GSoC 2012 project.
+Depends:
+    R (>= 2.14.0),
+    zoo,
+    xts (>= 0.8),
+    PerformanceAnalytics(>= 1.0.4.3)
+Suggests:
+    plyr
+License: GPL
+URL: http://r-forge.r-project.org/projects/returnanalytics/
+Copyright: (c) 2004-2012
+Collate:
+    'Attribution.geometric.R'
+    'attribution.levels.R'
+    'attribution.R'
+    'AttributionFixedIncome.R'
+    'CAPM.dynamic.R'
+    'Carino.R'
+    'Conv.option.R'
+    'DaviesLaker.R'
+    'Frongello.R'
+    'Grap.R'
+    'HierarchyQuintiles.R'
+    'Menchero.R'
+    'Modigliani.R'
+    'Return.annualized.excess.R'
+    'Return.level.R'
+    'MarketTiming.R'
+    'Weight.level.R'
+    'Weight.transform.R'
+    'AcctReturns.R'
+    'logLinking.R'
+    'logLinkingZoo.R'
+    'periodApplyEZ.R'
+    'relativeAttribution.R'
+    'relativeAttributionWithoutFactors.R'

Modified: pkg/PortfolioAttribution/NAMESPACE
===================================================================
--- pkg/PortfolioAttribution/NAMESPACE	2013-03-29 17:47:30 UTC (rev 2331)
+++ pkg/PortfolioAttribution/NAMESPACE	2013-03-30 09:31:01 UTC (rev 2332)
@@ -1,19 +1,19 @@
-export(AcctReturns)
-export(Attribution)
-export(Attribution.geometric)
-export(Attribution.levels)
-export(AttributionFixedIncome)
-export(CAPM.dynamic)
-export(Carino)
-export(Conv.option)
-export(DaviesLaker)
-export(Frongello)
-export(Grap)
-export(HierarchyQuintiles)
-export(MarketTiming)
-export(Menchero)
-export(Modigliani)
-export(Return.annualized.excess)
-export(Return.level)
-export(Weight.level)
-export(Weight.transform)
+export(AcctReturns)
+export(Attribution)
+export(AttributionFixedIncome)
+export(Attribution.geometric)
+export(Attribution.levels)
+export(CAPM.dynamic)
+export(Carino)
+export(Conv.option)
+export(DaviesLaker)
+export(Frongello)
+export(Grap)
+export(HierarchyQuintiles)
+export(MarketTiming)
+export(Menchero)
+export(Modigliani)
+export(Return.annualized.excess)
+export(Return.level)
+export(Weight.level)
+export(Weight.transform)

Added: pkg/PortfolioAttribution/man/logLinking.Rd
===================================================================
--- pkg/PortfolioAttribution/man/logLinking.Rd	                        (rev 0)
+++ pkg/PortfolioAttribution/man/logLinking.Rd	2013-03-30 09:31:01 UTC (rev 2332)
@@ -0,0 +1,53 @@
+\name{logLinking}
+\alias{logLinking}
+\title{Logarithmic Linking}
+\usage{
+  logLinking(weighted.portfolio.returns,
+    weighted.benchmark.returns, component)
+}
+\arguments{
+  \item{weighted.portfolio.returns}{\code{n x p} data frame
+  containing asset ID (as rownames) and weighted portfolio
+  returns for \code{p} dates}
+
+  \item{weighted.benchmark.returns}{\code{m x p} containing
+  benchmark ID (as rownames) and weighted benchmark returns
+  for \code{p} dates}
+
+  \item{component}{data frame containing ID and attribution
+  component for \code{p} dates (e.g., \code{n x p} for
+  manager selection or \code{m x p} strategy allocation)}
+}
+\value{
+  Returns a list of two objects of class "\code{numeric}"
+  after applying the linking coefficient from the
+  logarithmic method: \item{linked}{ combined
+  \code{component} over time } \item{linked.total}{ sum of
+  combined \code{component} over time }
+}
+\description{
+  Aggregates performance attribution effects over time to
+  produce a multiperiod summary.
+}
+\details{
+  Transforms to a multiperiod arithmetic decomposition by
+  distributing the residual proportionately. Creates
+  linking coefficients \code{k_t / k} and applies to given
+  \code{component} to combine arithmetic attribution
+  effects over time. If \code{weighted.benchmark.returns}
+  is zero for each \code{p} date, then the function returns
+  absolute arithmetic attribution effect, e.g., factor
+  returns or idiosyncratic returns from factor model.
+}
+\author{
+  Eric Zivot
+}
+\references{
+  Christopherson, J., Carino, D., and Ferson, W. (2009)
+  \emph{Portfolio Performance Measurement and
+  Benchmarking}, McGrall-Hill.
+}
+\seealso{
+  \code{\link{relativeAttribution}}
+}
+

Added: pkg/PortfolioAttribution/man/logLinking.zoo.Rd
===================================================================
--- pkg/PortfolioAttribution/man/logLinking.zoo.Rd	                        (rev 0)
+++ pkg/PortfolioAttribution/man/logLinking.zoo.Rd	2013-03-30 09:31:01 UTC (rev 2332)
@@ -0,0 +1,64 @@
+\name{logLinking.zoo}
+\alias{logLinking.zoo}
+\title{Log-linking Function For Use In rollApplyEZ}
+\usage{
+  logLinking.zoo(x, asset.names, strategy.names,
+    component.names,
+    component.type = c("manager", "strategy", "factor"),
+    return.out = c("linked", "linked.total"))
+}
+\arguments{
+  \item{x}{\code{zoo} object containing data to be
+  aggregated.}
+
+  \item{asset.names}{Character vector of asset IDs}
+
+  \item{strategy.names}{Character vector of strategy
+  abbreviations}
+
+  \item{component.names}{Character vector of component
+  names. If \code{component.type="manager"} then
+  \code{component.names} are asset IDs; if
+  \code{component.type="strategy"} then
+  \code{component.names} are strategy abbreviations.if
+  \code{component.type="factor"} then
+  \code{component.names} are factor IDs.}
+
+  \item{component.type}{character string indicating type of
+  attribution. Valid choices are \code{"manager"} for
+  manager selection attribution; \code{"strategy"} for
+  strategy allocation attribution; \code{"factor"} for
+  factor attribution.}
+
+  \item{return.out}{character string indicating output from
+  log-linking function. Valid choices are \code{"linked"}
+  for disaggregated results, and \code{"linked.total"} for
+  total results.}
+}
+\value{
+  A numeric vector of attribution values with the same
+  length as \code{component.names} if
+  \code{return.out="linked"} or a numeric value giving
+  total attribution if \code{return.out = "linked.total"}.
+}
+\description{
+  Function to be passed to rollApplyEZ() for carino linking
+  over user-specified attribution dates and aggregation
+  periods
+}
+\details{
+  %% ~~ If necessary, more details than the description
+  above ~~
+}
+\examples{
+##---- Should be DIRECTLY executable !! ----
+##-- ==>  Define data, use random,
+##--	or do  help(data=index)  for the standard data sets.
+}
+\author{
+  Eric Zivot.
+}
+\seealso{
+  \code{\link{logLinking}}
+}
+

Added: pkg/PortfolioAttribution/man/period.apply.EZ.Rd
===================================================================
--- pkg/PortfolioAttribution/man/period.apply.EZ.Rd	                        (rev 0)
+++ pkg/PortfolioAttribution/man/period.apply.EZ.Rd	2013-03-30 09:31:01 UTC (rev 2332)
@@ -0,0 +1,41 @@
+\name{period.apply.EZ}
+\alias{period.apply.EZ}
+\title{Apply Function Over Specified Interval}
+\usage{
+  period.apply.EZ(x, INDEX, FUN, ...)
+}
+\arguments{
+  \item{x}{data to apply \code{FUN} to}
+
+  \item{INDEX}{numeric vector specifying indexing}
+
+  \item{FUN}{an argument of type \code{function}}
+
+  \item{\dots}{additional arguments for \code{FUN}}
+}
+\value{
+  A vector with length of INDEX minus 1 or a matrix with
+  number of rows length of INDEX minus 1.
+}
+\description{
+  Modified version of period.apply() from package xts to
+  work with logLinking.zoo
+}
+\details{
+  Similar to the rest of the apply family, calculate a
+  specified functions value given a shifting set of data
+  values. The primary difference is that it is that
+  \code{period.apply.EZ} applies a function to
+  non-overlapping intervals along a vector. This is a
+  modified of the function \code{period.apply} in package
+  xts. The modification allows the output to be either a
+  vector with length of \code{INDEX} minus 1 or a matrix
+  with number of rows length of \code{INDEX} minus 1.
+  Useful for applying arbitrary functions over an entire
+  data object by an aribirtary index, as when \code{INDEX}
+  is the result of a call to \code{endpoints}.
+}
+\author{
+  Original code by Jeff Ryan. Modified by Eric Zivot.
+}
+

Added: pkg/PortfolioAttribution/man/relativeAttribution.Rd
===================================================================
--- pkg/PortfolioAttribution/man/relativeAttribution.Rd	                        (rev 0)
+++ pkg/PortfolioAttribution/man/relativeAttribution.Rd	2013-03-30 09:31:01 UTC (rev 2332)
@@ -0,0 +1,79 @@
+\name{relativeAttribution}
+\alias{relativeAttribution}
+\title{Relative Performance Attribution}
+\usage{
+  relativeAttribution(portfolio.df, benchmark.df)
+}
+\arguments{
+  \item{portfolio.df}{\code{n x (3 + f)} data frame
+  containing asset ID (as rownames), Strategy \code{n x 1},
+  Weight \code{n x 1}, Return \code{n x 1},
+  exposure-weighted factor returns \code{n x f} whose
+  column names are the factor IDs}
+
+  \item{benchmark.df}{\code{m x (3 + f)} data frame
+  containing benchmark ID (as rownames), Strategy \code{n x
+  1}, Weights \code{n x 1}, Returns \code{n x 1},
+  exposure-weighted factor returns \code{n x f} whose
+  column names are factor IDs.}
+}
+\value{
+  Returns a list with the following components:
+  \item{portfolio.ret}{ \code{1 x 1} matrix containing
+  portfolio return} \item{benchmark.ret}{ \code{1 x 1}
+  matrix containing benchmark return} \item{relative.ret}{
+  \code{1 x 1} matrix containing relative return}
+  \item{manager}{ \code{n x 1} data frame containing asset
+  ID (as rownames) and \code{ManagerSelection} }
+  \item{manager.total}{ numeric value of total
+  \code{ManagerSelection} component} \item{manager.factor}{
+  \code{n x (1 + f)} data frame containing asset ID (as
+  rownames) and ManagerSelection by \code{Idiosyncratic}
+  \code{n x 1} and factor IDs \code{n x f}}
+  \item{manager.factor.total}{ \code{n x 1} numeric object
+  with asset ID (as rownames) and ManagerSelection
+  component summed over all factor IDs}
+  \item{manager.idiosyncratic.total}{ numeric value of
+  ManagerSelection component summed over all Idiosyncratic
+  values} \item{strategy}{ \code{n x 2} data frame
+  containing benchmark ID (as rownames), \code{Strategy},
+  and \code{StrategyAllocation} } \item{strategy.total}{
+  numeric value of total StrategyAllocation component}
+  \item{strategy.factor}{ \code{m x (1 + f)} data frame
+  containing benchmark ID (as rownames) and
+  StrategyAllocation by \code{Idiosyncratic} \code{m x 1}
+  and factor IDs \code{m x f}}
+  \item{strategy.factor.total}{ \code{m x 1} numeric object
+  with benchmark ID (as rownames) and StrategyAllocation
+  component summed over all factor IDs}
+  \item{strategy.idiosyncratic.total}{ numeric value of
+  StrategyAllocation component summed over all
+  Idiosyncratic values}
+}
+\description{
+  Decompose relative returns into manager selection and
+  strategy allocation components, and then into factor and
+  idiosyncratic return contributions.
+}
+\details{
+  The Brinson model reflects a sector-based investment
+  process and attributes portfolio return to manager
+  selection and strategy allocation effects. Positive
+  contributions are earned by overweighting outperforming
+  managers/sectors and underweighting underperformers. In
+  addition, the manager selection and strategy allocation
+  effects are decomposed into factor and idiosyncratic
+  return contributions as defined by a factor model.
+}
+\author{
+  Eric Zivot
+}
+\references{
+  Davis, B. and Menchero, J. (2009) \emph{Beyond Brinson:
+  Establishing the Link Between Sector and Factor Models},
+  MSCI Barra Research Insights.
+}
+\seealso{
+  \code{\link{logLinking}}
+}
+

Added: pkg/PortfolioAttribution/man/relativeAttributionWithoutFactors.Rd
===================================================================
--- pkg/PortfolioAttribution/man/relativeAttributionWithoutFactors.Rd	                        (rev 0)
+++ pkg/PortfolioAttribution/man/relativeAttributionWithoutFactors.Rd	2013-03-30 09:31:01 UTC (rev 2332)
@@ -0,0 +1,54 @@
+\name{relativeAttributionWithoutFactors}
+\alias{relativeAttributionWithoutFactors}
+\title{Relative Performance Attribution}
+\usage{
+  relativeAttributionWithoutFactors(portfolio.df,
+    benchmark.df)
+}
+\arguments{
+  \item{portfolio.df}{\code{n x 3} data frame containing
+  asset ID (as rownames), Strategy \code{n x 1}, Weight
+  \code{n x 1}, Return \code{n x 1},}
+
+  \item{benchmark.df}{\code{m x 3} data frame containing
+  benchmark ID (as rownames), Strategy \code{n x 1},
+  Weights \code{n x 1}, Returns \code{n x 1},}
+}
+\value{
+  Returns a list with the following components:
+  \item{portfolio.ret}{ \code{1 x 1} matrix containing
+  portfolio return} \item{benchmark.ret}{ \code{1 x 1}
+  matrix containing benchmark return} \item{relative.ret}{
+  \code{1 x 1} matrix containing relative return}
+  \item{manager}{ \code{n x 1} data frame containing asset
+  ID (as rownames) and \code{ManagerSelection} }
+  \item{manager.total}{ numeric value of total
+  \code{ManagerSelection} component} \item{strategy}{
+  \code{n x 2} data frame containing benchmark ID (as
+  rownames), \code{Strategy}, and \code{StrategyAllocation}
+  } \item{strategy.total}{ numeric value of total
+  StrategyAllocation component}
+}
+\description{
+  Decompose relative returns into manager selection and
+  strategy allocation components.
+}
+\details{
+  The Brinson model reflects a sector-based investment
+  process and attributes portfolio return to manager
+  selection and strategy allocation effects. Positive
+  contributions are earned by overweighting outperforming
+  managers/sectors and underweighting underperformers.
+}
+\author{
+  Eric Zivot
+}
+\references{
+  Davis, B. and Menchero, J. (2009) \emph{Beyond Brinson:
+  Establishing the Link Between Sector and Factor Models},
+  MSCI Barra Research Insights.
+}
+\seealso{
+  \code{\link{logLinking}}
+}
+



More information about the Returnanalytics-commits mailing list