A Functional Data Analysis for Assessing the Impact of a Retroﬁtting in the Energy Performance of a Building

: There is an increasing interest in reducing the energy consumption in buildings and in improving their energy efﬁciency. Building retroﬁtting is the employed solution for enhancing the energy efﬁciency in existing buildings. However, the actual performance after retroﬁtting should be analysed to check the effectiveness of the energy conservation measures. The aim of this work was to detect and to quantify the impact that a retroﬁtting had in the electrical consumption, heating demands, lighting and temperatures of a building located in the north of Spain. The methodology employed is the application of Functional Data Analyses (FDA) in comparison with classic mathematical techniques such as the Analysis of Variance (ANOVA). The methods that are commonly used for assessing building refurbishment are based on vectorial approaches. The novelty of this work is the application of FDA for assessing the energy performance of renovated buildings. The study proves that more accurate and realistic results are obtained working with correlated datasets than with independently distributed observations of classical methods. Moreover, the electrical savings reached values of more than 70% and the heating demands were reduced more than 15% for all ﬂoors in the building.


Introduction
The building sector is considered the largest energy consumer in the European Union, representing 40% of the final energy consumption [1]. Globally, the energy consumption of this sector accounts for 20% of the total delivered energy [2]. Thus, there is increasing interest in improving the energy efficiency of buildings [3][4][5]. Furthermore, the potential of saving energy by renovation in Europe is considerable as two-thirds of European buildings were constructed before 1980 [6]. Building retrofitting can contribute to reduce the energy consumption of existing buildings with lower energy efficiencies. In this context, it is important to develop methodologies that can evaluate the actual impact of refurbishment on renovated buildings in terms of energy consumption, thermal comfort and lighting.
Therefore, building retrofitting is essential to prove the effectiveness of the applied energy conservation measures to check if the energy efficiency of the building has certainly improved. However, there are very few studies that actually evaluate the retrofit of buildings [7]. Most of the studies evaluate measures for building refurbishment based on energy simulation [8][9][10], same initial distribution [47][48][49]. In addition, some variables such as the rate of change in sample variance or the functional L 2 distance between curves are also presented to measure the impact of the refurbishment. The vectorial method is based on the differences between the medians, and the functional method consists of measuring the distance between the curves that represent the mean functions [50][51][52].
The results show that FDA efficiently demonstrates that the heating demands in the building were reduced thanks to the envelope insulation, although ventilation was increased, indoor temperatures were increased and internal lighting loads were reduced. The results also show that a significant reduction in lighting consumption was achieved with the installation of LED lighting. Moreover, it is demonstrated that taking into account the correlation of the data from a functional approach is a more realistic and informative way to study how different two or more samples are.

