experiments

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-experiments"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/6af814d4-70c1-4363-8381-689a51668c4d/social-card.svg?v=3e7ae33eec8b" alt="experiments" width="600" height="315"></a>
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/designs/did-eventsScope experiment:read

Difference-in-differences between treated and control regions from stored events: each cell is the region-days of a group and period, treated as independent samples (valid under parallel trends).

Parameters

project_idstringpathrequired

Request body

application/json
alphanumber
controlstring[]
Control regions; empty = every other region.
geostringrequired
country | region | city | property:<key>.
intervention_atstringrequired
First post-period day.
post_daysintegerrequired
pre_daysintegerrequired
treatedstring[]required
valueobjectrequired
The metric, summed per region and day.
{
  "alpha": 0,
  "control": [
    "string"
  ],
  "geo": "string",
  "intervention_at": "2024-01-01T00:00:00Z",
  "post_days": 0,
  "pre_days": 0,
  "treated": [
    "string"
  ],
  "value": {}
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/did-events" \
  -H "Content-Type: application/json" \
  -d '{"alpha":0,"control":["string"],"geo":"string","intervention_at":"2024-01-01T00:00:00Z","post_days":0,"pre_days":0,"treated":["string"],"value":{}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "ci_high": 0,
  "ci_low": 0,
  "effect": 0,
  "p_value": 0,
  "se": 0
}
Schema
ci_highnumberrequired
ci_lownumberrequired
effectnumberrequired
p_valuenumberrequired
senumberrequired
400
404
503
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/designs/geo-liftScope experiment:read

Geo-lift of an intervention on the treated regions, from stored events.

Parameters

project_idstringpathrequired

Request body

application/json
donorsstring[]
Donor pool; empty = every other region (the 50 largest in the pre-period).
geostringrequired
country | region | city | property:<key>.
intervention_atstringrequired
First treated day.
post_daysintegerrequired
pre_daysintegerrequired
treatedstring[]required
Regions that got the treatment; their daily values are summed.
valueobjectrequired
The metric (event, filters, property to sum, math = unique_persons).
{
  "donors": [
    "string"
  ],
  "geo": "string",
  "intervention_at": "2024-01-01T00:00:00Z",
  "post_days": 0,
  "pre_days": 0,
  "treated": [
    "string"
  ],
  "value": {}
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/geo-lift" \
  -H "Content-Type: application/json" \
  -d '{"donors":["string"],"geo":"string","intervention_at":"2024-01-01T00:00:00Z","post_days":0,"pre_days":0,"treated":["string"],"value":{}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "actual": [
    0
  ],
  "cumulative": 0,
  "effect_per_period": 0,
  "p_value": 0,
  "periods": [
    "string"
  ],
  "placebos": 0,
  "post_rmspe": 0,
  "pre_periods": 0,
  "pre_rmspe": 0,
  "relative_lift": 0,
  "synthetic": [
    0
  ],
  "weights": [
    {
      "region": "string",
      "weight": 0
    }
  ]
}
Schema
actualnumber[]required
cumulativenumberrequired
effect_per_periodnumberrequired
p_valuenumber
Placebo-in-space p-value (rank of the post/pre RMSPE ratio among the donors).
periodsstring[]required
One label per period (a day for geo-lift, the index for synthetic).
placebosintegerrequired
post_rmspenumberrequired
pre_periodsintegerrequired
Index of the first post-period point.
pre_rmspenumberrequired
relative_liftnumber
syntheticnumber[]required
weightsDonorWeight[]required
Donor weights (non-zero ones first).
Show child parameters
regionstringrequired
weightnumberrequired
400
404
503
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/designs/switchback/analyzeScope experiment:read

Treatment effect of a switchback after dropping washout slices, with cluster-robust errors. Assumes carryover fades within `washout` slices and no interference between units.

Parameters

project_idstringpathrequired

Request body

