---
url: >-
  https://jer-k.github.io/effect-prophet/benchmarks/linear/mcmc-linear-sampled-regressor-model.md
---

# A regressor forecast by its own sampled model

&#x20;[← All linear growth benchmarks](/benchmarks/linear)

The same rows and regressors, with the regressor's own model sampled too: `predictor: { mcmc }` against `regressor_predictor={"mcmc_samples": 300}`, with the main model's seed and 4 chains, which Python passes on from `fit`. Its 600 draws give 1,200 simulated values, one for each of the main model's 1,200 futures.

## Input

[`benchmark/inputs/v1/map-regressors-medium.json`](https://github.com/jer-k/effect-prophet/blob/main/benchmark/inputs/v1/map-regressors-medium.json): 256 history rows and 64 forecast rows.

## Output

Largest difference: **0.018** (0.019% of the input's range).

Every forecast row from both libraries.

| Date | Effect Prophet | Python Prophet | Difference |
| --- | ---: | ---: | ---: |
| 2020-09-13 | 107.1914 | 107.1875 | 0.0039 |
| 2020-09-14 | 107.6416 | 107.6367 | 0.0049 |
| 2020-09-15 | 108.0900 | 108.0832 | 0.0069 |
| 2020-09-16 | 108.5383 | 108.5311 | 0.0072 |
| 2020-09-17 | 107.9404 | 107.9338 | 0.0066 |
| 2020-09-18 | 110.1909 | 110.1834 | 0.0075 |
| 2020-09-19 | 110.6399 | 110.6308 | 0.0091 |
| 2020-09-20 | 111.0890 | 111.0789 | 0.010 |
| 2020-09-21 | 110.1006 | 110.0908 | 0.0098 |
| 2020-09-22 | 110.5574 | 110.5457 | 0.012 |
| 2020-09-23 | 111.0185 | 111.0066 | 0.012 |
| 2020-09-24 | 111.4826 | 111.4698 | 0.013 |
| 2020-09-25 | 112.3122 | 112.3000 | 0.012 |
| 2020-09-26 | 112.7869 | 112.7732 | 0.014 |
| 2020-09-27 | 115.0657 | 115.0522 | 0.014 |
| 2020-09-28 | 115.5529 | 115.5386 | 0.014 |
| 2020-09-29 | 116.4039 | 116.3902 | 0.014 |
| 2020-09-30 | 113.7021 | 113.6867 | 0.015 |
| 2020-10-01 | 114.2085 | 114.1926 | 0.016 |
| 2020-10-02 | 114.7252 | 114.7078 | 0.017 |
| 2020-10-03 | 115.6042 | 115.5880 | 0.016 |
| 2020-10-04 | 116.1313 | 116.1145 | 0.017 |
| 2020-10-05 | 116.6681 | 116.6508 | 0.017 |
| 2020-10-06 | 119.0120 | 118.9943 | 0.018 |
| 2020-10-07 | 119.9212 | 119.9061 | 0.015 |
| 2020-10-08 | 120.4784 | 120.4631 | 0.015 |
| 2020-10-09 | 119.2452 | 119.2278 | 0.017 |
| 2020-10-10 | 119.8161 | 119.7979 | 0.018 |
| 2020-10-11 | 120.7491 | 120.7329 | 0.016 |
| 2020-10-12 | 121.3325 | 121.3161 | 0.016 |
| 2020-10-13 | 120.5183 | 120.5002 | 0.018 |
| 2020-10-14 | 121.1120 | 121.0944 | 0.018 |
| 2020-10-15 | 123.8664 | 123.8521 | 0.014 |
| 2020-10-16 | 124.4697 | 124.4545 | 0.015 |
| 2020-10-17 | 125.0734 | 125.0576 | 0.016 |
| 2020-10-18 | 123.8778 | 123.8610 | 0.017 |
| 2020-10-19 | 124.8442 | 124.8297 | 0.015 |
| 2020-10-20 | 125.4537 | 125.4382 | 0.016 |
| 2020-10-21 | 126.0643 | 126.0495 | 0.015 |
| 2020-10-22 | 126.6734 | 126.6587 | 0.015 |
| 2020-10-23 | 127.6424 | 127.6291 | 0.013 |
| 2020-10-24 | 130.0497 | 130.0367 | 0.013 |
| 2020-10-25 | 130.6531 | 130.6400 | 0.013 |
| 2020-10-26 | 129.8536 | 129.8398 | 0.014 |
| 2020-10-27 | 129.0103 | 128.9968 | 0.014 |
| 2020-10-28 | 129.6060 | 129.5931 | 0.013 |
| 2020-10-29 | 130.1959 | 130.1830 | 0.013 |
| 2020-10-30 | 130.7837 | 130.7698 | 0.014 |
| 2020-10-31 | 131.7212 | 131.7088 | 0.012 |
| 2020-11-01 | 132.2934 | 132.2807 | 0.013 |
| 2020-11-02 | 134.6617 | 134.6497 | 0.012 |
| 2020-11-03 | 135.2229 | 135.2097 | 0.013 |
| 2020-11-04 | 136.1355 | 136.1249 | 0.011 |
| 2020-11-05 | 134.8818 | 134.8699 | 0.012 |
| 2020-11-06 | 135.4240 | 135.4109 | 0.013 |
| 2020-11-07 | 135.9563 | 135.9420 | 0.014 |
| 2020-11-08 | 135.4349 | 135.4216 | 0.013 |
| 2020-11-09 | 135.9530 | 135.9392 | 0.014 |
| 2020-11-10 | 136.4636 | 136.4482 | 0.015 |
| 2020-11-11 | 138.7678 | 138.7534 | 0.014 |
| 2020-11-12 | 139.6213 | 139.6085 | 0.013 |
| 2020-11-13 | 140.1135 | 140.0991 | 0.014 |
| 2020-11-14 | 138.7966 | 138.7799 | 0.017 |
| 2020-11-15 | 139.2723 | 139.2547 | 0.018 |

## Timing

Median of all measured repetitions.

| Step | Effect Prophet | Python Prophet | Effect Prophet is |
| --- | ---: | ---: | --- |
| Fit | 5.02 s | 4.42 s | 1.1× slower |
| Predict | 1.68 ms | 113 ms | Not compared: different work |
| Simulate uncertainty | 16.3 ms | 500 ms | Not compared: different work |

Some steps aren't compared, because the two libraries' public calls produce different outputs. Their times show what each call costs, not which library is faster.

* **Predict:** Python's `predict` on a posterior also computes every component's range over the draws, while Effect Prophet's `predict` returns point forecasts and leaves ranges to `predictWithIntervals`.
* **Simulate uncertainty:** Python's `predict(vectorized=False)` also builds the point forecast and every component, while Effect Prophet's `predictUncertainty` returns only the ranges.

## Settings

The case declaration both libraries ran.

```json
{
  "kind": "map",
  "comparison": {
    "kind": "equivalent-posterior",
    "evidenceId": "posterior-nuts-v1"
  },
  "configuration": {
    "growth": "linear",
    "scaling": "absmax",
    "seasonalityMode": "additive",
    "holidaysMode": "additive",
    "changepoints": {
      "mode": "auto",
      "count": 25,
      "range": 0.8
    },
    "changepointPriorScale": 0.05,
    "seasonalities": [],
    "events": [],
    "regressors": [
      {
        "name": "binary-auto",
        "priorScale": 10,
        "standardization": "auto"
      },
      {
        "name": "numeric-auto",
        "priorScale": 10,
        "standardization": "auto",
        "predictor": {
          "mcmcSamples": 300
        }
      },
      {
        "name": "numeric-always",
        "priorScale": 7,
        "standardization": "always"
      },
      {
        "name": "numeric-never",
        "priorScale": 5,
        "standardization": "never"
      }
    ]
  },
  "pythonOptimizer": {
    "algorithm": "Auto",
    "maxIterations": 10000,
    "newtonFallback": true,
    "sigFigs": 12
  },
  "uncertainty": {
    "seed": 19,
    "samples": 1000,
    "intervalWidth": 0.8,
    "output": "intervals",
    "algorithm": "scalar-continuous-time",
    "evidence": "docs/validation/uncertainty.md#evidence-classes",
    "samplerMemoryLimitBytes": 67108864
  },
  "mcmc": {
    "samples": 300,
    "seed": 19,
    "pointWidthFraction": 0.15
  }
}
```