Functional Data Analysis (FDA)
Functional Data Analysis (FDA) studies observations which form functions defined over a determined set T. The infinite-dimensional structure of the data enlarges the possibilities of research [23,27,53]. A random variable X is defined such a functional variable if it takes values in a complete metric or semi-metric space and is observed in a discrete set of points {t j } n p j=1 ∈ [a, b] (not necessarily equispaced) for each of the n individuals studied [54,55]. Thus, the data consist of a X matrix with n rows representing the different individuals and n p columns representing the different discrete points where the functions are evaluated [55].
The functional model, through a process known as smoothing, converts the initial discrete values into a set of continuous functions over time x(t) ∈ X ⊂ F , being F a functional space. To estimate these functions, F is F = span{φ 1 , ..., φ n b }, where φ k is a base function and n b the number of basis functions necessary to build a functional sample. Although there are other types, the basis functions used commonly are spline or Fourier functions [56], and the expansion considered is [24,25,27,57]: where {c k } n b k=1 represent the coefficients that shape the function x(t) with respect to the chosen set of basis functions. In this way, the smoothing process consist on solving the following regularisation problem [24,25,27,57]: where z j = x(t j ) + j (being j a value of the zero-mean random noise) is the result of observing x at the point t j , λ a regularisation parameter that controls the intensity of the regularisation, and Γ an operator that penalises the complexity of the solution. Taking into account the expansion, Equations (1) and (2) can be expressed as [24,25,27,57]: where z = (z 1 , ..., z n p ) T is the observation vector, c = (c 1 , ..., c n b ) T the vector coefficients of the functional expansion, Φ the n p × n b matrix of Φ jk = φ k (t j ) elements, and R the matrix formed by n b × n b elements [24,25,57,58]: where D n φ k (t) represents the nth-order differential operator of the function φ k . After this, it is easy to know that the solution can be calculated as follows: Initially, the depth concept appeared in the multivariate statistics for measuring the centrality of a point x ∈ R d within a specific dataset: giving greater value to the points near the center [22]. Then, some authors extended this measured to FDA [59,60]. The functional depth give us a centrality measure of a specific curve x i with respect a set of curves x 1 , ..., x n that comes from a stochastic process There are several functional depths in the statistical literature, but the three main are: Fraiman-Muniz [59], h-modal [61] and Random Projections [60]. The most used is the h-modal depth because it has a better frequency of correct detection than the others [22]. The h-modal depth defines the functional mode as the curve most densely surrounded by other curves of the dataset. In this manner, the functional depth of a curve x i with respect the other curves in the sample is given by: with || · || being a norm in the functional space, K : R + → R + a kernel function, and h a bandwidth parameter [61]. Thus, the curve that gets the maximum value in Equation (6) is considered the functional mode. Moreover, some authors [60,61] recommended the use of L 2 (l) norms and a truncated Gaussian kernel: The principal aim of functional depths, viewed as functional dispersion measure, is the detection of outliers. As in the classical analysis, detecting and examining these curves is important because they may bias our functional estimations and because it allows us to discover the reasons that make these curves deviate from the mean. Furthermore, from a functional approach, it is essential because it may occur that the individual values of a curve are not outliers vectorially, but, instead, the complete curve is a functional outlier [22,58]. If we assume that every curve in the data come from the same stochastic process, a curve would be considered such an outlier for two reasons: it is at a significant distance from the expected function of the stochastic process or its shape represents a very different behaviour from the other curves. Therefore, the curves with functional depth below a specific C value would be considered atypical and would be removed from the sample (see [23][24][25][26]). On the other hand, it would be convenient to choose a C that provides a controlled type I error level. It should be a value that, in absence of outliers, the probability of mislabelling a correct data as outlier would be approximately a 1% [23][24][25][26]: In this way, the chosen C will be first percentile of the depths distribution chosen. Since this distribution is unknown this, percentile must be estimated using the sample data. For this purpose, there are two different bootstrap techniques: trimming bootstrap [62] and weighting bootstrap [63]. Some studies demonstrate that, despite having a larger incorrect outlier detection, the trimming bootstrap has a better performance detecting the curves that are actually outliers [22,64].

Functional Test ANOVA (FANOVA)
Any test or contrast that can be made in a vectorial analysis can have a functional version that usually provides more relevant information. An example of this is the classical ANOVA. Its functional version, although also contrasting the mean levels of a variable, is based on k independent samples X ij (t), j = 1, ..., n i t ∈ [a, b] drawn from L 2 (l) processes X i , i = 1, ..., k such that E(X i (t)) = m i (t) [65][66][67][68]. If we have a functional sample classified in several groups such as where G is a discrete variable that tell us the membership group, the contrast will be: After a few operations, as shown in [50,51], it is possible to go from classic (F n ) to functional statistic (V n ).
In addition, according to Cuevas et al. [50] and Tarrío-Saavedra et al. [51], the asymptotic distribution of V n under H 0 is the same as the following statistic: where C ij = (p i /p j ) 1/2 and Z 1 (t), ..., Z G (t) are independent Gaussian processes with mean 0 and covariance functions K i (s, t).
Finally, H 0 will be rejected, at a level α, whenever V n > V where P H 0 {V > V α } = α [52]. Because in practise it is not easy to estimate the distribution of V, usually, it is necessary to implement a Monte Carlo procedure through which we get for each i = 1, ..., G, N iid observations from a m-dimensional Gaussian random variable with mean 0 and covariance matrix (K i (t p , t q )) 1≤p, q≤m . The functional L 2 (l)-distances ||Z i (t) − C ij Z j (t)|| 2 are approximated by the R m -Euclidean distances ||Z * il − C ij Z * jl (t)|| 2 . Ultimately, the replicationsṼ l of V arẽ and the distribution of V is approximated from the empirical distribution to a sampleṼ 1 , ...,Ṽ N [50,51].

