*2.2. Calculus*

Based on each state's population sample average expenditure, we define the range for the categories each value can fall into. The values can fall into three categories—high, medium and low—and a number is given to each one. For the present case study, the input variables are shown in Figures 4–6 and the Figure 7 represent the output variable.

**Figure 4.** Membership function transport.

**Figure 5.** Membership function cooking.

**Figure 6.** Membership function electricity.

**Figure 7.** Membership function EA (Energy Access).

In the Figure 7 the values closer to 0 indicate a low energy access, while values closer to 1 indicate a high availability to energy services.

The definition of the values for the membership function "Energy Access" were obtained using a similar method to Nussbaumer et al. [22] to measure energy poverty. They used a threshold to define energy poverty of 0.32, based on experience and through intensive tests. It is a well-known fact that membership function values can be modified according to the context of the specific application. We defined our values due to the similar behaviour that the results from the fuzzy logic algorithm gave when comparing the per capita PIB of each state with the reality of each state. However, those values on energy access in each country should be assigned by experts so to have a model that truthfully represents any given regional context. The experts on the topic are those with the knowledge, the

expertise and the access to high quality data, that can determine whether or not a model represents each countries energy landscape.

The next step after defining linguistic variables, values and membership functions is to draft the rules, then to undertake an analysis of each element. This procedure can be performed manually. However, there are several tools that can do this task in a more efficient manner. For this study, we used a tool designed in MATLAB [23].

The same procedure used in defining "EA" output values is used, this output has three variables: high, medium and low, with 0.46, 0.41 and 0.32 values respectively. Below the presentation of a typical rule is shown.

If (transportation is high) and (cooking is low) and (electricity is medium) then (AE is medium).

Using the above rule and the other 26 rules, we designed the system by applying the Mamdani fuzzy inference systems, which closely recreates both human reasoning and the fuzzy if-and-then rules. Moreover, we used the Mamdani method as it generates a fuzzy set as its output. This more complete output is the reason we chose this over more popular methods such as the Sugeno method, whose output is only linear or constant.

It is important to mention that, just as with the linguistic values, rules can be modified depending on the person making the analysis. This presents an important advantage in comparison with other analysis methodologies, as it allows us to assess the system under other conditions.
