Types of Analytics

  1. Descriptive: what happened (averages, counts, trends).
  2. Diagnostic: why it happened (correlations, root causes).
  3. Predictive: what will happen (forecasting, machine learning), for example predictive maintenance, which estimates when a machine will fail.
  4. Prescriptive: what to do (recommendations and automatic actions).

Analytics can be real-time (stream), working on each message, or batch, working on stored data.

Common Techniques

Statistical summaries (mean, minimum, maximum, standard deviation), threshold rules, anomaly detection (finding values far from normal, for example with a z-score, z = (x − mean) / standard deviation, flagged when |z| > 2 or 3), forecasting with time-series models, classification and clustering with machine learning, and geospatial analysis for location data.

Visualization

Visualization makes data understandable. Common displays are line charts for trends over time, gauges for current values, bar charts for comparisons, heat maps, maps for location and tables with alarms. A good dashboard shows the key values at a glance, uses clear units and colours, highlights alerts, allows time-range selection, and updates in real time. Tools include Grafana, Node-RED dashboard, ThingsBoard dashboards, Power BI and Python (matplotlib).

From Insight to Action

The value of analytics is in action: a rule that switches on irrigation, an alert to a technician, an automatic order of spare parts. The loop is: sense, analyse, decide, act, and measure the result.

Definition: Anomaly detection. Identifying readings or patterns that differ strongly from normal behaviour, such as a sudden sensor spike, using statistical rules or machine-learning models.

Table 3.5: Types of analytics

Type Question Example
Descriptive What happened? Average daily temperature
Diagnostic Why did it happen? Heat linked to a faulty fan
Predictive What will happen? Motor failure in 10 days
Prescriptive What should we do? Schedule maintenance now

Example 3.5: Detecting an anomaly with the z-score

Problem: Vibration readings of a machine are 50, 52, 49, 51, 50, 53, 48 and 95. Using the population standard deviation, find the mean, the standard deviation and the z-score of 95. Is it an anomaly at |z| > 2?

Solution:

  1. Mean = 448 / 8 = 56.
  2. Squared deviations: 36, 16, 49, 25, 36, 9, 64, 1,521; sum = 1,756.
  3. Variance = 1,756 / 8 = 219.5, so standard deviation = 14.82.
  4. z for 95 = (95 − 56) / 14.82 = 2.63; every other reading has |z| of 0.54 or less.

Result: The reading 95 has z = 2.63, which is above 2, so it is flagged as an anomaly and a maintenance alert is raised.

import statistics as st
x = [50, 52, 49, 51, 50, 53, 48, 95]
m, s = st.mean(x), st.pstdev(x)
print("Mean:", m, "| Std dev:", round(s, 2))
for v in x:
    z = (v - m) / s
    if abs(z) > 2:
        print("Anomaly:", v, "z =", round(z, 2))

Output

Mean: 56 | Std dev: 14.82
Anomaly: 95 z = 2.63

Common mistakes

  • Showing raw numbers without charts, units or alert colours.
  • Setting fixed thresholds that ignore normal changes.
  • Analysing data that has not been cleaned.
  • Producing dashboards but taking no action on them.

Key takeaways

  • Analytics: descriptive, diagnostic, predictive, prescriptive.
  • Z-score flags values far from the mean.
  • Dashboards: line charts, gauges, maps, alarms (Grafana, Node-RED).
  • Sense, analyse, decide, act, measure.

Practice questions

  1. What is predictive maintenance?
  2. How is the z-score calculated?
  3. Name two dashboard tools.

Answers to the practice questions

  1. Using data to estimate when a machine will fail so that it can be serviced early.
  2. (value − mean) divided by the standard deviation.
  3. Grafana and Node-RED (also ThingsBoard, Power BI).

Sources

  • Official BCA syllabus Internet of Things, course code 25BCA406DS01, Unit III