Skip to content

Anomalies in a history ​

match ← All flat growth benchmarks

anomalies(history, { seed }) against fitting in Python, predicting the same history and comparing each value with its 99% range. 180 daily rows of a flat level with three added outliers, which both libraries must flag.

Input ​

benchmark/inputs/v7/flat-anomalies.json: 180 history rows and 0 forecast rows.

Output ​

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

Every forecast row from both libraries.

DateEffect ProphetPython ProphetDifference
2020-01-0134.982434.98245.6e-12
2020-01-0236.075736.07574.4e-12
2020-01-0336.698736.69873.3e-12
2020-01-0435.852035.85203.4e-12
2020-01-0534.057934.05795.4e-12
2020-01-0633.634933.63496.4e-12
2020-01-0733.941533.94156.6e-12
2020-01-0834.982434.98245.6e-12
2020-01-0936.075736.07574.4e-12
2020-01-1036.698736.69873.3e-12
2020-01-1135.852035.85203.4e-12
2020-01-1234.057934.05795.4e-12
2020-01-1333.634933.63496.4e-12
2020-01-1433.941533.94156.6e-12
2020-01-1534.982434.98245.6e-12
2020-01-1636.075736.07574.4e-12
2020-01-1736.698736.69873.3e-12
2020-01-1835.852035.85203.4e-12
2020-01-1934.057934.05795.4e-12
2020-01-2033.634933.63496.4e-12
2020-01-2133.941533.94156.6e-12
2020-01-2234.982434.98245.6e-12
2020-01-2336.075736.07574.4e-12
2020-01-2436.698736.69873.3e-12
2020-01-2535.852035.85203.4e-12
2020-01-2634.057934.05795.4e-12
2020-01-2733.634933.63496.4e-12
2020-01-2833.941533.94156.6e-12
2020-01-2934.982434.98245.6e-12
2020-01-3036.075736.07574.4e-12
2020-01-3136.698736.69873.3e-12
2020-02-0135.852035.85203.4e-12
2020-02-0234.057934.05795.4e-12
2020-02-0333.634933.63496.4e-12
2020-02-0433.941533.94156.6e-12
2020-02-0534.982434.98245.6e-12
2020-02-0636.075736.07574.4e-12
2020-02-0736.698736.69873.3e-12
2020-02-0835.852035.85203.4e-12
2020-02-0934.057934.05795.4e-12
2020-02-1033.634933.63496.4e-12
2020-02-1133.941533.94156.6e-12
2020-02-1234.982434.98245.6e-12
2020-02-1336.075736.07574.4e-12
2020-02-1436.698736.69873.3e-12
2020-02-1535.852035.85203.4e-12
2020-02-1634.057934.05795.4e-12
2020-02-1733.634933.63496.4e-12
2020-02-1833.941533.94156.6e-12
2020-02-1934.982434.98245.6e-12
2020-02-2036.075736.07574.4e-12
2020-02-2136.698736.69873.3e-12
2020-02-2235.852035.85203.4e-12
2020-02-2334.057934.05795.4e-12
2020-02-2433.634933.63496.4e-12
2020-02-2533.941533.94156.6e-12
2020-02-2634.982434.98245.6e-12
2020-02-2736.075736.07574.4e-12
2020-02-2836.698736.69873.3e-12
2020-02-2935.852035.85203.4e-12
2020-03-0134.057934.05795.4e-12
2020-03-0233.634933.63496.4e-12
2020-03-0333.941533.94156.6e-12
2020-03-0434.982434.98245.6e-12
2020-03-0536.075736.07574.4e-12
2020-03-0636.698736.69873.3e-12
2020-03-0735.852035.85203.4e-12
2020-03-0834.057934.05795.4e-12
2020-03-0933.634933.63496.4e-12
2020-03-1033.941533.94156.6e-12
2020-03-1134.982434.98245.6e-12
2020-03-1236.075736.07574.4e-12
2020-03-1336.698736.69873.3e-12
2020-03-1435.852035.85203.4e-12
2020-03-1534.057934.05795.4e-12
2020-03-1633.634933.63496.4e-12
2020-03-1733.941533.94156.6e-12
2020-03-1834.982434.98245.6e-12
2020-03-1936.075736.07574.4e-12
2020-03-2036.698736.69873.3e-12
2020-03-2135.852035.85203.4e-12
2020-03-2234.057934.05795.4e-12
2020-03-2333.634933.63496.4e-12
2020-03-2433.941533.94156.6e-12
2020-03-2534.982434.98245.6e-12
2020-03-2636.075736.07574.4e-12
2020-03-2736.698736.69873.3e-12
2020-03-2835.852035.85203.4e-12
2020-03-2934.057934.05795.4e-12
2020-03-3033.634933.63496.4e-12
2020-03-3133.941533.94156.6e-12
2020-04-0134.982434.98245.6e-12
2020-04-0236.075736.07574.4e-12
2020-04-0336.698736.69873.3e-12
2020-04-0435.852035.85203.4e-12
2020-04-0534.057934.05795.4e-12
2020-04-0633.634933.63496.4e-12
2020-04-0733.941533.94156.6e-12
2020-04-0834.982434.98245.6e-12
2020-04-0936.075736.07574.4e-12
2020-04-1036.698736.69873.3e-12
2020-04-1135.852035.85203.4e-12
2020-04-1234.057934.05795.4e-12
2020-04-1333.634933.63496.4e-12
2020-04-1433.941533.94156.6e-12
2020-04-1534.982434.98245.6e-12
2020-04-1636.075736.07574.4e-12
2020-04-1736.698736.69873.3e-12
2020-04-1835.852035.85203.4e-12
2020-04-1934.057934.05795.4e-12
2020-04-2033.634933.63496.4e-12
2020-04-2133.941533.94156.6e-12
2020-04-2234.982434.98245.6e-12
2020-04-2336.075736.07574.4e-12
2020-04-2436.698736.69873.3e-12
2020-04-2535.852035.85203.4e-12
2020-04-2634.057934.05795.4e-12
2020-04-2733.634933.63496.4e-12
2020-04-2833.941533.94156.6e-12
2020-04-2934.982434.98245.6e-12
2020-04-3036.075736.07574.4e-12
2020-05-0136.698736.69873.3e-12
2020-05-0235.852035.85203.4e-12
2020-05-0334.057934.05795.4e-12
2020-05-0433.634933.63496.4e-12
2020-05-0533.941533.94156.6e-12
2020-05-0634.982434.98245.6e-12
2020-05-0736.075736.07574.4e-12
2020-05-0836.698736.69873.3e-12
2020-05-0935.852035.85203.4e-12
2020-05-1034.057934.05795.4e-12
2020-05-1133.634933.63496.4e-12
2020-05-1233.941533.94156.6e-12
2020-05-1334.982434.98245.6e-12
2020-05-1436.075736.07574.4e-12
2020-05-1536.698736.69873.3e-12
2020-05-1635.852035.85203.4e-12
2020-05-1734.057934.05795.4e-12
2020-05-1833.634933.63496.4e-12
2020-05-1933.941533.94156.6e-12
2020-05-2034.982434.98245.6e-12
2020-05-2136.075736.07574.4e-12
2020-05-2236.698736.69873.3e-12
2020-05-2335.852035.85203.4e-12
2020-05-2434.057934.05795.4e-12
2020-05-2533.634933.63496.4e-12
2020-05-2633.941533.94156.6e-12
2020-05-2734.982434.98245.6e-12
2020-05-2836.075736.07574.4e-12
2020-05-2936.698736.69873.3e-12
2020-05-3035.852035.85203.4e-12
2020-05-3134.057934.05795.4e-12
2020-06-0133.634933.63496.4e-12
2020-06-0233.941533.94156.6e-12
2020-06-0334.982434.98245.6e-12
2020-06-0436.075736.07574.4e-12
2020-06-0536.698736.69873.3e-12
2020-06-0635.852035.85203.4e-12
2020-06-0734.057934.05795.4e-12
2020-06-0833.634933.63496.4e-12
2020-06-0933.941533.94156.6e-12
2020-06-1034.982434.98245.6e-12
2020-06-1136.075736.07574.4e-12
2020-06-1236.698736.69873.3e-12
2020-06-1335.852035.85203.4e-12
2020-06-1434.057934.05795.4e-12
2020-06-1533.634933.63496.4e-12
2020-06-1633.941533.94156.6e-12
2020-06-1734.982434.98245.6e-12
2020-06-1836.075736.07574.4e-12
2020-06-1936.698736.69873.3e-12
2020-06-2035.852035.85203.4e-12
2020-06-2134.057934.05795.4e-12
2020-06-2233.634933.63496.4e-12
2020-06-2333.941533.94156.6e-12
2020-06-2434.982434.98245.6e-12
2020-06-2536.075736.07574.4e-12
2020-06-2636.698736.69873.3e-12
2020-06-2735.852035.85203.4e-12
2020-06-2834.057934.05795.4e-12

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Fit1.83 ms6.85 ms3.7× faster
Simulate uncertainty6.39 ms123 msNot compared: different work
Fit and find anomalies10.4 ms133 ms13× faster

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: 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-growth-reduced-v1"
  },
  "fitRequest": "growth-only",
  "configuration": {
    "growth": "flat",
    "scaling": "absmax",
    "seasonalityMode": "additive",
    "holidaysMode": "additive",
    "changepoints": {
      "mode": "auto",
      "count": 25,
      "range": 0.8
    },
    "changepointPriorScale": 0.05,
    "seasonalities": [
      {
        "name": "weekly",
        "periodDays": 7,
        "fourierOrder": 3,
        "priorScale": 10
      }
    ],
    "events": [],
    "regressors": []
  },
  "pythonOptimizer": {
    "algorithm": "Auto",
    "maxIterations": 10000,
    "newtonFallback": true
  },
  "uncertainty": {
    "seed": 19,
    "samples": 1000,
    "intervalWidth": 0.99,
    "output": "intervals",
    "algorithm": "scalar-continuous-time",
    "evidence": "docs/validation/uncertainty.md#evidence-classes",
    "samplerMemoryLimitBytes": 67108864
  },
  "anomalies": {
    "expected": [
      "2020-01-31T00:00:00.000Z",
      "2020-04-05T00:00:00.000Z",
      "2020-05-30T00:00:00.000Z"
    ]
  }
}

Inspired by Prophet from Meta. Not affiliated with Meta.