Skip to content

Anomalies in a history ​

match flagged ← All linear growth benchmarks

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

Input ​

benchmark/inputs/v7/linear-anomalies.json: 365 history rows and 0 forecast rows.

Output ​

Largest difference: 0.15 (0.11% of the input's range).

Every forecast row from both libraries.

DateEffect ProphetPython ProphetDifference
2020-01-0112.004211.98250.022
2020-01-0213.538613.51830.020
2020-01-0314.302714.28430.018
2020-01-0413.915513.89880.017
2020-01-0513.078413.06340.015
2020-01-0612.818812.80470.014
2020-01-0713.541813.52870.013
2020-01-0814.984914.97380.011
2020-01-0916.519316.50960.0097
2020-01-1017.283317.27560.0078
2020-01-1116.896216.89000.0061
2020-01-1216.059116.05470.0044
2020-01-1315.799515.79600.0035
2020-01-1416.522416.51990.0025
2020-01-1517.965517.96510.00045
2020-01-1619.499919.50090.00096
2020-01-1720.264020.26690.0029
2020-01-1819.876819.88130.0045
2020-01-1919.039819.04590.0062
2020-01-2018.780118.78730.0071
2020-01-2119.503119.51120.0081
2020-01-2220.946220.95630.010
2020-01-2322.480622.49220.012
2020-01-2423.244723.25810.013
2020-01-2522.857522.87260.015
2020-01-2622.020422.03720.017
2020-01-2721.760821.77850.018
2020-01-2822.483822.50250.019
2020-01-2923.926823.94760.021
2020-01-3025.461225.48340.022
2020-01-3126.225326.24940.024
2020-02-0125.838125.86390.026
2020-02-0225.001125.02850.027
2020-02-0324.741524.76980.028
2020-02-0425.464425.49380.029
2020-02-0526.907526.93890.031
2020-02-0628.441928.47470.033
2020-02-0729.206029.24070.035
2020-02-0828.818828.85520.036
2020-02-0927.981728.01980.038
2020-02-1027.722127.76110.039
2020-02-1128.445128.48500.040
2020-02-1229.888229.93020.042
2020-02-1331.422631.46600.043
2020-02-1432.186632.23200.045
2020-02-1531.799531.84640.047
2020-02-1630.962431.01110.049
2020-02-1730.702830.75240.050
2020-02-1831.416631.46130.045
2020-02-1932.850532.89150.041
2020-02-2034.375834.41230.037
2020-02-2135.130735.16330.033
2020-02-2234.734434.76280.028
2020-02-2333.888233.91240.024
2020-02-2433.619433.63880.019
2020-02-2534.333234.34770.014
2020-02-2635.767235.77790.011
2020-02-2737.292437.29870.0063
2020-02-2838.047438.04970.0023
2020-02-2937.645337.64690.0016
2020-03-0136.793436.79420.00083
2020-03-0236.518936.51820.00066
2020-03-0337.227037.22490.0021
2020-03-0438.655238.65270.0025
2020-03-0540.174740.17130.0035
2020-03-0640.923940.91990.0040
2020-03-0740.521940.51710.0048
2020-03-0839.669939.66440.0055
2020-03-0939.395439.38850.0070
2020-03-1040.103540.09510.0084
2020-03-1141.531741.52300.0088
2020-03-1243.051343.04150.0098
2020-03-1343.800543.79020.010
2020-03-1443.398443.38730.011
2020-03-1542.546542.53470.012
2020-03-1642.272042.25870.013
2020-03-1742.980142.96530.015
2020-03-1844.408344.39320.015
2020-03-1945.927845.91170.016
2020-03-2046.677046.66040.017
2020-03-2146.274946.25760.017
2020-03-2245.423045.40490.018
2020-03-2345.148545.12890.020
2020-03-2445.856645.83550.021
2020-03-2547.284847.26330.021
2020-03-2648.804348.78190.022
2020-03-2749.553549.53050.023
2020-03-2849.151549.12770.024
2020-03-2948.299548.27500.025
2020-03-3048.025047.99900.026
2020-03-3148.733148.70560.028
2020-04-0150.161350.13340.028
2020-04-0251.680951.65200.029
2020-04-0352.430152.40060.029
2020-04-0452.028051.99730.031
2020-04-0551.176151.14420.032
2020-04-0650.901650.86770.034
2020-04-0751.609751.57390.036
2020-04-0853.037953.00130.037
2020-04-0954.557454.51930.038
2020-04-1055.306655.26750.039
2020-04-1154.904654.86420.040
2020-04-1254.052654.01110.042
2020-04-1353.778153.73460.044
2020-04-1454.486254.44080.045
2020-04-1555.914455.86820.046
2020-04-1657.434057.38620.048
2020-04-1758.183258.13440.049
2020-04-1857.781157.73110.050
2020-04-1956.929256.87790.051
2020-04-2056.654756.60150.053
2020-04-2157.362857.30760.055
2020-04-2258.791058.73500.056
2020-04-2360.310560.25310.057
2020-04-2461.059761.00120.058
2020-04-2560.657660.59790.060
2020-04-2659.805759.74480.061
2020-04-2759.531259.46830.063
2020-04-2860.239360.17450.065
2020-04-2961.667561.60190.066
2020-04-3063.187063.11990.067
2020-05-0163.936263.86810.068
2020-05-0263.534263.46480.069
2020-05-0362.682262.61160.071
2020-05-0462.407762.33520.073
2020-05-0563.115863.04130.074
2020-05-0664.544064.46870.075
2020-05-0766.063665.98670.077
2020-05-0866.812866.73490.078
2020-05-0966.358466.29420.064
2020-05-1065.454265.40360.051
2020-05-1165.127465.08970.038
2020-05-1265.783165.75840.025
2020-05-1367.159067.14840.011
2020-05-1468.626368.62900.0027
2020-05-1569.323269.33970.017
2020-05-1668.868868.89900.030
2020-05-1767.964568.00840.044
2020-05-1867.637767.69450.057
2020-05-1968.293568.36320.070
2020-05-2069.669469.75320.084
2020-05-2171.040571.11920.079
2020-05-2271.641371.71550.074
2020-05-2371.090871.16020.069
2020-05-2470.090570.15510.065
2020-05-2569.667569.72660.059
2020-05-2670.227270.28080.054
2020-05-2771.507071.55620.049
2020-05-2872.878172.92230.044
2020-05-2973.478973.51850.040
2020-05-3072.928472.96330.035
2020-05-3171.928071.95810.030
2020-06-0171.444071.47330.029
2020-06-0271.942771.97100.028
2020-06-0373.161473.19000.029
2020-06-0474.471574.49960.028
2020-06-0575.011275.03940.028
2020-06-0674.399774.42770.028
2020-06-0773.338373.36610.028
2020-06-0872.854372.88120.027
2020-06-0973.352973.37900.026
2020-06-1074.571774.59790.026
2020-06-1175.881775.90760.026
2020-06-1276.421576.44740.026
2020-06-1375.809975.83560.026
2020-06-1474.748574.77410.026
2020-06-1574.264674.28920.025
2020-06-1674.763274.78700.024
2020-06-1775.981976.00590.024
2020-06-1877.292077.31550.024
2020-06-1977.831777.85530.024
2020-06-2077.220277.24360.023
2020-06-2176.158876.18200.023
2020-06-2275.674875.69720.022
2020-06-2376.173476.19490.022
2020-06-2477.392277.41390.022
2020-06-2578.702278.72350.021
2020-06-2679.242079.26330.021
2020-06-2778.630478.65160.021
2020-06-2877.569077.59000.021
2020-06-2977.085177.10510.020
2020-06-3077.583777.60290.019
2020-07-0178.802478.82190.019
2020-07-0280.112580.13150.019
2020-07-0380.652280.67130.019
2020-07-0480.040780.05960.019
2020-07-0578.979378.99800.019
2020-07-0678.495378.51310.018
2020-07-0778.994079.01090.017
2020-07-0880.212780.22980.017
2020-07-0981.522881.53950.017
2020-07-1082.062582.07920.017
2020-07-1181.451081.46750.017
2020-07-1280.389680.40600.016
2020-07-1379.905679.92110.015
2020-07-1480.404280.41880.015
2020-07-1581.623081.63780.015
2020-07-1682.933082.94740.014
2020-07-1783.472883.48720.014
2020-07-1882.861282.87550.014
2020-07-1981.799881.81390.014
2020-07-2081.315981.32910.013
2020-07-2181.814581.82680.012
2020-07-2283.033283.04580.013
2020-07-2384.343384.35540.012
2020-07-2484.883084.89520.012
2020-07-2584.271584.28350.012
2020-07-2683.210183.22190.012
2020-07-2782.726182.73700.011
2020-07-2883.224783.23480.010
2020-07-2984.443584.45370.010
2020-07-3085.753585.76340.0098
2020-07-3186.293386.30320.0099
2020-08-0185.681785.69140.0097
2020-08-0284.620384.62990.0095
2020-08-0384.136484.14500.0086
2020-08-0484.635084.64280.0078
2020-08-0585.853785.86170.0080
2020-08-0687.163887.17130.0075
2020-08-0787.703587.71110.0076
2020-08-0887.092087.09940.0074
2020-08-0986.030686.03780.0072
2020-08-1085.546685.55300.0063
2020-08-1186.045386.05070.0055
2020-08-1287.264087.26970.0057
2020-08-1388.574188.57930.0052
2020-08-1489.113889.11910.0053
2020-08-1588.502388.50740.0051
2020-08-1687.440987.44580.0049
2020-08-1786.956986.96090.0040
2020-08-1887.455587.45870.0032
2020-08-1988.674388.67760.0034
2020-08-2089.984389.98730.0030
2020-08-2190.524090.52710.0030
2020-08-2289.912589.91530.0028
2020-08-2388.851188.85380.0027
2020-08-2488.367288.36890.0017
2020-08-2588.865888.86670.00089
2020-08-2690.084590.08560.0011
2020-08-2791.394691.39520.00067
2020-08-2891.934391.93500.00072
2020-08-2991.322891.32330.00053
2020-08-3090.261490.26170.00036
2020-08-3189.777489.77690.00054
2020-09-0190.276090.27460.0014
2020-09-0291.579091.56530.014
2020-09-0392.973392.94670.027
2020-09-0493.597393.55820.039
2020-09-0593.070093.01820.052
2020-09-0692.092992.02840.064
2020-09-0791.693191.61530.078
2020-09-0892.276092.18480.091
2020-09-0993.579093.47550.10
2020-09-1094.973394.85690.12
2020-09-1195.597295.46840.13
2020-09-1295.070094.92840.14
2020-09-1394.092893.93860.15
2020-09-1493.824293.68170.14
2020-09-1594.538394.40750.13
2020-09-1695.972495.85440.12
2020-09-1797.497997.39200.11
2020-09-1898.253098.15980.093
2020-09-1997.856997.77610.081
2020-09-2097.010996.94250.068
2020-09-2196.742496.68570.057
2020-09-2297.456497.41140.045
2020-09-2398.890698.85840.032
2020-09-24100.4160100.39600.020
2020-09-25101.1712101.16380.0074
2020-09-26100.8541100.85780.0037
2020-09-27100.0871100.10190.015
2020-09-2899.897599.92270.025
2020-09-29100.6906100.72620.036
2020-09-30102.2037102.25080.047
2020-10-01103.8082103.86610.058
2020-10-02104.6423104.71160.069
2020-10-03104.3252104.40560.080
2020-10-04103.5583103.64970.091
2020-10-05103.3687103.47050.10
2020-10-06104.1617104.27390.11
2020-10-07105.6947105.79980.11
2020-10-08107.3191107.41620.097
2020-10-09108.1730108.26290.090
2020-10-10107.8758107.95800.082
2020-10-11107.1286107.20330.075
2020-10-12106.9589107.02530.066
2020-10-13107.7718107.82990.058
2020-10-14109.3048109.35570.051
2020-10-15110.9291110.97220.043
2020-10-16111.7831111.81890.036
2020-10-17111.4858111.51400.028
2020-10-18110.7386110.75930.021
2020-10-19110.5689110.58850.020
2020-10-20111.3818111.40030.018
2020-10-21112.9148112.93320.018
2020-10-22114.5392114.55690.018
2020-10-23115.3932115.41070.018
2020-10-24115.0959115.11300.017
2020-10-25114.3488114.36550.017
2020-10-26114.1791114.19460.016
2020-10-27114.9920115.00640.014
2020-10-28116.5250116.53940.014
2020-10-29118.1493118.16300.014
2020-10-30119.0033119.01680.014
2020-10-31118.7060118.71920.013
2020-11-01117.9589117.97160.013
2020-11-02117.7892117.80080.012
2020-11-03118.6021118.61260.010
2020-11-04120.1351120.14550.010
2020-11-05121.7594121.76920.0098
2020-11-06122.6134122.62300.0096
2020-11-07122.3162122.32530.0091
2020-11-08121.5690121.57780.0087
2020-11-09121.3993121.40690.0076
2020-11-10122.2122122.21870.0065
2020-11-11123.7452123.75170.0065
2020-11-12125.3695125.37530.0058
2020-11-13126.2235126.22910.0056
2020-11-14125.9263125.93140.0052
2020-11-15125.1791125.18390.0048
2020-11-16125.0094125.01310.0036
2020-11-17125.8223125.82480.0025
2020-11-18127.3553127.35780.0025
2020-11-19128.9797128.98150.0018
2020-11-20129.8337129.83530.0016
2020-11-21129.5364129.53760.0012
2020-11-22128.7893128.79010.00079
2020-11-23128.6196128.61920.00036
2020-11-24129.4325129.43100.0015
2020-11-25130.9655130.96400.0015
2020-11-26132.5898132.58760.0022
2020-11-27133.4438133.44140.0023
2020-11-28133.1465133.14370.0028
2020-11-29132.3994132.39620.0032
2020-11-30132.2297132.22540.0043
2020-12-01133.0426133.03710.0054
2020-12-02134.5756134.57010.0055
2020-12-03136.1999136.19380.0061
2020-12-04137.0539137.04760.0063
2020-12-05136.7567136.74990.0068
2020-12-06136.0095136.00240.0072
2020-12-07135.8398135.83150.0083
2020-12-08136.6527136.64330.0094
2020-12-09138.1857138.17630.0094
2020-12-10139.8100139.79990.010
2020-12-11140.6640140.65370.010
2020-12-12140.3668140.35600.011
2020-12-13139.6196139.60850.011
2020-12-14139.4499139.43770.012
2020-12-15140.2628140.24940.013
2020-12-16141.7958141.78240.013
2020-12-17143.4202143.40610.014
2020-12-18144.2742144.25990.014
2020-12-19143.9769143.96220.015
2020-12-20143.2298143.21470.015
2020-12-21143.0601143.04380.016
2020-12-22143.8730143.85560.017
2020-12-23145.4060145.38860.017
2020-12-24147.0303147.01220.018
2020-12-25147.8843147.86600.018
2020-12-26147.5870147.56830.019
2020-12-27146.8399146.82080.019
2020-12-28146.6702146.65000.020
2020-12-29147.4831147.46170.021
2020-12-30149.0161148.99470.021

Internal fit differences ​

The forecasts match, so this case passes. Both libraries search for the best-fitting parameters and stop when they are close enough. On this input they stopped at slightly different points, so these internal numbers differ by more than the threshold where we take a closer look.

CheckEffect ProphetPython ProphetThreshold
Fitting objective (lower is a better fit)-1465.4840-1466.45260.01

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Fit7.36 ms30.1 ms4.1× faster
Simulate uncertainty13.0 ms167 msNot compared: different work
Fit and find anomalies25.2 ms199 ms7.9× 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": "linear-output-first-v4"
  },
  "fitRequest": "growth-only",
  "configuration": {
    "growth": "linear",
    "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-02-20T00:00:00.000Z",
      "2020-04-30T00:00:00.000Z",
      "2020-08-18T00:00:00.000Z",
      "2020-10-27T00:00:00.000Z"
    ]
  }
}

Inspired by Prophet from Meta. Not affiliated with Meta.