Prediction Intervals
Forecast with uncertainty quantification.
Generate Predictions
SELECT
scenario.spend,
pred.point_estimate as predicted_revenue,
pred.lower_95,
pred.upper_95
FROM (
SELECT ARRAY[10000, 25000, 50000] as spending
) scenario,
LATERAL anofox_statistics_ols_predict_interval(
'historical_data',
'revenue',
ARRAY['marketing_spend'],
STRUCT_PACK(marketing_spend := scenario.spending[idx]),
0.95
) as pred;
Confidence vs. Prediction
Mean forecast: $100K ± $10K (confidence interval)
Individual forecast: $100K ± $30K (prediction interval)
Use Cases
- 95% intervals for standard reporting
- 80% intervals for planning (less uncertainty)
- 99% intervals for risk management
Next Steps
- Production Deployment — Monitoring
- Reference: Inference — Prediction API