> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryprofound.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How metrics are calculated

> The formula behind every report metric, a worked example, and how to reproduce each number from the Answers API.

Every report metric is computed for each AI model separately, then averaged
across models with equal weight. A model with many runs counts the same as a
model with few.

$$
\text{score} = \frac{\text{score}_{\text{model 1}} + \text{score}_{\text{model 2}} + \dots + \text{score}_{\text{model } M}}{M}
$$

`M` is the number of models with at least one brand mention in the period. A
model that mentioned other brands but not yours counts in `M` with a score of
0\. Average position is the exception: it is averaged over the models in which
your brand appeared. Counts, such as the number of mentions or citations, are
summed across models rather than averaged.

## Per-model formulas

### Visibility score

$$
\frac{\text{runs mentioning your brand}}{\text{runs mentioning any brand}}
$$

Any brand named in the answer counts, not only your configured competitors,
unless you have excluded it under Configure Competitors in brand settings.
Runs in which no brand was mentioned are excluded from both the numerator and
the denominator. Returned as 0 to 1 by the API and shown as a percentage in
the platform.

### Share of voice

$$
\frac{\text{mentions of your brand}}{\text{mentions of all brands}}
$$

Each brand counts once per run. Returned as 0 to 1 by the API and shown as a
percentage in the platform.

### Average position

$$
\frac{\text{sum of your brand's positions}}{\text{runs mentioning your brand}}
$$

The first brand mentioned in an answer is position 1. Lower is better.

### Citation share

$$
\frac{\text{citations of your domain}}{\text{all citations}}
$$

Returned as 0 to 1 by the API and shown as a percentage in the platform. The
same formula applies per page when grouping by `page`.

### Positive and negative sentiment

$$
100 \times \frac{\text{positive claims about your brand}}{\text{all claims about your brand}}
$$

Negative sentiment is the same with negative claims. Every claim is scored
positive or negative, so the two values sum to 100. Both are returned as 0 to
100\.

## Example: two models

|                                | Model A       | Model B         | Result                        |
| ------------------------------ | ------------- | --------------- | ----------------------------- |
| Runs that mentioned any brand  | 10            | 20              |                               |
| Runs that mentioned your brand | 4             | 12              |                               |
| **Visibility score**           | 4 / 10 = 0.40 | 12 / 20 = 0.60  | (0.40 + 0.60) / 2 = **0.50**  |
| Mentions of all brands         | 25            | 40              |                               |
| **Share of voice**             | 4 / 25 = 0.16 | 12 / 40 = 0.30  | (0.16 + 0.30) / 2 = **0.23**  |
| Sum of your brand's positions  | 7             | 27              |                               |
| **Average position**           | 7 / 4 = 1.75  | 27 / 12 = 2.25  | (1.75 + 2.25) / 2 = **2.00**  |
| Citations, all domains         | 50            | 100             |                               |
| Citations of your domain       | 5             | 25              |                               |
| **Citation share**             | 5 / 50 = 0.10 | 25 / 100 = 0.25 | (0.10 + 0.25) / 2 = **0.175** |
| Claims about your brand        | 20            | 10              |                               |
| Positive claims                | 12            | 8               |                               |
| **Positive sentiment**         | 12 / 20 = 60  | 8 / 10 = 80     | (60 + 80) / 2 = **70**        |
| Negative claims                | 8             | 2               |                               |
| **Negative sentiment**         | 8 / 20 = 40   | 2 / 10 = 20     | (40 + 20) / 2 = **30**        |

<Warning>
  Pooling runs across models first (16 / 30 = 0.53 for visibility) is wrong
  because each model has equal weight. Averaging daily scores to produce a
  monthly score is also wrong. A monthly score is computed from all runs in the
  month. See [Conventions & gotchas](/cookbook/setup/conventions#don%E2%80%99t-average-daily-rows-to-get-a-period-score).
</Warning>

## Reproducing metrics from the Answers API

[Get Answers](/rest-api/reports/query-answers-v2) returns one row per run.
The fields you need:

| Field                                                               | Contents                                                                                                                                                                                |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run_id`                                                            | Identifier of the run.                                                                                                                                                                  |
| `model`                                                             | The AI model, as an id and a name.                                                                                                                                                      |
| `mentions`                                                          | Names of the brands in the answer, in order of first appearance, each brand once. Every brand Profound detected is listed, including any you have excluded under Configure Competitors. |
| `citations`                                                         | URLs cited in the answer. `citation_details` adds the hostname and title of each and must be requested explicitly in `include`.                                                         |
| `sentiment_claims`                                                  | Claims extracted from the answer, each with `asset` (the brand it is about), `theme`, `claim`, and `sentiment` (`positive` or `negative`).                                              |
| `date`, `topic`, `tags`, `prompt`, `prompt_id`, `region`, `persona` | Current labels for the run. Use them to select rows.                                                                                                                                    |

Select the rows for the dates, topics, tags, and regions you want. If you have
excluded brands under Configure Competitors, remove them from `mentions` first.
For each metric, compute the fraction below for each model separately, then
average the per-model values. Multiply the sentiment values by 100.

| Metric             | Numerator                                                                               | Denominator                                               |
| ------------------ | --------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| Visibility score   | Distinct `run_id` where your brand is in `mentions`                                     | Distinct `run_id` where `mentions` is not empty           |
| Share of voice     | Distinct `run_id` where your brand is in `mentions`                                     | Entries in `mentions`, summed over all runs               |
| Average position   | Sum of your brand's positions in `mentions`, with the first entry as 1                  | Distinct `run_id` where your brand is in `mentions`       |
| Citation share     | Entries in `citations` whose hostname is your domain                                    | Entries in `citations`, summed over all runs              |
| Positive sentiment | Entries in `sentiment_claims` where `asset` is your brand and `sentiment` is `positive` | Entries in `sentiment_claims` where `asset` is your brand |
| Negative sentiment | Entries in `sentiment_claims` where `asset` is your brand and `sentiment` is `negative` | Entries in `sentiment_claims` where `asset` is your brand |

Count by `run_id`, join topics and prompts on their ids, match brands by name,
and use Eastern Time dates.

<Note>
  The Answers API returns the topic, tags, and brand list as they are configured
  today, so numbers you rebuild from it change when your configuration changes.
  See [Why past numbers change](/cookbook/metrics/why-past-numbers-change).
</Note>
