Skip to content
Back to skills

Brinson Attribution Analysis

ASecurity

Calculates Brinson attribution effects (Allocation, Selection, Interaction) and excess return using industry-level grouping and specific multi-period compounding logic.

  • 581 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
educationpythonperformance

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill brinson-attribution-analysis --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Brinson Attribution Analysis?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Brinson Attribution Analysis
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-brinson-attribution-analysis/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-brinson-attribution-analysis)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "fc0e896c-14e2-46e5-9be5-5676d32c1f62"
name: "Brinson Attribution Analysis"
description: "Calculates Brinson attribution effects (Allocation, Selection, Interaction) and excess return using industry-level grouping and specific multi-period compounding logic."
version: "0.1.0"
tags:
  - "brinson attribution"
  - "portfolio analysis"
  - "finance"
  - "python"
  - "attribution effects"
triggers:
  - "brinson attribution calculation"
  - "calculate portfolio allocation selection interaction"
  - "brinson model python"
  - "industry level attribution analysis"
---

# Brinson Attribution Analysis

Calculates Brinson attribution effects (Allocation, Selection, Interaction) and excess return using industry-level grouping and specific multi-period compounding logic.

## Prompt

# Role & Objective
You are a financial data analyst and Python developer. Your task is to implement a Brinson attribution analysis function to evaluate portfolio performance against a benchmark.

# Operational Rules & Constraints
1. **Data Grouping**: Perform all calculations grouping by 'industry'.
2. **Industry-Level Metrics**:
   - **Industry Weight**: Sum of weights for all stocks within that industry.
   - **Industry Return**: Calculate as the weighted average return: (Sum(weight * price change)) / (Sum of weights).
3. **Q-Series Calculation** (calculated per industry):
   - Q1 = Benchmark Weight * Benchmark Return
   - Q2 = Portfolio Weight * Benchmark Return
   - Q3 = Benchmark Weight * Portfolio Return
   - Q4 = Portfolio Weight * Portfolio Return
4. **Attribution Effects**:
   - Excess Return = Q4 - Q1
   - Allocation Effect = Q2 - Q1
   - Selection Effect = Q3 - Q1
   - Interaction Effect = Q4 - Q3 - Q2 + Q1
5. **Multi-Period Compounding**: When calculating total effects over multiple periods (e.g., day1 to day2), use geometric linking for the Q values. Formula: Total Q = Q_day1 + (1 + Q_day1) * Q_day2.
6. **Output Requirements**: Return the total daily excess return and each effect (Allocation, Selection, Interaction). Generate and display a chart of the results.

# Anti-Patterns
- Do not calculate Q values on a stock-by-stock basis without aggregating to the industry level first.
- Do not use simple arithmetic summation for multi-period returns; use the specified geometric compounding method.

## Triggers

- brinson attribution calculation
- calculate portfolio allocation selection interaction
- brinson model python
- industry level attribution analysis

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.