---
url: >-
  https://jer-k.github.io/effect-prophet/benchmarks/flat/uncertainty-flat-mixed-components-full-intervals-512.md
---

# Ranges with mixed effects

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

80% ranges from 512 simulated paths for every past and future date.

## 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: **2.3e-7** (< 0.0001% of the input's range).

Every forecast row from both libraries.

| Date | Effect Prophet | Python Prophet | Difference |
| --- | ---: | ---: | ---: |
| 2020-04-06 | 0.2150 | 0.2150 | 2.7e-8 |
| 2020-04-07 | 7.1321 | 7.1321 | 1.3e-7 |
| 2020-04-08 | 36.2298 | 36.2298 | 2.3e-7 |
| 2020-04-09 | 62.8870 | 62.8870 | 2.3e-7 |
| 2020-04-10 | 35.0026 | 35.0026 | 1.1e-7 |
| 2020-04-11 | 50.4761 | 50.4761 | 3.4e-8 |
| 2020-04-12 | 19.5153 | 19.5153 | 1.8e-8 |
| 2020-04-13 | 0.2150 | 0.2150 | 2.7e-8 |
| 2020-04-14 | 8.3336 | 8.3336 | 1.4e-7 |
| 2020-04-15 | 35.0026 | 35.0026 | 1.1e-7 |
| 2020-04-16 | 62.8870 | 62.8870 | 2.3e-7 |
| 2020-04-17 | 69.7642 | 69.7642 | 1.4e-7 |
| 2020-04-18 | 50.4761 | 50.4761 | 3.4e-8 |
| 2020-04-19 | 19.5153 | 19.5153 | 1.8e-8 |
| 2020-04-20 | 36.2041 | 36.2041 | 1.2e-7 |
| 2020-04-21 | 7.1321 | 7.1321 | 1.3e-7 |
| 2020-04-22 | 35.0283 | 35.0283 | 2.2e-7 |
| 2020-04-23 | 62.8870 | 62.8870 | 2.3e-7 |
| 2020-04-24 | 69.7642 | 69.7642 | 1.4e-7 |
| 2020-04-25 | 35.0026 | 35.0026 | 1.1e-7 |
| 2020-04-26 | 20.7168 | 20.7168 | 1.0e-8 |
| 2020-04-27 | 0.2150 | 0.2150 | 2.7e-8 |
| 2020-04-28 | 7.1321 | 7.1321 | 1.3e-7 |
| 2020-04-29 | 35.0283 | 35.0283 | 2.2e-7 |

## Timing

Median of all measured repetitions.

| Step | Effect Prophet | Python Prophet | Effect Prophet is |
| --- | ---: | ---: | --- |
| Convert input rows | 52 µs | 532 µs | 10× faster |
| Save model to JSON | 18 µs | 668 µs | 37× faster |
| Load model from JSON | 189 µs | 3.60 ms | 19× faster |
| Simulate uncertainty | 985 µs | 72.1 ms | Not compared: different work |
| First simulation in a new process | 169 ms | 1.52 s | Not compared: different work |
| Load and simulate in a new process | 164 ms | 1.51 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.

* **Simulate uncertainty, First simulation in a new process, 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-objective",
    "evidenceId": "flat-map-mixed-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"
      }
    ]
  },
  "effectOptimizer": {
    "algorithm": "lbfgs",
    "maxIterations": 10000,
    "fallback": "none",
    "lbfgs": {
      "historySize": 5,
      "initAlpha": 0.001,
      "tolObj": 1e-12,
      "tolRelObj": 10000,
      "tolGrad": 1e-8,
      "tolRelGrad": 10000000,
      "tolParam": 1e-8
    }
  },
  "pythonOptimizer": {
    "algorithm": "LBFGS",
    "maxIterations": 10000,
    "newtonFallback": false
  },
  "uncertainty": {
    "seed": 19,
    "samples": 512,
    "intervalWidth": 0.8,
    "output": "intervals",
    "algorithm": "scalar-continuous-time",
    "evidence": "docs/validation/uncertainty.md#evidence-classes",
    "samplerMemoryLimitBytes": 67108864
  }
}
```
