A restaurant on the Mersin coastline expected 90 covers last Monday but only saw 32 guests walk through the door. The owner called us in a panic at noon: "Did I miss a holiday? Is there an outbreak?" The actual culprit: someone had wrongly flagged the venue as "temporarily closed" on Google Maps. A 7-day lookback z-score anomaly detection caught it at 11:30 AM. By 1:00 PM the owner had fixed the Google My Business listing and the evening service was saved.
What Is Z-Score Anomaly Detection?
Anomaly detection flags values that fall more than 3 standard deviations (3σ) away from the expected baseline. For POS data we compute a 4-week rolling same-weekday mean and sigma. Today's value below (mean - 3σ) triggers a critical-drop alert. In the Mersin example: 4-week Monday average 90 covers, σ=8. This Monday 32 covers → z-score = (32-90)/8 = -7.25. That's not 3σ but 7σ — a one-in-a-million chance. Definitely not coincidence; something specific is wrong.
thMenu Pro+ POS Analytics runs this calculation nightly at 06:00. It produces hourly-granularity z-scores for covers, revenue, average ticket, and category sales separately. Any value below -3 triggers a push notification plus SMS to the owner's phone — right at open or before lunch rush, when action is still possible.
Common Causes and Quick Fixes
When an anomaly fires, the root cause usually falls into one of five buckets:
- Google Maps mislabeling — "Closed", "Temporarily closed", wrong hours. Check GMB; fixable in 30 minutes.
- Weather — Downpour, storm. Outdoor-seating restaurants often see 60% drops.
- Local event collision — Match, concert, street closure. Detect ahead and adjust menu or run a promo.
The other two: competitor opening or campaign, and operational issues (Wi-Fi down, payment terminal dead, customer turned away at door). The thMenu dashboard auto-generates a "likely cause" hint for each anomaly using weather API plus Google Trends plus event calendar integration.
Algorithm Details and False-Positive Control
Naive z-score isn't enough. Holidays (national, religious), planned closures, special-reservation days (weddings, birthdays) are excluded from the lookback window. Eid Mondays aren't compared to regular Mondays — they're compared to last year's Eid. This "calendar-aware" correction drops false-positive rate from 78% down to 12%.
Another critical point: small restaurants with daily covers in the 15-25 range have high sigma, weakening the z-score signal. In that case weekly totals or hourly granularity work better. thMenu automatically picks the granularity with the highest statistical power for your venue size.
FAQ
How much history is enough? Minimum 4 weeks (4 same-weekday samples). 8-12 weeks is ideal — seasonality smooths out and sigma stabilizes.
Does it work for a brand-new restaurant? Starting at week 4 after opening. The trend has to stabilize first. For weeks 1-4 we use a city-tier sector benchmark.
Is a positive z-score good news? A +3σ spike means a sudden sales explosion — usually social media virality or competitor closure. Critical for emergency stock and staffing prep.
Found this helpful? Share it.
Related articles
The Complete Guide to Running a Multilingual Restaurant Menu
Serving international guests? Learn how to set up a menu that automatically spea…
What Is a QR Code Menu? The Complete Guide for Restaurants
A QR code menu lets customers access your full restaurant menu instantly on thei…
Understanding Your Restaurant's Data: A Practical Analytics Guide
Your menu generates data every day. Learn how to read it, act on it, and use it …