> For the complete documentation index, see [llms.txt](https://docs.numer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.numer.ai/numerai-signals/scoring/meta-portfolio-contribution-mpc.md).

# Meta Portfolio Contribution (MPC)

With the invention of [Alpha](/numerai-signals/scoring/alpha.md), Signals also needed a metric that is similar to MMC, but uses the same neutralizers matrix and sample weights vector that Alpha uses. An analog to the Meta Model could be the Stake-Weighted Portfolio (**SWP**). In this case, Meta Portfolio Contribution evaluates the extent to which a signal enhances the Alpha of the SWP.

To find an individual user’s contribution, we could then increase their stake in the SWP slightly and measure the change in Alpha of the SWP. This is basically just a gradient of SWP Alpha with respect to a users stake.

Given the following data:

* signals matrix ***S*** (NaNs filled w/ 0.5)
* stake-weights ***p***
* neutralization matrix ***N***
* weight vector ***v***

We generate neutral weights per signal:

```
s` = normalize(rank(s))^1.5
neutral_preds = s` - (N @ (N.T @ (v * s`)))
neutral_weights = neutral_preds * v
```

Next, stake-weight-average them into the **SWP** and normalize total weight:

```
SWP = (p * user_stakes).sum()
SWP = SWP - SWP.mean()
SWP = SWP / sum(abs(SWP))
```

Then, we can calculate the Alpha of the SWP:

```
SWP_Alpha = SWP * target
```

Finally, MPC is the gradient of SWP Alpha with respect to stakes:

```
MPC = gradient(SWP_Alpha, p)
```

When paid on MPC, data scientists will be incentivized to stake on signals that push the Numerai Signals tournament to be valuable to the Numerai hedge fund. [Visit the numerai-tools repository](https://github.com/numerai/numerai-tools/blob/eb4252237b92f379fcd8c4dc2e0b546fae218f10/numerai_tools/scoring.py#L577-L620) if you're interested in reading the code for MPC.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.numer.ai/numerai-signals/scoring/meta-portfolio-contribution-mpc.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