application/json
alphanumber
cluster_bystring
What observations are correlated with each other.
unit | slice
observationsObservation[]required
Show child parameters
sliceintegerrequired
treatedbooleanrequired
unitstringrequired
valuenumberrequired
washoutinteger
{
  "alpha": 0,
  "cluster_by": "unit",
  "observations": [
    {
      "slice": 0,
      "treated": true,
      "unit": "string",
      "value": 0
    }
  ],
  "washout": 0
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/switchback/analyze" \
  -H "Content-Type: application/json" \
  -d '{"alpha":0,"cluster_by":"unit","observations":[{"slice":0,"treated":true,"unit":"string","value":0}],"washout":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "ci_high": 0,
  "ci_low": 0,
  "dropped_washout": 0,
  "effect": 0,
  "p_value": 0,
  "se": 0,
  "used": 0
}
Schema
ci_highnumberrequired
ci_lownumberrequired
dropped_washoutintegerrequired
Observations dropped because they fell inside a washout window.
effectnumberrequired
p_valuenumberrequired
senumberrequired
usedintegerrequired
400
404
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/designs/switchback/analyze-eventsScope experiment:read

Treatment effect of a switchback flag from stored events: the metric per region (or overall) and slice, the arm of each slice recomputed from the flag's design, washout slices dropped.

Parameters

project_idstringpathrequired

Request body

application/json
alphanumber
flag_keystringrequired
The flag whose filters.design is the switchback: its key and salt (the flag's salt, or its id when none is set) decide every block's arm.
geostring
Region key (country | region | city | property:<key>) when the design has a geo_key; absent = one switchback for everyone.
run_lenintegerrequired
Slices per block (the design's run_len).
saltstringrequired
slice_daysintegerrequired
Whole days per slice (event cells are daily).
slicesintegerrequired
startstringrequired
Start of slice 0 (the design's start, truncated to its day).
valueobjectrequired
The metric (event, filters, property to sum, math = unique_persons), summed per day.
washoutinteger
{
  "alpha": 0,
  "flag_key": "string",
  "geo": "string",
  "run_len": 0,
  "salt": "string",
  "slice_days": 0,
  "slices": 0,
  "start": "2024-01-01T00:00:00Z",
  "value": {},
  "washout": 0
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/switchback/analyze-events" \
  -H "Content-Type: application/json" \
  -d '{"alpha":0,"flag_key":"string","geo":"string","run_len":0,"salt":"string","slice_days":0,"slices":0,"start":"2024-01-01T00:00:00Z","value":{},"washout":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
404
503
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/designs/switchback/scheduleScope experiment:read

Time-sliced assignment: every unit alternates control/treatment blocks in a randomised order, balanced per unit. Slice length and the clock are the caller's: slice `k` is just an index.

Parameters

project_idstringpathrequired

Request body

application/json
run_lenintegerrequired
Slices per block (an arm is served for one block before switching).
seedinteger
slicesintegerrequired
unitsstring[]required
Units or regions that switch.
washoutinteger
Slices after a switch flagged washout (served, dropped in analysis).
{
  "run_len": 0,
  "seed": 0,
  "slices": 0,
  "units": [
    "string"
  ],
  "washout": 0
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/switchback/schedule" \
  -H "Content-Type: application/json" \
  -d '{"run_len":0,"seed":0,"slices":0,"units":["string"],"washout":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "slots": [
    {
      "slice": 0,
      "treated": true,
      "unit": "string",
      "washout": true
    }
  ]
}
Schema
slotsSlot[]required
Show child parameters
sliceintegerrequired
treatedbooleanrequired
unitstringrequired
washoutbooleanrequired
The slice follows a switch within the washout window: serve it, but drop it in analysis.
400
404
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/designs/syntheticScope experiment:read

Synthetic control on caller-supplied series.

Parameters

project_idstringpathrequired

Request body

application/json
donorsobjectrequired
{region: series}, each as long as treated.
pre_periodsintegerrequired
Number of pre-period points.
treatednumber[]required
{
  "donors": {},
  "pre_periods": 0,
  "treated": [
    0
  ]
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/synthetic" \
  -H "Content-Type: application/json" \
  -d '{"donors":{},"pre_periods":0,"treated":[0]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
404
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/healthScope experiment:read

Experiment health across the project's newest experiments.

Parameters

project_idstringpathrequired

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/health"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "items": [
    {
      "experiment_id": "string",
      "issues": [
        {
          "detail": "string",
          "kind": "string"
        }
      ],
      "name": "string",
      "status": "string"
    }
  ],
  "scanned": 0
}
Schema
itemsExperimentHealth[]required
Experiments with at least one issue.
Show child parameters
experiment_idstringrequired
issuesExperimentsHealthIssue[]required
Show child parameters
detailstringrequired
kindstringrequired
stalled | flag_edited | paused_long | zombie | undecided.
namestringrequired
statusstringrequired
scannedintegerrequired
404

Updated