Aggregation and defuzzification — back to one output
Clip the output peaks by firing strength, stack them together, and finally read off a single continuous value.
In the 26°C / 68% example, the medium assertion is 0.50 and the high assertion is 0.25. Read through the centroid method, the output comes out around 62.05%.
Firing strength sets the upper height of each output peak
Summarizing the previous chapter's result again, at 26°C / 68% the aggregated assertions were these two.
Read that as "clip the medium peak at height 0.50 and the high peak at height 0.25." Clipping means imposing a ceiling on the original triangular or trapezoidal membership function so that it never exceeds the firing strength. A rule with firing strength 0.50 means that output label can be active at most 0.50, so the apex of the peak is sliced off horizontally at 0.50, leaving a trapezoid. Even when multiple rules map to the same label, in the end only one clipped peak remains per label on the output side.
Why clip? The firing strength is interpreted as the rule's "ceiling of effect." No part of the peak should rise above this ceiling, so pressing the top down horizontally is the natural operation. Multiplying the whole peak by the firing strength (Larsen's method) is also possible, but in the Mamdani method clipping (cutting with min) is standard.
Exercise 4-1 — Check clipping and aggregation
First, just confirm "at what height each peak is clipped."
Q1. When the medium peak is clipped at heights 0.35 and 0.50 by two rules, what is the aggregated medium height?
Same-label outputs are combined with max, so the result is 0.50.
Q2. When the high peak is clipped at heights 0.25 and 0.25 by two rules, what is the aggregated high height?
max(0.25, 0.25) = 0.25.
The exact centroid method — continuous definition
Let μ_agg(x) denote the aggregated membership obtained by stacking the two clipped peaks across the output axis x. The centroid method (centre of gravity, COG) reads off a single continuous value as the centroid of this function, defined as follows.
u = ∫ x · μ_agg(x) dx / ∫ μ_agg(x) dx
In an implementation we discretize x as 0, 1, 2, …, 100 and replace the integral with a sum.
u = Σ ( x · μ_agg(x) ) / Σ μ_agg(x)
Walking through the exact centroid method — the 26°C / 68% case
The simulator in this course sweeps the output axis x = 0..100 in steps of 1 and computes μ_agg(x) at each step as follows.
- Evaluate each output-label membership function (low / medium / high) at
xto obtainμ_low(x), μ_med(x), μ_high(x). - Clip each one by its aggregated height (low = 0.00, medium = 0.50, high = 0.25):
μ_low_clipped(x) = min(μ_low(x), 0.00) = 0
μ_med_clipped(x) = min(μ_med(x), 0.50)
μ_high_clipped(x) = min(μ_high(x), 0.25) - Take the maximum of the three:
μ_agg(x) = max(μ_low_clipped, μ_med_clipped, μ_high_clipped). - Sweep
xfrom 0 to 100, accumulatingx · μ_agg(x)andμ_agg(x)separately.
The output labels in this course are low = trimf(x, 0, 20, 40), medium = trimf(x, 30, 50, 70), high = trimf(x, 65, 85, 100). Aggregating them at unit step size yields approximately the following figures.
Σ μ_agg(x) ≈ 27.45 (area)
Σ x · μ_agg(x) ≈ 1703.00 (first moment)
u = 1703.00 / 27.45 ≈ 62.05 (centroid)
The 62.05% the simulator displays is exactly this value. We are simply treating "the medium trapezoid (height 0.50, x = 30..70)" and "the high trapezoid (height 0.25, x = 65..100)" — including their overlap — as one combined figure on the output axis, and reading off the x coordinate of its centroid.
For hand calculation, the label-center approximation is enough
The exact version is an integral (or a sum of 100 points), which is laborious on paper. So we introduce the label-center approximation. It uses only each output label's "best-fit point" (the apex of the triangle) as a representative point, and approximates the centroid as a weighted average.
low = 20, medium = 50, high = 85 (centre point of each label)
u ≈ (20×low + 50×medium + 85×high) / (low + medium + high)
In this case the heights are low = 0.00, medium = 0.50, high = 0.25, so
u ≈ (20×0 + 50×0.50 + 85×0.25) / (0 + 0.50 + 0.25)
= 46.25 / 0.75
= 61.67
That's 61.67 against the exact centroid of 62.05 — within 0.4 points. When labels are symmetric triangles roughly evenly spaced, the label-center approximation is a good approximation of the exact centroid method. For the practice problems in this course, unless explicitly noted otherwise, use the label-center approximation when answering.
Exercise 4-2 — Output via label-center approximation
For hand calculation, use representative points low = 20, medium = 50, high = 85. The heights are low = 0.00, medium = 0.50, high = 0.25.
Q1. What is the numerator 20×low + 50×medium + 85×high?
20×0 + 50×0.50 + 85×0.25 = 46.25.
Q2. What is the denominator low + medium + high?
0 + 0.50 + 0.25 = 0.75.
Q3. What is the final output from the label-center approximation?
46.25 / 0.75 = 61.67. The simulator's exact centroid method gives about 62.05%, which is very close.