Skip to content

Mixed features, 600 draws ​

match ← All linear growth benchmarks

96 daily rows with switchable multiplicative weekly seasonality, an event, a binary regressor and two automatic changepoints. mcmc_samples=300: 4 chains of 150 draws, and 80% ranges from 1,200 simulated futures, two per draw, on 24 rows.

Input ​

benchmark/inputs/v1/linear-mixed-components.json: 96 history rows and 24 forecast rows.

Output ​

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

Every forecast row from both libraries.

DateEffect ProphetPython ProphetDifference
2020-04-0626.016526.01680.00028
2020-04-0729.386929.38730.00048
2020-04-0844.164944.16640.0015
2020-04-0956.315956.31950.0036
2020-04-1042.983142.98560.0025
2020-04-1150.538550.54230.0038
2020-04-1235.651135.65360.0025
2020-04-1326.356326.35730.00093
2020-04-1431.108031.10840.00039
2020-04-1543.381143.38440.0033
2020-04-1657.047357.05230.0050
2020-04-1760.508360.51380.0054
2020-04-1851.192551.19750.0050
2020-04-1936.111536.11500.0034
2020-04-2045.131945.13520.0033
2020-04-2130.153030.15490.0019
2020-04-2243.956443.96090.0045
2020-04-2357.778757.78510.0065
2020-04-2461.282761.28960.0069
2020-04-2544.177144.18190.0048
2020-04-2637.939637.94310.0035
2020-04-2727.035927.03810.0022
2020-04-2830.536130.53880.0027
2020-04-2944.513944.51940.0055

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Fit139 ms186 ms1.3× faster
Predict288 µs5.07 msNot compared: different work
Save model to JSON273 µs13.0 ms48× faster
Load model from JSON2.62 ms9.23 ms3.5× faster
Simulate uncertainty2.95 ms164 msNot compared: different work
Load and simulate in a new process187 ms1.64 sNot 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": "linear",
    "scaling": "absmax",
    "seasonalityMode": "multiplicative",
    "holidaysMode": "additive",
    "changepoints": {
      "mode": "auto",
      "count": 2,
      "range": 0.8
    },
    "changepointPriorScale": 0.2,
    "seasonalities": [
      {
        "name": "weekly-custom",
        "periodDays": 7,
        "fourierOrder": 2,
        "priorScale": 10,
        "conditionName": "active"
      }
    ],
    "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": 300,
    "seed": 19,
    "pointWidthFraction": 0.15
  }
}

Inspired by Prophet from Meta. Not affiliated with Meta.