Functional Strengths
FDA has numerous advantages but the following are the ones that make FDA suitable for studying daily behaviours in energy variables [24,28,58]: • It is not mandatory to have prior information on data distribution. The study does not depend on or is not limited to certain distributions.

•
The analysis takes into account time intervals as a unit. The sample analysed focusses on complete time units such as days, months or years.

•
Analysis of homogeneity. The definition of outliers is different; it is based on the idea that, even though data do not surpass the cut-off, if they show constant deviations, they will be identified as outlier.
• Possibility of study trends. Besides calculating mean functions or detect outliers, it is also possible to study slight variations from the normal data behaviour of the data without outliers.

•
Complete analysis of the time spectrum. Before this approach, most analyses were based on the values obtained in a given grid of discrete points. On the contrary, with FDA, it is possible to work with the entire time set in a continuous way.

Building Description
The case study of this work is the Rectorate building of the University of the Basque Country (Spain) constructed in the 1970s. It is a large building divided in three blocks (west, central and east), as shown in Figure 1. For the purpose of this work, only the west block was considered, which is an office building that includes a nursery. Four storeys form the block: floor 0 (Ground Floor) and Floor 2 (2F) consist of rooms and offices while Floor 1 (1F) and Floor 3 (3F) are mainly open spaces (see Figure 2). As the building use is office work, the occupation takes place only during weekdays, being reduced during summer. There is lighting consumption from 7 a.m. to 8 p.m., except on the second floor, where lighting consumption ends at 6 p.m. The building has a centralised heating system with hot water radiators powered by a campus district heating. The heating works the whole year following a control program according to a schedule from 6 a.m. to 7 p.m. except in July and August, when the heating remains off. A refurbishment of the building was made in the summer of 2016 on the ground floor and in the summer of 2017 in the rest of the building to reduce its energy consumption.

Building Description before Retrofitting
Before the retrofitting, the building did not have any insulation. Most of the façade was built with precast reinforced concrete panels with non-ventilated air gap. Regarding the windows, some were single-glazed with wooden frame, and others were double-glazed but with aluminium frame without thermal break. Before retrofitting, there was no air conditioning or mechanical ventilation system.

Building Description after Retrofitting
The refurbishment consisted in several measures to improve the building's envelope and energy system. The façade was insulated with vacuum insulated panels (VIPs) to reduce heat losses through the envelope. Some windows were replaced by high-performance windows. To improve the lighting consumption of the building, LED lighting was installed. A ventilation system with heat recovery was added on each floor. Furthermore, thermostatic valves were installed to improve the control of the hot water radiators. A detailed description of the refurbishment and an assessment of the heat loss coefficient of the building is provided in [20].

Figure 2.
Plans of the four floors in the west block of the building with their space distribution and dimensions. The use of each space is represented with colours: offices (brown), nursery (green), storage rooms (grey), corridors (pink) and server room (blue). In addition, the distribution of the sensors is also displayed: circles, illuminance, temperature and relative humidity; triangles, calorimeters; and square, lighting consumption.

Monitoring Description of the Building
The monitoring started before the refurbishment to investigate the necessary energy conservation measures. Thus, monitored data before and after retrofitting from sensors located all around the building are available. Monitored data before retrofitting correspond to 2016 and 2017, and data after retrofitting correspond to s 2018 and 2019; all data are minute-by-minute values. In particular, on the ground floor, the renovation started a year earlier with the insulation of a false ceiling and the installation of LED lighting. In this case, the years considered before retrofitting are 2015 and 2016. The monitored variables include outdoors conditions, indoors conditions and building heating and lighting consumption. Table 1 presents all the monitored variables in the building used to assess the impact that the retrofitting had on the building's energy performance, comfort and lighting. Indoor condition sensors are located in several points at each floor, as shown in Figure 2. The electrical consumption and the heating demand is provided per floor. Further information about the monitoring of the building can be found in the work carried out by Erkoreka et al. [69].

