Additive and multiplicative together
match ← All linear growth benchmarksA 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.
| Date | Effect Prophet | Python Prophet | Difference |
|---|---|---|---|
| 2020-04-06 | 26.0176 | 26.0176 | 1.2e-10 |
| 2020-04-07 | 29.3874 | 29.3874 | 1.4e-10 |
| 2020-04-08 | 44.1660 | 44.1660 | 1.7e-10 |
| 2020-04-09 | 56.3191 | 56.3191 | 1.7e-10 |
| 2020-04-10 | 42.9853 | 42.9853 | 1.5e-10 |
| 2020-04-11 | 50.5414 | 50.5414 | 1.5e-10 |
| 2020-04-12 | 35.6534 | 35.6534 | 1.2e-10 |
| 2020-04-13 | 26.3580 | 26.3580 | 1.3e-10 |
| 2020-04-14 | 31.1089 | 31.1089 | 1.6e-10 |
| 2020-04-15 | 43.3841 | 43.3841 | 1.5e-10 |
| 2020-04-16 | 57.0518 | 57.0518 | 1.7e-10 |
| 2020-04-17 | 60.5134 | 60.5134 | 1.7e-10 |
| 2020-04-18 | 51.1965 | 51.1965 | 1.5e-10 |
| 2020-04-19 | 36.1147 | 36.1147 | 1.2e-10 |
| 2020-04-20 | 45.1353 | 45.1353 | 1.7e-10 |
| 2020-04-21 | 30.1549 | 30.1549 | 1.5e-10 |
| 2020-04-22 | 43.9599 | 43.9599 | 1.6e-10 |
| 2020-04-23 | 57.7845 | 57.7845 | 1.8e-10 |
| 2020-04-24 | 61.2891 | 61.2891 | 1.8e-10 |
| 2020-04-25 | 44.1815 | 44.1815 | 1.5e-10 |
| 2020-04-26 | 37.9433 | 37.9433 | 1.5e-10 |
| 2020-04-27 | 27.0388 | 27.0388 | 1.3e-10 |
| 2020-04-28 | 30.5386 | 30.5386 | 1.5e-10 |
| 2020-04-29 | 44.5183 | 44.5183 | 1.6e-10 |
Timing
Median of all measured repetitions.
| Step | Effect Prophet | Python Prophet | Effect Prophet is |
|---|---|---|---|
| Convert input rows | 51 µs | 522 µs | 10× faster |
| Fit | 5.38 ms | 23.8 ms | 4.4× faster |
| Predict | 428 µs | 4.96 ms | 12× faster |
| Fit and predict | 4.91 ms | 31.8 ms | 6.5× faster |
| Convert, fit and predict | 4.87 ms | 31.6 ms | 6.5× faster |
| First forecast in a new process | 176 ms | 1.47 s | 8.4× faster |
| Save model to JSON | 31 µs | 625 µs | 20× faster |
| Load model from JSON | 141 µs | 3.60 ms | 25× faster |
| Load and predict in a new process | 166 ms | 1.42 s | 8.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
}
}