Skip to content

Commit

Permalink
28 revisit comments on changing dimension (#30)
Browse files Browse the repository at this point in the history
* README corrected

* README
  • Loading branch information
tschm authored Jun 21, 2023
1 parent cf8e979 commit 7532207
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ The risk model is injected into the function.
The function is not aware of the precise risk model used.
All risk models are required to implement the `estimate` method.

Note that factor risk models work with weights for the assets but also with weights for the factors.
To stay flexible we are applying thiS `**kwargs` pattern to the function above.
## A first example

A first example is a risk model based on the sample covariance matrix.
Expand All @@ -59,8 +61,8 @@ This is good practice and keeps the code clean and maintainable.

In a backtest we don't have to reconstruct the problem in every iteration.
We can simply update the risk model with the new data and solve the problem again.
If the dimension of the problem is changing during the test we expect
a new problem has to be constructed though.
The implementation of the risk models is flexible enough to deal with changing dimensions
of the underlying weight space.

## Risk models

Expand All @@ -80,12 +82,12 @@ The factor time series are $f_1, \ldots, f_k$. The loadings are the coefficients
$\beta_{ji}$.
The residual returns $\epsilon_i$ are assumed to be uncorrelated with the factors.

Any position $w$ in weight space projects to a position $y = \beta w$ in factor space.
Any position $w$ in weight space projects to a position $y = \beta^T w$ in factor space.
The variance for a position $w$ is the sum of the variance of the
systematic returns explained by the factors and the variance of the idiosyncratic returns.

```math
Var(r) = Var(\beta w) + Var(\epsilon w)
Var(r) = Var(\beta^T w) + Var(\epsilon w)
```

We assume the residual returns are uncorrelated and hence
Expand Down Expand Up @@ -113,8 +115,7 @@ We expose a method to compute the first $k$ principal components.

### cvar

XXX: Conditional value at risk
Relies on cxxpy's `sum_largest` function.
We currently also support the conditional value at risk (CVaR) as a risk measure.



Expand Down

0 comments on commit 7532207

Please sign in to comment.