---
title: "Residualization"
method: POST
path: "/factors/residualization"
tags: ["Factors"]
---

# Residualization

`POST /factors/residualization`

Compute the residuals of a factor against a set of factors, using a returns-based linear regression analysis. 

References
* [Factor Research, Factor Exposure Analysis: Exploring Residualization](https://insights.factorresearch.com/research-factor-exposure-analysis-exploring-residualization/)
* [Catalina B. Garcia, Román Salmeron, Claudia Garcia & Jose Garcia (2019): Residualization: justification, properties and application, Journal of Applied Statistics](https://doi.org/10.1080/02664763.2019.1701638)

## Request body

- object
  - `factors` object[], required
    - `dependentFactorReturns` number[] — dependentFactorReturns[t] is the return of the dependent factor at the time t; there must be exactly one array in factors with property dependentFactorReturns
    - `explanatoryFactorReturns` number[] — explanatoryFactorReturns[t] is the return of the explanatory factor at the time t; there must be at least one array in factors with property explanatoryFactorReturns; all the explanatoryFactorReturns arrays must have the same length, equal to that of the dependentFactorReturns array
  - `riskFreeReturn` number — The constant risk-free arithmetic return over the considered time period, in percentage; exclusive with riskFreeReturns
  - `riskFreeReturns` number[] — riskFreeReturns[t] is the risk-free arithmetic return at the time t; the riskFreeReturns array must have the same length, equal to that of the dependentFactorReturns array; exclusive with riskFreeReturn
  - `dependentFactorResidualizationMethod` 'ordinaryLeastSquares' | 'robustLeastSquares' — The method to use to residualize the desired factor

## Response `200`

OK

- object
  - `factors` object[], required
    - `residualizedFactorReturns` number[], required — residualizedFactorReturns[t] is the return of the residualized factor at the time t

---

[API](https://skmtc.net/portfoliooptimizer/apis/portfolio-optimizer.md) · [All operations](https://skmtc.net/portfoliooptimizer/apis/portfolio-optimizer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portfoliooptimizer/portfolio-optimizer/revisions/dee9caba1913/schema)
