Skip to content

Additive and multiplicative together ​

match ← All linear growth benchmarks

A multiplicative switchable weekly pattern with an additive event and regressor, on 96 daily rows.

Input ​

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

Output ​

Largest difference: 1.8e-10 (< 0.0001% of the input's range).

Every forecast row from both libraries.

DateEffect ProphetPython ProphetDifference
2020-04-0626.017626.01761.2e-10
2020-04-0729.387429.38741.4e-10
2020-04-0844.166044.16601.7e-10
2020-04-0956.319156.31911.7e-10
2020-04-1042.985342.98531.5e-10
2020-04-1150.541450.54141.5e-10
2020-04-1235.653435.65341.2e-10
2020-04-1326.358026.35801.3e-10
2020-04-1431.108931.10891.6e-10
2020-04-1543.384143.38411.5e-10
2020-04-1657.051857.05181.7e-10
2020-04-1760.513460.51341.7e-10
2020-04-1851.196551.19651.5e-10
2020-04-1936.114736.11471.2e-10
2020-04-2045.135345.13531.7e-10
2020-04-2130.154930.15491.5e-10
2020-04-2243.959943.95991.6e-10
2020-04-2357.784557.78451.8e-10
2020-04-2461.289161.28911.8e-10
2020-04-2544.181544.18151.5e-10
2020-04-2637.943337.94331.5e-10
2020-04-2727.038827.03881.3e-10
2020-04-2830.538630.53861.5e-10
2020-04-2944.518344.51831.6e-10

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Convert input rows51 µs522 µs10× faster
Fit5.38 ms23.8 ms4.4× faster
Predict428 µs4.96 ms12× faster
Fit and predict4.91 ms31.8 ms6.5× faster
Convert, fit and predict4.87 ms31.6 ms6.5× faster
First forecast in a new process176 ms1.47 s8.4× faster
Save model to JSON31 µs625 µs20× faster
Load model from JSON141 µs3.60 ms25× faster
Load and predict in a new process166 ms1.42 s8.5× faster

Settings ​

The case declaration both libraries ran.

json
{
  "kind": "map",
  "comparison": {
    "kind": "equivalent-objective",
    "evidenceId": "linear-output-first-v4"
  },
  "configuration": {
    "growth": "linear",
    "scaling": "absmax",
    "seasonalityMode": "multiplicative",
    "holidaysMode": "additive",
    "changepoints": {
      "mode": "explicit",
      "timestamps": [
        "2020-02-10T00:00:00.000Z"
      ]
    },
    "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"
      }
    ]
  },
  "effectOptimizer": {
    "algorithm": "auto",
    "maxIterations": 10000,
    "fallback": "newton",
    "lbfgs": {
      "historySize": 5,
      "initAlpha": 0.001,
      "tolObj": 1e-12,
      "tolRelObj": 10000,
      "tolGrad": 1e-8,
      "tolRelGrad": 10000000,
      "tolParam": 1e-8
    }
  },
  "pythonOptimizer": {
    "algorithm": "Auto",
    "maxIterations": 10000,
    "newtonFallback": true,
    "sigFigs": 12
  }
}

Inspired by Prophet from Meta. Not affiliated with Meta.