Pre-Processing Data
Before presenting the results, it is necessary to explain the specific smoothing process performed in this study. On the one hand, because there are parts of the day in which the variables are constant, the basis functions chosen are splines. On the other hand, to select the optimal number of basis, the determination coefficient R 2 was taken into account to measure the smoothing adjustment in relation to the raw data. As shown in Figure 3, the criterion was to select the minimum number of basis (in a given grid) where the R 2 surpasses the value of 99%.  In addition, it is important highlight the data cleaning that was carried out using a functional approach. It is known that throughout all the analysed years there were many days when the building was closed and the information that these days provide is not only not useful, but can also distort the final results. To solve this problem, an algorithm that searches for these days and deletes them from the sample was developed (see Algorithm 1).
After an exploratory analysis of the data, the values of the chosen parameters for Algorithm 1 are: β 1 = 500, β 2 = 250, α = 0.25, and θ = 0.5. Moreover, because there are parts of the day in which the variables are constant, the chosen basis functions are spline. With the application of the algorithm to the data, the sample becomes smaller but only with relevant days that take into account the normal behaviour of the building. Figure 4 illustrates the performance of the algorithm. It can be seen that it is capable of deleting the days with an abnormal behaviour without affecting the bulk of the data. The days when the building was unoccupied and closed, and therefore with very small or no electrical consumption, are detected and eliminated in the picture on the right of Figure 4. Figure 4 also presents the mean functions (in form of curves) and the change that they suffer after deleting non-representative days. Working with non-representative days will produce erroneous results in any study; for example, if an ANOVA test is performed, the test may not reject the equality of means even if the groups are different. (left) the raw data and the mean functions separated between before and after the refurbishment; and (right) the data after applying the algorithm and the mean functions separated between before and after the refushbishment.

Algorithm 1: Functional cleaning.
Input: Data divided in groups and the parameters: β 1 , β 2 , α, θ. Output: Data without inappropriate days. 1 Transform the data to funcional format: 1440 minute data each day. 2 Searching for missing values (NAs). The daily limits are: β 1 NAs per day β 2 consecutive NAs per day 3 Delete the days that exceeded the daily limits. 4 Approximation, with an interpolation technique, of the remaining missing values. 5 Calculate the variability of every daily curve in the sample. 6 Delete the curves that: • Have a variability less than or equal to a percentage α ∈ R of the average sample variability.
• Be below the sample mean function for at least a percentage θ ∈ R of the day.

Results and Discussion
The effects of the refurbishment carried out in 2017 in the Rectorate building of the University of the Basque Country were analysed. In this analysis, lighting consumption, illuminance, indoor temperatures and heating demand were studied. These variables were measured every minute between 2016 and 2019 (changing 2016 for 2015 in the case of the ground floor) and only taking into account those months in which the heating systems operate significantly (October to March). As the retrofitting started in the summer of 2017, the months of this year after the summer are not suitable for analysis. In this way, data were divided into nine months before retrofitting (six months in 2016 and three months in 2017) and nine months after retrofitting (six months in 2018 and three months in 2019). Section 3.1 presents the lighting analysis of the study and Section 3.2 the same analysis for heating demands. The numerical results were based on the p-values of the ANOVA and Kruskal tests in the vectorial analysis, and on the p-values of the FANOVA in the functional analysis. Different measures are also shown to illustrate the differences between the sample groups: D vec , the difference between the medians from the vectorial approach; D func , the average minute difference between the mean functions; and D dist , the L 2 (l) distance between the mean functions. Additionally, to measure the functional smoothing adjustment to the raw data, the coefficient of determination R 2 is shown in the tables. The change in the variance of monitored data ( Var) and the savings obtained with the retrofitting, calculated in relation to the initial energy demands, are also shown from both approaches. Lastly, all figures presented here were made with the R-programming software.

