Skip to content
All library documents

Constrained Regression for Separating Country and Sector Return Effects

Article Quant Q&A · Author: FinanceDude

Summary

The document describes the Heston and Rouwenhorst approach to decomposing stock returns into a world component, country effects, and industry effects. It uses monthly cross-sectional weighted least squares on individual stocks, with market capitalization as the example weight. To define the country and sector contributions as pure effects, the regression imposes weighted zero-mean constraints on each set of coefficients; the intercept represents the world return.

The response frames implementation as a quadratic optimization problem with linear equality constraints. It notes that constrained least squares can be handled with a quadratic programming package or derived analytically using Lagrange multipliers. It does not provide R package recommendations, code, or a complete constrained formulation, and its simplified constraint example does not spell out the market-weighted country and sector conditions. The note is therefore useful for identifying the mathematical structure, but further work is needed to implement the intended regression correctly.

Key ideas

  • The return decomposition separates world, country, and sector components.
  • The proposed estimator is a monthly cross-sectional weighted least squares regression.
  • Weighted zero-mean constraints identify the pure country and sector effects.
  • Linear equality-constrained least squares can be framed as a quadratic program or solved with Lagrange multipliers.

Tags

Full text
# Any one know how to implement the Heston and Rouwenhorst country-sector effects regression in R?


# Any one know how to implement the Heston and Rouwenhorst country-sector effects regression in R?












Heston and Rouwenhorst (1994) devised an empirical estimation strategy to decompose stock returns into three components: a pure industry effect, a pure country effect, and a world-factor return. Essentially, they perform monthly cross-sectional weighted least squares regressions on individual stock returns to determine "pure" country and sector effects. To estimate "pure" effects, they add constraints to the regression so that the country and sector factors have a weighted mean of zero for each period. Note the intercept in this equation would be interpreted as the global world return.

The sector constraint would be interpreted as the product of each sector's market weight and its sector factor coefficient summed over each sector. Same for country.

As an example, I've built country and sector factors and set up the following regression for one time period but don't know how to add the constraints...

```
lm(Return ~ Country + Sector, data = data, weights = MktCapUsd)
```

Are there packages available to easily add in these types of constraints?

## Answer by Mark5907 (score 2)

https://quant.stackexchange.com/a/53873

Found your post while googling Heston regression. While I am not familiar with R, the problem seems to be a quadratic programming with linear equality constraints.

Minimize: $|y-\beta x|^2$

S.t. $\sum \beta_i = 0$

In python, `cvxpy` can do this. I am sure there are equivalent packages in R.

Also, this problem have analytic solutions, can be solved by Lagrangian Multiplier method, which can be found in any undergrad calculus textbook.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.