---
url: >-
  https://jer-k.github.io/effect-prophet/benchmarks/flat/mcmc-flat-mixed-components.md
---

# Mixed features, two chains

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

96 daily rows with min-max scaling, switchable multiplicative weekly seasonality, an event and a binary regressor. `mcmc_samples=500` on 2 chains: 500 draws, two futures each.

## Input

[`benchmark/inputs/v1/flat-mixed-components.json`](https://github.com/jer-k/effect-prophet/blob/main/benchmark/inputs/v1/flat-mixed-components.json): 96 history rows and 24 forecast rows.

## Output

Largest difference: **0.0062** (0.022% of the input's range).

Every forecast row from both libraries.

| Date | Effect Prophet | Python Prophet | Difference |
| --- | ---: | ---: | ---: |
| 2020-04-06 | 0.2173 | 0.2112 | 0.0062 |
| 2020-04-07 | 7.1351 | 7.1322 | 0.0029 |
| 2020-04-08 | 36.2290 | 36.2324 | 0.0034 |
| 2020-04-09 | 62.8870 | 62.8875 | 0.00049 |
| 2020-04-10 | 35.0022 | 35.0022 | 3.5e-5 |
| 2020-04-11 | 50.4719 | 50.4768 | 0.0050 |
| 2020-04-12 | 19.5123 | 19.5127 | 0.00040 |
| 2020-04-13 | 0.2173 | 0.2112 | 0.0062 |
| 2020-04-14 | 8.3356 | 8.3341 | 0.0015 |
| 2020-04-15 | 35.0022 | 35.0022 | 3.5e-5 |
| 2020-04-16 | 62.8870 | 62.8875 | 0.00049 |
| 2020-04-17 | 69.7632 | 69.7646 | 0.0014 |
| 2020-04-18 | 50.4719 | 50.4768 | 0.0050 |
| 2020-04-19 | 19.5123 | 19.5127 | 0.00040 |
| 2020-04-20 | 36.2027 | 36.2042 | 0.0014 |
| 2020-04-21 | 7.1351 | 7.1322 | 0.0029 |
| 2020-04-22 | 35.0285 | 35.0305 | 0.0020 |
| 2020-04-23 | 62.8870 | 62.8875 | 0.00049 |
| 2020-04-24 | 69.7632 | 69.7646 | 0.0014 |
| 2020-04-25 | 35.0022 | 35.0022 | 3.5e-5 |
| 2020-04-26 | 20.7128 | 20.7147 | 0.0018 |
| 2020-04-27 | 0.2173 | 0.2112 | 0.0062 |
| 2020-04-28 | 7.1351 | 7.1322 | 0.0029 |
| 2020-04-29 | 35.0285 | 35.0305 | 0.0020 |

## Timing

Median of all measured repetitions.

| Step | Effect Prophet | Python Prophet | Effect Prophet is |
| --- | ---: | ---: | --- |
| Fit | 636 ms | 529 ms | 1.2× slower |
| Predict | 312 µs | 4.90 ms | Not compared: different work |
| Save model to JSON | 166 µs | 12.5 ms | 75× faster |
| Load model from JSON | 1.51 ms | 9.74 ms | 6.5× faster |
| Simulate uncertainty | 2.02 ms | 130 ms | Not compared: different work |
| Load and simulate in a new process | 185 ms | 1.56 s | 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, Load and simulate in a new process:** 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": "flat",
    "scaling": "minmax",
    "seasonalityMode": "additive",
    "holidaysMode": "additive",
    "changepoints": {
      "mode": "auto",
      "count": 25,
      "range": 0.8
    },
    "changepointPriorScale": 0.05,
    "seasonalities": [
      {
        "name": "weekly-custom",
        "periodDays": 7,
        "fourierOrder": 2,
        "priorScale": 10,
        "conditionName": "active",
        "mode": "multiplicative"
      }
    ],
    "events": [
      {
        "name": "campaign",
        "date": "2020-01-22",
        "lowerWindowDays": 0,
        "upperWindowDays": 0,
        "priorScale": 10
      }
    ],
    "regressors": [
      {
        "name": "promotion",
        "priorScale": 10,
        "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": 500,
    "seed": 19,
    "chains": 2,
    "pointWidthFraction": 0.15
  }
}
```