Lighting Analysis
The results of the electrical lighting consumption are shown in Figure 5. On the one hand, the vectorial analysis by means of box plots is shown in the first row. It can be seen that, after the refurbishment, the lighting demands of the building decreased and became more homogeneous on all floors. This is demonstrated in Table 2, where the change is quantified, and the statistical tests used (ANOVA and Kruskal) corroborate the change. In this case, the floor with the highest reduction was the third floor (2004 W less) and the floor with the lowest reduction was the second floor (489 W less). On the other hand, in the second row of Figure 5, the functional analysis, through the daily curve graph, is presented. In this case, thanks to this approach, it can be seen that, despite the decrease in the consumption, the retrofitting hardly affects the daily behaviour of the lighting consumption. As it is observable in Figure 5 that the curves have very similar shapes, with the exception on the third floor where a change in the lighting schedule was implemented. Table 2 presents the FANOVA results. The similarity of the samples is rejected on every floor. However, the impact varies among floors, as shown in Table 2. The first floor was the most benefited (2032 W less per minute on average) and the third floor the least benefited (400 W less per minute on average). The differences between the two analyses, in absolute terms, have been noticed: with the vectorial analysis the third floor obtained the highest reduction, while with functional analysis it obtained the lowest reduction. As shown in the second row of Figure 5, on the third floor, the reduction was concentrated on the last hours of the day; however, on average during the day, this reduction was lower. The vectorial approach does not take this fact into account because it distorts the sample with the calculation of daily averages.  Table 2. Numerical results on each floor for lighting consumption. The vectorial results are presented with D v measuring the difference between medians. The functional results, accompanied with the average minute difference (D func ), the L 2 (l) distance between the mean functions (D dist ) and the smoothing adjustment (R 2 ), are also presented. For both analyses, the change in the variability of the data ( Var) and the electrical savings are displayed. Lastly, the p-values for the tests, both vectorial and functional, are displayed in this On the other hand, the effects of the refurbishment on the illuminance conditions were studied. Figure 6 shows the analysis for the illuminance levels. Through vectorial analysis, an impact is also detected, but is different on each floor. In general, the illuminance level was improved. Table 3 indicates that the floors with the biggest increase in illuminance were the first and third floors (356 lx and 414 lx more, respectively). Ground floor was the only one with an illuminance reduction from this point of view (270 lx less). In this case, this reduction is related to the shading that was installed to have a better protection against natural light (see Table 3). Furthermore, observing the functional illuminance curves floor by floor shown in the second row of Figure 6, the conclusion is the same: there was also an improvement in the illuminance levels, and the biggest increase of illuminance took place on the first and third floors. From this point of view, Table 3 shows that the increments were about 174 lx on the first floor and 204 lx on the third floor, on average, every minute. Once again, FDA makes it possible to see that the behaviour of the illuminance was maintained on all floors. As shown in Table 3, FDA detects that the illuminance changes on the second floor, while the vectorial approach fails in this detection (the p-values obtained are bigger than 0.05). Figure 6. Analysis of the illuminance on each floor measured in lx. In the first row, the vectorial results (in form of box plots) are presented. In the second row, instead, the functional data represented with the respective mean functions. The data are divided into winter days before and after the refurbishment. Table 3. Numerical results on each floor for illuminance. The vectorial results are presented with D vec measuring the difference between medians. The functional results, accompanied with the average minute difference (D func ), the L 2 (l) distance between the mean functions (D dist ) and the smoothing adjustment (R 2 ), are also presented. For both analyses, the change in the variability of the data is displayed ( Var) Analysing the graphs shown in Figures 5 and 6, it can be seen that the retrofitting reduced the electrical consumption of lighting while the illuminance levels were improved or maintained in proper levels. The level of illuminance on the first and third floors was improved mainly due to the replacement by LED technology, as shown in Figure 6 and Table 3. In the case of the second floor, although it obtained an average reduction of 435 W, the illuminance level was maintained according to European illuminance regulations. This regulation states that the optimal lighting level in offices is 500 lx, a level already reached before the renovation. In the case of the ground floor, as mentioned above, it had to be analysed individually. The mean function of illuminance before retrofitting on this floor had peaks above 1500 lx (see Figure 6), which indicates a high influence of natural light. After the retrofitting, the shading that was installed to protect from sunlight achieved a reduction, on average, of 286 lx each minute, as it can be seen in Table 3 (266 lx, observing the vectorial results). Furthermore, the electrical consumption associated to lighting on the ground floor is also reduced. Table 2 shows that the vectorial reduction was 587 W, and the functional reduction 609 W, on average, every minute.
Generally, monitored lighting consumption data after retrofitting have less dispersion (see Var in Table 2). This means that the monitored lighting data are more homogeneous. In this case, the reduction of the data variability reaches values higher than 30% from both methods. However, the functional analysis detects an increase of 17% in the data dispersion of the third floor, as shown in Table 2. The functional graph of this floor in Figure 5 supports this result. The vectorial approach, which summarises the days with the mean, distorts the results by considering false conclusions such as, in this case, that the data variance decreased for all floors (see Table 2). On the other hand, the homogeneity of the monitored illuminance data after the renovation is different depending on the floor. Table 3 shows that the floors where the data dispersion was reduced are the ground and the second floors.
From an energetic point of view, the relative electrical consumption savings after retrofitting are also calculated. Table 2 shows that savings of more than 18% were obtained on every floor with the functional analysis and more than 24% with the vectorial analysis. The first floor is the most benefited floor with savings around 73% from the two approaches applied. However, there are differences between the results of the vectorial analysis and the functional analysis. This is shown in Figures 5 and 6 and, specifically, in Table 2 where the savings are presented. The savings calculation of functional analysis are more accurate because it is based on the areas under the curves representing the mean functions, taking into account the entire daily behaviour. The vectorial results, instead, only quantify the differences between the medians of the samples.

