---
url: https://jer-k.github.io/effect-prophet/benchmarks/linear/map-events-small.md
---

# Events with windows

&#x20;[← All linear growth benchmarks](/benchmarks/linear)

96 daily rows with six event dates, including days before and after each one.

## Input

[`benchmark/inputs/v1/map-events-small.json`](https://github.com/jer-k/effect-prophet/blob/main/benchmark/inputs/v1/map-events-small.json): 96 history rows and 28 forecast rows.

## Output

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

Every forecast row from both libraries.

| Date | Effect Prophet | Python Prophet | Difference |
| --- | ---: | ---: | ---: |
| 2020-04-06 | 45.3776 | 45.3776 | 7.3e-12 |
| 2020-04-07 | 45.7074 | 45.7074 | 7.3e-12 |
| 2020-04-08 | 46.0372 | 46.0372 | 7.3e-12 |
| 2020-04-09 | 46.3670 | 46.3670 | 7.2e-12 |
| 2020-04-10 | 46.6968 | 46.6968 | 7.2e-12 |
| 2020-04-11 | 47.0266 | 47.0266 | 7.2e-12 |
| 2020-04-12 | 47.3564 | 47.3564 | 7.2e-12 |
| 2020-04-13 | 47.6862 | 47.6862 | 7.2e-12 |
| 2020-04-14 | 48.0160 | 48.0160 | 7.2e-12 |
| 2020-04-15 | 50.9026 | 50.9026 | 5.5e-12 |
| 2020-04-16 | 51.5628 | 51.5628 | 4.8e-12 |
| 2020-04-17 | 51.9025 | 51.9025 | 6.8e-12 |
| 2020-04-18 | 51.7825 | 51.7825 | 6.1e-12 |
| 2020-04-19 | 49.6649 | 49.6649 | 7.1e-12 |
| 2020-04-20 | 49.9947 | 49.9947 | 7.0e-12 |
| 2020-04-21 | 50.3245 | 50.3245 | 7.0e-12 |
| 2020-04-22 | 48.4429 | 48.4429 | 5.7e-12 |
| 2020-04-23 | 48.7026 | 48.7026 | 7.3e-12 |
| 2020-04-24 | 51.3139 | 51.3139 | 7.0e-12 |
| 2020-04-25 | 51.6437 | 51.6437 | 7.0e-12 |
| 2020-04-26 | 51.9735 | 51.9735 | 6.9e-12 |
| 2020-04-27 | 52.3033 | 52.3033 | 6.9e-12 |
| 2020-04-28 | 52.6331 | 52.6331 | 6.9e-12 |
| 2020-04-29 | 52.9629 | 52.9629 | 6.9e-12 |
| 2020-04-30 | 53.2927 | 53.2927 | 6.9e-12 |
| 2020-05-01 | 53.6225 | 53.6225 | 6.8e-12 |
| 2020-05-02 | 53.9523 | 53.9523 | 6.8e-12 |
| 2020-05-03 | 54.2821 | 54.2821 | 6.8e-12 |

## Timing

Median of all measured repetitions.

| Step | Effect Prophet | Python Prophet | Effect Prophet is |
| --- | ---: | ---: | --- |
| Convert input rows | 20 µs | 481 µs | 24× faster |
| Fit | 7.31 ms | 29.7 ms | 4.1× faster |
| Predict | 281 µs | 4.34 ms | 15× faster |
| Fit and predict | 6.75 ms | 34.0 ms | 5.0× faster |
| Convert, fit and predict | 6.63 ms | 34.8 ms | 5.2× faster |
| First forecast in a new process | 183 ms | 1.47 s | 8.0× faster |
| Save model to JSON | 22 µs | 617 µs | 28× faster |
| Load model from JSON | 193 µs | 3.30 ms | 17× faster |
| Load and predict in a new process | 165 ms | 1.45 s | 8.8× faster |

## Settings

The case declaration both libraries ran.

```json
{
  "kind": "linear-map",
  "comparison": {
    "kind": "equivalent-objective",
    "evidenceId": "linear-output-first-v4"
  },
  "configuration": {
    "effectMap": "explicit",
    "changepoints": {
      "mode": "explicit",
      "timestamps": [
        "2020-02-10T00:00:00.000Z"
      ]
    },
    "changepointPriorScale": 0.2,
    "seasonalities": [],
    "events": [
      {
        "name": "release",
        "date": "2020-01-21",
        "lowerWindowDays": -1,
        "upperWindowDays": 2,
        "priorScale": 10
      },
      {
        "name": "release",
        "date": "2020-02-20",
        "lowerWindowDays": -1,
        "upperWindowDays": 2,
        "priorScale": 10
      },
      {
        "name": "release",
        "date": "2020-04-16",
        "lowerWindowDays": -1,
        "upperWindowDays": 2,
        "priorScale": 10
      },
      {
        "name": "campaign",
        "date": "2020-01-22",
        "lowerWindowDays": -1,
        "upperWindowDays": 0,
        "priorScale": 6
      },
      {
        "name": "campaign",
        "date": "2020-03-04",
        "lowerWindowDays": -1,
        "upperWindowDays": 0,
        "priorScale": 6
      },
      {
        "name": "campaign",
        "date": "2020-04-23",
        "lowerWindowDays": -1,
        "upperWindowDays": 0,
        "priorScale": 6
      }
    ],
    "regressors": []
  },
  "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
  }
}
```
