Main Content

categoryAttribution

Compute performance attribution for portfolio of each category

Since R2022b

Description

[AggregateCategoryAttribution,PeriodicCategoryAttribution] = categoryAttribution(brinsonAttributionObj) computes the performance attribution for the portfolio of each category using the Brinson model.

example

Examples

collapse all

This example shows how to create a brinsonAttribution object and then use categoryAttribution to compute the performance attribution of the portfolio for each category (sector).

Prepare Data

Create a table for the monthly prices for four assets.

GM =[17.82;22.68;19.37;20.28];
 HD = [39.79;39.12;40.67;40.96];
 KO = [38.98;39.44;40.00;40.20];
 PG = [56.38;57.08;57.76;55.54];
 MonthlyPrices  = table(GM,HD,KO,PG);

Use tick2ret to define the monthly returns.

 MonthlyReturns = tick2ret(MonthlyPrices.Variables)';
 [NumAssets,NumPeriods] = size(MonthlyReturns); 

Define the periods.

 Period = ones(NumAssets*NumPeriods,1);
 for k = 1:NumPeriods
     Period(k*NumAssets+1:end,1) = Period(k*NumAssets,1) + 1;
 end

Define the categories for the four assets.

 Name = repmat(string(MonthlyPrices.Properties.VariableNames(:)),NumPeriods,1);
 Categories = repmat(categorical([ ...
     "Consumer Discretionary"; ...
     "Consumer Discretionary"; ...
     "Consumer Staples"; ...
     "Consumer Staples"]),NumPeriods,1);

Define benchmark and portfolio weights.

 BenchmarkWeight = repmat(1./NumAssets.*ones(NumAssets, 1),NumPeriods,1);
 PortfolioWeight = repmat([1;0;1;1]./3,NumPeriods,1);

Create AssetTable Input

Create AssetTable as the input for the brinsonAttribution object.

 AssetTable = table(Period, Name, ...
      MonthlyReturns(:), Categories, PortfolioWeight, BenchmarkWeight, ...
      VariableNames=["Period","Name","Return","Category","PortfolioWeight","BenchmarkWeight"])
AssetTable=12×6 table
    Period    Name     Return             Category           PortfolioWeight    BenchmarkWeight
    ______    ____    _________    ______________________    _______________    _______________

      1       "GM"      0.27273    Consumer Discretionary        0.33333             0.25      
      1       "HD"    -0.016838    Consumer Discretionary              0             0.25      
      1       "KO"     0.011801    Consumer Staples              0.33333             0.25      
      1       "PG"     0.012416    Consumer Staples              0.33333             0.25      
      2       "GM"     -0.14594    Consumer Discretionary        0.33333             0.25      
      2       "HD"     0.039622    Consumer Discretionary              0             0.25      
      2       "KO"     0.014199    Consumer Staples              0.33333             0.25      
      2       "PG"     0.011913    Consumer Staples              0.33333             0.25      
      3       "GM"      0.04698    Consumer Discretionary        0.33333             0.25      
      3       "HD"    0.0071306    Consumer Discretionary              0             0.25      
      3       "KO"        0.005    Consumer Staples              0.33333             0.25      
      3       "PG"    -0.038435    Consumer Staples              0.33333             0.25      

Create brinsonAttribution Object

Use brinsonAttribution to create the brinsonAttribution object.

 BrinsonPAobj = brinsonAttribution(AssetTable)
BrinsonPAobj = 
  brinsonAttribution with properties:

                  NumAssets: 4
         NumPortfolioAssets: 3
         NumBenchmarkAssets: 4
                 NumPeriods: 3
              NumCategories: 2
                  AssetName: [4x1 string]
                AssetReturn: [4x3 double]
              AssetCategory: [4x3 categorical]
       PortfolioAssetWeight: [4x3 double]
       BenchmarkAssetWeight: [4x3 double]
    PortfolioCategoryReturn: [2x3 double]
    BenchmarkCategoryReturn: [2x3 double]
    PortfolioCategoryWeight: [2x3 double]
    BenchmarkCategoryWeight: [2x3 double]
            PortfolioReturn: 0.0598
            BenchmarkReturn: 0.0540
               ActiveReturn: 0.0059

Compute Performance Attribution

Use the brinsonAttribution object with categoryAttribution to compute the performance attribution of the portfolio for each category.

[AggregateCategoryAttribution,PeriodicCategoryAttribution] = categoryAttribution(BrinsonPAobj)
AggregateCategoryAttribution=2×5 table
           Category           Allocation     Selection     Interaction    ActiveReturn
    ______________________    __________    ___________    ___________    ____________

    Consumer Discretionary    -0.0071764       0.030316      -0.010105       0.013034 
    Consumer Staples          -0.0071764    -9.4005e-19    -3.1335e-19     -0.0071764 

PeriodicCategoryAttribution=6×7 table
    Period    LinkingCoefficient           Category           Allocation     Selection     Interaction    ActiveReturn
    ______    __________________    ______________________    __________    ___________    ___________    ____________

      1            0.97032          Consumer Discretionary     -0.009653       0.072391       -0.02413       0.038608 
      1            0.97032          Consumer Staples           -0.009653              0              0      -0.009653 
      2             1.0838          Consumer Discretionary     0.0055181      -0.046391       0.015464      -0.025409 
      2             1.0838          Consumer Staples           0.0055181    -8.6736e-19    -2.8912e-19      0.0055181 
      3             1.0391          Consumer Discretionary    -0.0036477      0.0099623     -0.0033208      0.0029938 
      3             1.0391          Consumer Staples          -0.0036477              0              0     -0.0036477 

Input Arguments

collapse all

Brinson attribution model, specified as a brinsonAttribution object.

Data Types: object

Output Arguments

collapse all

Category attribution aggregated over all periods, returned as a table with the following columns:

  • Category — Asset category

  • Allocation — Category allocation effect for the category

  • Selection — Effect of selecting individual assets within the category

  • Interaction — Allocation-selection interaction effect

  • ActiveReturn — Active return compared with benchmark

Category attribution for each period, returned as a table with the following columns:

  • Period — Time period numbers (1 for the first period, 2 for the second period, and so on)

  • LinkingCoefficient — Linking coefficients used to aggregate the attribution results over all time periods

  • Category — Asset category

  • Allocation — Category allocation effect for the category

  • Selection — Effect of selecting individual assets within the category

  • Interaction — Allocation-selection interaction effect

  • ActiveReturn — Active return compared with benchmark

References

[1] Brinson, G. P. and Fachler, N. “Measuring Non-US Equity Portfolio Performance.” Journal of Portfolio Management. Spring 1985: 73–76.

[2] Brinson, G. P., Hood, L. R., and Beebower, G. L. “Determinants of Portfolio Performance.” Financial Analysts Journal. Vol. 42, No. 4, 1986: 39–44.

[3] Menchero, J. “Multiperiod Arithmetic Attribution.” Financial Analysts Journal. Vol. 60, No. 4, 2004: 76–91.

[4] Tuttle, D. L., Pinto, J. E., and McLeavey, D. W. Managing Investment Portfolios: A Dynamic Process. Third Edition. CFA Institute, 2007.

Version History

Introduced in R2022b