Heating Analysis
The results show that the refurbishment had a significant impact in the heating demands of the building. First, observing the box plots from the vectorial analysis, as shown in the first row of Figure 7, it is clear that the heating demand was reduced on all floors. This fact is supported by vectorial tests that reject similarity between samples on all floors (see Table 4). After that, with the functional graphs, as shown in the second row of Figure 7, it is also appreciated that the heating demand curves after refurbishment are below the initial curves. This is also proved by the functional tests that reject all the sample similarity hypothesis (see Table 4). The results shown in Table 4 change from vectorial to functional analysis. Both analyses come to the same conclusions, but the magnitude of change is different for each one. With vectorial approach, the reduction per floor ranges from 3667 W as the highest reduction on the third floor to 1057 W as the lowest on the first floor. In contrast, with the functional analysis, although the highest and lowest reduction were on the same floors, the values of the reduction are not the same. The heating demand, each minute, was reduced on average 3918 W on third floor and 1456 W on first floor. Therefore, the relative heating savings were significant (see Table 4). The floor most benefited was the third floor; both analysis obtained savings higher than a 30% on this floor. Again, the ground floor had to be analysed individually because, in addition to the installation of shading in 2017 that prevents solar gains, a false ceiling was already insulated on this floor in 2015. Thus, it was possible to obtain a saving of about 12% of the initial heating demands from vectorial results and about 17% from functional results (see Table 4). Figure 7. Analysis of the heating demands of each floor measured in W. In the first row, the vectorial results (in form of box plots) are presented. In the second row, instead, the functional data are represented with the respective mean functions. The data are divided into winter days before and after the refurbishment. Table 4. Numerical results on each floor results for heating demands. The vectorial results are presented with D vec measuring the difference between medians. The functional results, accompanied with the average minute difference (D func ), the L 2 (l) distance between the mean functions (D dist ) and the smoothing adjustment (R 2 ), are also presented. For both analyses, the change in the variability of the data ( Var) and the heating savings are displayed. Lastly, the p-values for the tests, both vectorial and functional, are calculated. In the case of the vectorial analysis, Table 4 shows that, in general, the measurements are less variable in general (between 35% and 60% less). On the first floor, instead, this method detects an increase in data dispersion after the retrofitting. However, this fact is not supported by the functional approach (see Table 4). Figure 7 shows in its second row that the heating curves on this floor are similar or even less variable. In the case of functional analysis results, as shown in Table 4, the variation of the measurements is lower on all floors (between 23% and 51% less). The functional method is demonstrated to be more accurate and provides more information. For instance, functional analysis detects the demand peaks on ground floor in the morning when the heating starts, as it can be seen in second row of Figure 7. With the vector analysis, this information is lost as shown in first row of Figure 7.
The possible consequences of the retrofitting on the building temperatures are also studied. Both the vectorial approach and the functional approach conclude that the temperatures increased on every floor except on the third floor (see Figure 8 and Table 5). The tests do not detect any change in the average indoor temperature on this floor. This is probably because this floor is a large space with low occupancy where the temperatures were stable before and after refurbishment. This is supported, on the one hand, by the functional analysis in Figure 8 where the curves are almost overlapping. On the other hand, Table 5 shows that the temperature on the third floor increased very slightly and the FANOVA test does not detect a significant change (p-value = 0.17). On the contrary, the ground, first and second floors had higher temperatures after retrofitting, as shown in Figure 8 and Table 5. The increase, depending on the floor and method, was between 0.5 and 2 • C. The reason is that after the refurbishment the building is more insulated, heat losses are reduced and it is easier to keep it warmer. Moreover, the temperature set point have been increased in the common zones. Only with FDA it is detected that the retrofitting succeeds to reduce the influence of natural light on the ground floor temperatures. In the second row of Figure 8, it is observed that temperatures on the ground floor after refurbishment do not have peaks at the end of the day due to solar radiation. Finally, both analyses show that the homogeneity of monitored data is significantly improved. Table 5 shows that, on each floor and from both approaches, there is more homogeneity in the measurements related to the building's indoor temperatures. Figure 8. Analysis of the temperatures on each floor measured in • C. In the first row, the vectorial results (in form of box plots) are presented. In the second row, instead, the functional data are represented with the respective mean functions. The data are divided into winter days before and after the refurbishment. Table 5. Numerical results on each floor indoor temperatures. The vectorial results are presented with D vec measuring the difference between medians. The functional results, accompanied with the average minute difference (D func ), the L 2 (l) distance between the functional mean (D dist ) and the smoothing adjustment (R 2 ), are also presented. For both analyses, the change in the variability of the data is displayed ( Var). Lastly, the p-values for the tests, both vectorial and functional, are calculated. As in the electrical analysis, the relative savings obtained in the heating analysis were calculated, as shown in Table 4. These savings reached values of more than 30% (in particular on third floor), and, in this case, with the functional approach are higher than with the vectorial approach. The floor with the smallest relative saving, observing the results of both methods, was the first floor, but with the vectorial method the reduction was almost 8% and with the functional method almost 17%. In this case, the results are more homogeneous among floors; there is not much difference from floor to floor. As expected, the form of the heating demands curves, before and after retrofitting, is the same although the values after retrofitting decreased (see Figure 7). Similar behaviour is appreciated in the temperature curves (see Figure 8).
After retrofitting the indoors temperature increased on all floors, a ventilation system with exterior air was installed and the internal gains were reduced with LED lighting. These changes should contribute to an increase of the heating demand. However, Figure 7 and Table 4 show that the heating demand on each floor has been reduced, demonstrating the effectiveness of façade insulation. Besides the decrease on the heating demands, indoor temperatures in the building are maintained or even increased, as demonstrated in Figure 8 and Table 5.

Conclusions
A new application of FDA and a new methodology to assess the impact of retrofitting in buildings are presented in this paper. The study was conducted by analysing monitored data of lighting consumption, heating demands, illuminance levels and indoor temperatures of the Rectorate building of the University of the Basque Country (Spain). These analyses aimed to detect an impact on the measured variables and to quantify the changes achieved with retrofitting. The methodology used in this study is based, on the one hand, in the functional analysis contrasting the distance between mean functions of monitored samples before and after retrofitting. On the other hand, as a comparison, the classical or vectorial approach was carried out measuring the dissimilarities between sample medians.
The presented method contributes with advantages over the already existing research in the topic of building retrofitting evaluation. Some research evaluated the effect of the refurbishment based on environmental indicators. Other studies give a measure of the heat losses before and after retrofitting, and other studies focus on the heating demands. One of the advantages of the proposal of using functional analysis is that it can be applied to evaluate different building variables such as temperatures, lighting levels, electrical consumption or heating demands. Consequently, it can be used to search for relationship or effects between variables. For instance, if the heating demand is not reduced as expected, the evolution of other variables can be observed to look for the cause. Moreover, a daily based analysis can be done, evaluating the peculiarities of some days in the performance of the studied variables.
The research contribution of this paper is the application of a mathematical method such as functional analysis to evaluate the impact that a building retrofitting had in its energy performance. There are few studies that present evaluations of retrofitting actions in buildings with monitored data and the employed methods are based in vector-based data approaches. The benefits of applying FDA to contrast and measure the similarity between samples of monitored data before and after a retrofitting were demonstrated. An advantage of FDA is that it is not restricted to certain characteristics of the data distribution, thus it is not necessary to test its normality. It considers complete time units, working with the time set in a continuous way, without having to summarise them, which is beneficial to evaluate monitored building variables. In addition, the outlier detection takes into account constant deviations as a reason to identify an outlier, even though it does not surpass the cut-off criterion.
Furthermore, the variables used in this study are commonly analysed in different types of buildings. The methodology presented here can be applied to assess the energy and thermal performance of different buildings, such as industrial, residential, educational or office buildings. Functional analysis can be applied, with variables or tools different from those used here, to evaluate different aspects of the studied building. Thus, this method could also be used to evaluate monitored variables in thermal facilities within an energy efficiency framework. The effectiveness and usefulness of the functional approach to evaluate variables that affect the energy efficiency was demonstrated in this study.
The results illustrate the greater accuracy of FDA in detecting if there was a significant change in the studied variables in comparison with vectorial analyses results. In the illuminance analysis of the second floor, the FANOVA detected a change (p-value ≈ 0) while the vectorial ANOVA did not (p-value = 0.22). Additionally, FDA could detect that most of the lighting consumption reduction on the third floor was concentrated in the last hours of the day. In addition, it has been demonstrated that FDA can provide trustable information about the dispersion of the data. In the lighting consumption analysis of the third floor, the greater dispersion of data after retrofitting was only identified with FDA. Moreover, the representation of the monitored variables in a continuous way throughout the day shows that the FDA allows a greater accuracy and a better adjustment to reality than the vectorial methods. It allows identifying average patterns of the studied variables and it has the potential for detecting anomalous behaviours of monitored variables. In the analysis of the heating demand of the ground floor, the FDA reported a peak in the early hours of the day (around 7 p.m.), both before and after the retrofitting, which the vectorial analysis did not notice.
From an energetic point of view, the conclusion is that the refurbishment carried out in the building under study had a significant impact on its energy performance. The main aim of the retrofitting was to reduce the heat losses. This goal was achieved, as demonstrated by the decrease in the heating demands of the entire building even though the temperatures were increased, a ventilation system being installed and the LED lighting reducing the internal heat gains. The analysis also shows that the illuminance levels were improved on all floors, only decreasing on the ground floor as a shading was installed to prevent from direct sunlight. According to FDA results, the heating demands were reduced 17% on the ground and first floor, 24% on the second floor and 36% on the third floor. Moreover, the reduction in lighting consumptions were 38% for the ground floor, 73% for the first floor and around 20% for the second and third floors.