Anestis Antoniadis

Solenne Gaucher

Yannig Goude

Hierarchical transfer learning with

Keywords: Demand forecasting, Semi-parametric additive model, Random forest, Transfer learning, Time series, Combining forecasts, Aggregation of experts

published or not. The documents may come

Introduction

The recent abundance of electricity consumption data at low aggregation level, due in part to the development of smart meters, opens up many prospects for electricity consumption forecasting (e.g. see [START_REF] Wang | Review of smart meter data analytics: Applications, methodologies, and challenges[END_REF]). However, with these new perspectives come new challenges, among which is the question of how to include these data obtained at a finer scale (corresponding to a household or to a smaller geographical area), which can be used to create forecasts at a fine scale, into a prediction at a wider scale (at the national scale for example). In this work, we present two methods for leveraging our ability to predict a variable of interest at a finer scale, with the goal of exploiting these predictions to improve prediction at a larger scale. This problem, which consists in taking advantage of the similarities (e.g. similar dependency to explanatory variables, common drift in distributions) existing between forecasting problems at different scales, can be naturally formulated in the framework of transfer learning.

Transfer learning methods aim at transferring the knowledge acquired from solving given problems (referred to as source problems S) to address an other problem of interest (referred to as the target problem T ). In a supervised predictive machine learning setting, the objective is to predict a variable of interest Y T using covariates X T . To do so, the learner relies on a set of observations (X T i , Y T i ) i∈{1,...,n T } , drawn from a joint distribution P T . Popular methods rely on minimizing the empirical risk corresponding to a given loss function over a set of possible learners (e.g. tree based, neural nets, generalized additive models). When the learners and the loss are chosen appropriately, the estimated model will have good forecasting accuracy on a new dataset as long as the size of the training set is sufficiently large, and the marginal and joint distributions remain unchanged in the test set. In a wide range of real-world applications, these conditions are not satisfied. Classical examples of such situations include tasks requiring massive training sets, such as computer vision or natural language processing. When dealing with temporal data, one may be confronted with changes in the distribution leading to large prediction errors over the prediction period. If we consider that the historical data correspond to a first problem, and the prediction period to a different but related problem, we are faced with the following challenge: we must exploit the similarity between the two tasks, in order to take advantage of the abundance of historical data, while ensuring adaptability to the new task.

Transfer learning aims to tackle such a problem. It has attracted increasing attention in machine learning and has been used in many applications (see [START_REF] Olivas | Handbook Of Research On Machine Learning Applications and Trends: Algorithms, Methods and Techniques -2 Volumes[END_REF]). In many practical situations, a relatively small quantity of data from the target distribution P T is available. In some cases, one also has access to a larger dataset, with a different distribution denoted P S , which can be used to solve a task related to the target problem. A key assumption is that P T and P S are related in a way that can be leveraged by the transfer learning method. These distributions may be defined on the same domain (in this case, the transfer learning problem is said to be homogeneous), or on different domains, in which case more complex transformations need to be developed (the transfer learning problem is then said to be heterogeneous). In this paper, we will focus on heterogeneous transfer problems, with differences between source and target in terms of features spaces, feature marginal distribution, and joint distribution. Surprisingly, although transfer learning is very popular in computer vision and text mining (see [START_REF] Pan | A survey on transfer learning[END_REF] and [START_REF] Zhuang | A comprehensive survey on transfer learning[END_REF] for a survey), very few developments can be found in the time series forecasting community. In [START_REF] Laptev | Applied timeseries transfer learning[END_REF] the authors fine-tune a pre-trained neural network using a large data set of individual electricity loads as source and some independent individual data as target. In [START_REF] Capezza | Additive stacking for disaggregate electricity demand forecasting[END_REF] additive stacking (an interpretable aggregation of experts) is proposed combining models at the individual level and global one for probabilistic forecasting of individual demand. In (Obst et al., 2021b,a) the authors propose a fine-tuning approach as well as online updates to transfer information from Italian Data to French Data in order to improve electricity load forecasts during the COVID lockdown. Here the transfer is both in time (from past data (source) to future data (target)) and space (from one country to another).

Hybridizing statistical models with modern machine learning tools recently proved to be an efficient strategy to forecast time series (see [START_REF] Smyl | A hybrid method of exponential smoothing and recurrent neural networks for time series forecasting[END_REF] top rank at the M4 competition). [START_REF] Anderer | Hierarchical forecasting with a top-down alignment of independent-level forecasts[END_REF] propose to transfer time-series features for bottom-up forecasting in the context of M5 competition with intermittent time series at the low aggregation level. N-BEATS, a deep learning forecasting approach is proposed at the global level and boosting trees with LightGBM at the bottom level. In the present paper, we develop new transfer learning methods for hierarchical prediction, that leverage data available at a fine scale to improve prediction at a wider scale. The first approach, presented in more detail in Section 3, is based on the design of new features learned from the source data. These features are then used as input in a Random Forest (RF) stacked with a Generalized Additive Model (GAM). Stacking an ensemble of forecasting models for time series forecasting has already been done successfully (see e.g. [START_REF] Khairalla | Short-term forecasting for energy consumption through stacking heterogeneous ensemble learning model[END_REF]; [START_REF] Moon | Combination of short-term load forecasting models based on a stacking ensemble approach[END_REF] for load forecasting, [START_REF] Dong | Wind power forecasting based on stacking ensemble model, decomposition and intelligent optimization algorithm[END_REF] for wind power forecasting, [START_REF] Xenochristou | An ensemble stacked model with bias correction for improved water demand forecasting[END_REF] for water demand forecasting and [START_REF] Zhai | Development of a stacked ensemble model for forecasting and analyzing daily average pm2. 5 concentrations in beijing, china[END_REF] for pollution forecasting). Previous work usually combined the forecasts in a meta-learner whereas we propose to combine features from GAM with original covariates in the RF. This is new and allows to detect interactions not modeled in GAM or appearing online (typically interaction with time in the context of drift). Our empirical results suggest that the feature design method presented above, combining stacked GAM and RF, allows to improve prediction at an wider scale by leveraging knowledge acquired from data at a finer scale. Unfortunately, this approach relies on knowledge acquired on a training set, which may not be relevant if a change in distribution occurs during the test period. For this reason, these methods are not adaptative to a brutal change in distribution both at the fine and the wider scale, and to leverage the relationship between both. To ensure adaptivity in our model, we propose a second transfer learning approach based on online aggregation of experts. In the hierarchical context, [START_REF] Goehry | Aggregation of multi-scale experts for bottom-up load forecasting[END_REF] and [START_REF] Brégère | Online hierarchical forecasting for power consumption data[END_REF] show that aggregating experts designed on different nodes of a hierarchical partition of the data (statistical clustering based on temporal or exogenous information, spatial partition) improves forecasting performances compared with classical bottom-up approaches. Our online aggregation strategies leverage similarities between shifts in distribution at the local scale and at the global scale, in order to adapt more quickly. We also present a new way of designing relevant experts in this context.

Contributions and outline of the paper

In this paper, we develop two methods for leveraging information available at a fine scale to improve prediction at a wider scale, based respectively on feature design combined using stacked generalized additive models and random forests, and on online aggregation of experts. These methods are presented in Section 3, and illustrated on two real-world problems. In Section 4, we apply the first method to the problem of electricity load forecasting at the national level, relying on smart meter data. In Section 5, we combine these methods to obtain adaptative methods for forecasting electricity consumption at the national level during the Covid-19 pandemic period, using data available at the regional level. We demonstrate the interest of our proposed approach in both cases. Our results indicate that both the stacking of GAM and RF and the use of features designed on data at finer scale lead to improvements in the forecasts at wider scale. Moreover, the use of multi-scale information transfer through aggregation of experts also increases the quality of wide-scale forecasts. Strikingly, our results indicate that in the two usecases, the presented methods can improve wide-scale predictions by using fine-scale predictions, even when no hierarchical constraints are implemented.

For reproducibility of the results, please find the code and data in the supplementary material: https://drive.google.com/file/d/1hdCEHKpVXt6zoSi7n7xEA0oUKW-_uEeD/view?usp= sharing.

Concepts and algorithms

In this section, we present the different statistic tools composing our transfer learning approach: generalized additive models, (quantile) random forests, and online aggregation of experts.

Generalized additive models

Generalized additive models [START_REF] Wood | Generalized additive models: an introduction with R. chapman and hall/CRC[END_REF] are a simple class of models that model a response as a sum of smooth non-parametric functions of the covariates. Partially linear additive models [START_REF] Amato | Estimation and group variable selection for additive partial linear models with wavelets and splines[END_REF], which are a special case of generalized additive nonparametric models (GAM), retain the parsimony and interpretability of linear models and the flexibility of nonparametric additive regression, by allowing a linear component for some predictors which are presumed to have a strictly linear effect, and an additive structure for other predictors. This choice of both linear and non-parametric components allows to reduce the degrees of freedom and to mitigate the problem known as "curse of dimensionality".

Given observations

{(Y t , X (1) t , X (2) t )} n t=1
, where Y t is the response at time t, X

t = (X (1)
t,1 , . . . , X

(1)

t,d 1 ) T and X (2) t = (X (2) t,1 , . . . , X (2)
t,d 2 ) T are vectors of covariates, the partially linear generalized additive model assumes that

Y t = b + X (1) t T β + d 2 j=1 f j (X (2) t,j ) + t , t = 1, . . . , n, (1)
where b is the intercept, β is the d 1 × 1 vector of unknown coefficients for linear terms, f j are unknown nonlinear real valued components and the i 's are i.i.d random variables with mean 0 and variance σ 2 independent of the covariates. In order to ensure that the model is identifiable, one requires that the linear covariates are centered and that identifiability conditions f j (t)dt = 0, j = 1, . . . , d 2 hold. For the sake of simplification, and with some abuse of definition, such PLAM models will be referred hereafter as GAMs, and we will denote by f k (X k ) the effect of variable X k , be it linear or non-parametric.

Such models, together with procedures that achieve estimation and simultaneous consistent variable selection, have proven their ability to cope with high-level aggregate electricity data in previous work: [START_REF] Goude | Local Short and Middle term Electricity Load Forecasting with semi-parametric additive models[END_REF] applied it to french substations consumption and [START_REF] Fan | Short-term load forecasting based on a semi-parametric additive model[END_REF] show their interest for regional Australia's load forecasting. Moreover they can be applied efficiently to forecast electricity data at different levels of aggregation [START_REF] Amato | Forecasting high resolution electricity demand data with additive models including smooth and jagged components[END_REF].

In the following, GAMs are trained in R using the library mgcv [START_REF] Wood | Generalized Additive Models: An Introduction with R[END_REF].

Random forest and quantile regression forest

Random forests (RF) are a powerful black box approach for modeling complex regression relationships (see [START_REF] Breiman | Random forests[END_REF]). The very general underlying model behind a random forest regression assumes that y t = h(X t ) + ε t , where g is a generic, non-parametric function, and ε t is an independent gaussian noise. Because of the generality of the model, RF necessitates very little prior knowledge of the problem. RF are obtained by aggregating an ensemble of base learners generated by applying classification and regression trees (CART, see [START_REF] Breiman | Classification and regression trees[END_REF]) on different subsets of the data obtained with bagging and random sampling of covariates. One nice feature of random forests is that they can be easily used for quantile regression as presented in [START_REF] Meinshausen | Quantile regression forests[END_REF].

In our applications, we use the procedure ranger() from the R toolbox ranger for the random forest fits. The default parameters are used (500 trees, mtry = √ p, unlimited tree depth). In future work, these values could be optimized in a more refined way by combining ranger with procedures from the R library caret, at the cost of increasing CPU time.

Online aggregation of experts

Online robust aggregation of experts [START_REF] Cesa-Bianchi | Prediction, Learning, and Games[END_REF] andin [0, 1]).

The performances of experts and aggregation forecasts are evaluated according to a convex loss function. We will consider here the square loss t (x) = (Y t -x) 2 . At time t, expert k suffers loss

t ( Ŷ k t ) = (Y t -Ŷ k t )
2 and the aggregation t ( Ŷt ) = (Y t -Ŷt ) 2 . The purpose of expert aggregation is to minimize the total loss T t=1 (Y t -Ŷt ) 2 that can be expressed:

1 T T t=1 (Y t -Ŷt ) 2 1 T T t=1 (Y t -Ŷ * t ) 2 + R T ,
Ŷ * t is called an oracle and can be viewed as an optimal (unknown before the forecasting run) forecast. R T is the regret term corresponding to the error suffered by our algorithm relatively to the error of the oracle. Some algorithms are proposed to achieve low regrets. In our study, we use the ML-Poly algorithm proposed in [START_REF] Gaillard | A second-order bound with excess losses[END_REF] and implemented in the R package opera [START_REF] Gaillard | opera: Online prediction by expert aggregation[END_REF]. This algorithm tracks the best expert or the best convex aggregation of experts by giving more weight to an expert that will generate a low regret. This makes this algorithm particularly interesting as no parameter tuning is needed.

Hierarchical stacking

In this section, we present our methodological contributions. The first one relies on learning new features using data from the source distribution. These features are then used as input in a stacked GAM and RF model. The second one is to design new aggregation strategies to adaptively forecast variables on a bi-level hierarchy.

subsectionFeature design for stacked GAM and RF Features design using the source data. In the following, we suppose to have access to two data sets

D T = X T t , Y T t t=1,...,n T and D S = X S t , Y S t t=1,...,n S
, where D T is the target data set in the sense that the final objective is to forecast Y T t , and has underlying distribution P T . D S , with underlying distribution P S , is an auxiliary source data set sharing some common properties with D T . We then want to exploit D S in order to improve the forecast of Y T t . While, in general, the covariates from the source and target datasets X S t and X T t may belong to spaces of different dimensions, we may assume without loss of generality that there exists a subset C of covariates that are common to both data sets. In the setting of electricity consumption forecasting, these common variables can be, e.g., calendar variables, or meteorological variables (at finer scale in D S , and at wider scale in D T ). It is then natural to assume that these features will have similar effects on the variable of interest Y t in the target and source data set. To exploit this idea, we propose to learn the effect f k of a common feature X t,k such that k ∈ C, using the source dataset D S . More precisely, we fit a GAM on the dataset D S , and we extract the smooth function

f k corresponding to the effect of covariate X t,k . We then use f k to generate a new feature f k (X T t,k
), which we include in the target dataset D T . When the functions f k are learned from an auxiliary dataset D S corresponding to observations at a finer scale, adding the corresponding features to the dataset D T of observations at the wider scale allows to transfer knowledge in a hierarchical fashion.

Note that we can also use this technique to learn the effects of the covariates directly on the target dataset D T , and use them as new features in the regression. If we use one type of learner (e.g., GAM) to learn the feature, and we combine these features using a different type of learner (e.g., RF), we can hope to take advantage of both types of learners. This idea motivates the stacking of generalized additive models (GAM) and random forests (RF) presented below.

Stacked GAM and RF. Our models for the target problem are obtained by stacking GAMs and the correction provided by random forest regression trained on the target dataset.

GAM provide interpretable models and a natural way to incorporate expert knowledge into a statistical model. In addition, because of the smoothness assumptions imposed on GAM functionals, GAMs provide a good representation of the effects of important features and they can extrapolate out of training data. However, they only model the influence of pre-specified covariates or pairs of covariates, and can therefore fail to account for some interactions between inputs.

By contrast, Random forests (RF) can model complex regression relationships (see [START_REF] Breiman | Random forests[END_REF]): their black box design can capture well complex non-linear interactions. By definition, RF predictions are restricted to the convex hull of the outcomes Y t of the training data (all the possible mean of y i ). This behavior prevents them from producing aberrant predictions caused by extrapolation, even when trained on very small data sets, as can typically be the case in a transfer learning framework with a small target dataset and a high number of covariates [START_REF] Balestriero | Learning in High Dimension Always Amounts to Extrapolation[END_REF]. To have the best of both worlds, we propose to stack these two approaches. Note that using other black box machine learning methods such as neural nets or boosting trees could be a potential improvement for future research.

The stacked GAM and RF algorithm (GAM-RF in the following) consists in three steps:

1. We first fit a GAM model as Equation ( 1) on the source data D S . We use the estimated GAM features (f k ) k∈C to create new features f k (X T k,t ) k∈C t=1,...,n T for the target dataset.

2. We compute estimates of forecasting residuals on the target dataset D T (either by crossvalidation, block cross-validation or forecasting errors in an online forecasting setting) denoted

ε t .
3. We then fit a RF model on the augmented target dataset ε t ,

X T t , f k (X T k,t ) k∈C t=1,...,n T to
predict the GAM residuals ε t . The final forecasts are obtained by summing GAM forecasts and the corrections provided by the RF.

The method presented above allows transferring information through the new features f k , used as input in the RF. In Section 4, we illustrate this methodology by applying the stacked GAM-RF to predict electricity load at the national level for the United Kingdom, by leveraging data available at a finer scale collected by smart meters.

Online aggregation of stacked experts for a bi-level hierarchy

Our experiments in Sections 5 and 4 show that GAM and RF stacking can exploit the data in the source dataset to improve prediction on a related target dataset. However, this method relies on the assumption that the source and target distributions are constant, and thus may not be robust if a change occurs in these distributions. In many hierarchical prediction situations, it is natural to assume that changes in the distribution at the least aggregated level (i.e., on the source data) and at the most aggregated level (i.e., on the target data) are related. One may then want to take advantage of the data available for the source problem to learn these changes more quickly and obtain more adaptive forecasts for the target problem. To achieve this goal, we propose to use online aggregation of quantile experts. We consider a hierarchical forecasting setting where the data y t are observed at a global level and in K zones y z,t such that y t = K z=1 y z,t . We denote y norm t (resp. y norm z,t

) the normalized load at the global (resp. zonal) level. This normalization consists in dividing these time series by their empirical mean (computed on the source set). We propose different original ways to create experts that will be aggregated online.

Experts

Online expert aggregation leverages the diversity of predictions made by different experts by combining their predictions. To obtain a diverse set of experts, we train our models to predict different quantiles of the target distribution. Designing experts for low and high quantiles present several advantages. On the one hand, these experts, when aggregated online to track the changes in the distribution of the load using convex aggregation, are particularly relevant since there is a high probability that the real consumption falls in the convex hull of the quantile experts. On the other hand, by doing so, we obtain experts with similar behavior across regions, that can share weights between the different regions and at the national level. Indeed, it is reasonable to assume that when an expert receives a low weight in one region, it must receive a low weight in all regions. For example, in Section 5 we study the problem of electricity load forecasting in France at the national level using regional data. Measures taken in response to the Covid-19 epidemic in France resulted in a decrease in electricity load throughout the country: this change would correspond to lowquantile experts for the different regions receiving higher weights in the aggregation. Considering a vectorial aggregation model allows us to take advantage of the similar behavior of the quantile experts across regions.

In addition, we increase the diversity of the set of experts by considering different models to predict these quantiles, which we now describe. The stacked GAM and RF presented in Section 3 can be computed for each zone. We propose two ways of computing stacking: one considering each zone individually (individual GAM-RF), and the other considering common models for zones and at the global level (common GAM-RF). We the following experts.

• GAM: a GAM is fitted on each zone and at the global level on the normalized data resulting in K + 1 scaled experts.

• Individual GAM-RF: using quantile regression forests, we fit for each zone and at the global level 5 RF on the residuals of the GAM model. These RF predict quantiles at levels 10 0.05, 0.1, 0.5, 0.9, 0.95. By stacking the prediction of these RF and of the GAM, we obtain 5 scaled experts for each zone.

• Common GAM-RF: using quantile regression forests, we fit 5 RF on the aggregated residuals for all zones and the global level. These RF predict quantiles at levels 0.05, 0.1, 0.5, 0.9, 0.95. By stacking the prediction of these RF and of the GAM, we obtain 5 scaled experts for each zone.

These approaches are illustrated in Figure 1. Quantile experts can be considered are possible scenarios of evolution of the data distribution that we will try to track online in the aggregation.

Common RF are used to improve the transfer efficiency and capture common dynamics between the zones.

Aggregation strategies

The strategy described in Section 3.1.1 yields 11 experts for each one of K zones and for the global level: 1 GAM expert, 5 GAM-RF stacked experts trained zone by zone, and 5 GAM-RF stacked experts trained on the aggregated data. Thus, we obtain 11 × K experts. To combine the predictions of these experts, we propose 4 aggregation strategies taking differently into account the hierarchical structure of the data. The algorithms are described below and illustrated in Figures 2 and3. • Full disaggregated model: we use the full set of 11(K + 1) scaled forecasts as experts and the scaled global response y norm as our target variable. The prediction is then multiplied by the average value of the response at the global level.

• Vectorial aggregation: we illustrate the possibility to share weights between the zones and at the global level. We aim at predicting the time series of the (K+1)-dimensional vector corresponding to the scaled response in each zone and at the global level. To do so, we aggregate 11 vectorial, (K+1)-dimensional experts corresponding to the predictions of the GAMs and of the 10 stacked GAM-RF. The prediction corresponding to the global level is then multiplied by the average value of the response at the global level to forecast y.

• Hierarchical aggregation, scaled predictions: as a first step, we aggregate the 11 experts in each zone using the scaled response for a zone z, y norm z as a target, and we obtain K experts.

Then, we aggregate these K experts and the quantile experts at the global level, with the scaled global response y norm as our target variable. The prediction is then multiplied by the average value of the response at the global level.

• Hierarchical aggregation, unscaled predictions: we again aggregate the 11 experts in each zone, using the scaled response for the corresponding zone as a target, and we obtain K experts predicting the normalized response at the zonal level. Then, we multiply their predictions by the average value of the response for the corresponding zone y z , and sum these predictions in order to obtain a forecast of the global level y. We underline that this aggregation method is the only one enforcing coherency between the prediction at the zonal level and the prediction at the global level. In Section 5, we apply this methodology to adaptively predict electricity load at the national level in France during the first Covid lockdown using data at the regional level. We underline that our objective is the forecast at the national scale, and that forecasts at the regional scale are only used to improve this aggregated forecast. For this reason, we do not require that the forecasts be coherent (the sum of the forecasts at the regional level does not necessarily have to be equal to the forecast at the national level). In fact, the experiments presented in Section 5 indicate that aggregation methods that do not respect coherency (such as vectorial aggregation) can obtain more accurate results than methods that do (i.e. hierarchical aggregation with unscaled predictions).

Transfer learning for forecasting aggregated smart meter data

In this section, we will illustrate the methodology using a dataset that is commonly used for the calibration of electricity consumption forecasting models. The dataset is made up of aggregate semi-hourly consumption data of the national load for the United Kingdom, and of observations of some meteorological and calendar variables. Our goal is to forecast electricity consumption at the national level from December 2009 to August 2010 (this period will be referred to as the test set). For this purpose, we assume that we have access to data at the national level covering the period from April 2005 to November 2009 (called hereafter the learning set) and data from smart meters for a smaller period (from April 2009 to August 2010). In this first example, we compare the performances of a GAM, a RF and a stacked GAM-RF trained using data at the national scale to the performances of a stacked GAM-RF using features learned from smart meter data. This allows us to highlight both the advantage of stacking GAM and RF and that of transferring the GAM features learned at the finer scale, and to decompose the contribution due to stacking GAM and RF and to using these new features.

Data

National Data

This dataset for UK national semi-hourly electricity consumption is provided by the European Grid Standards Office (see https://www.nationalgrideso.com/balancing-data/data-finderand-explorer) and covers the period between April 2005 and December 2010. We add as features the temperature data obtained from the NOAA (National Oceanic and Atmospheric Administra-tion)1 for the 10 largest cities in the UK: London, Birmingham, Glasgow, Sheffield, Bradford, Liverpool, Edinburgh, Manchester, and Bristol. We then compute a weighted average T t of the temperatures recorded in these 10 stations with weights proportional to the official population of each city, and we finally perform an exponential smoothing of this weighted average with the parameters 0.2, 0.05, and 0.01.

Smart meters Data

This data set corresponds to smart meters data at an individual scale in the UK. This dataset has been obtained from the Energy Demand Research Project (EDRP) launched by Ofgem on behalf of the UK Government in 2007 (see AECOM (2018), [START_REF] Schellong | Energy demand analysis and forecast[END_REF] and2 ) where the power consumption of approximately 60,000 households was collected at half hourly intervals for about two years. We consider a subset of 1925 customers from April 2009 to August 2010 located in two regions of the UK: south-east (arround Brighton) and north-west (around Glasgow). We considered temperatures in each region, obtained from the NOAA. We add to this data set supplementary calendar covariates such as the time of year, day type, sunrise and sunset time along the year.

Models and forecasting

The fitting procedure used to forecast electricity consumption at the national level can be described as follows.

We note a trend in the time series of consumption over the period from April 2005 to August 2010. We estimate this trend in a very simple way by fitting to the series of observations a nonparametric Gaussian model Y t = µ + s(t) + ε t , the trend s(t) being represented in a cubic spline function base with a number of knots limited to three. In the following, we subtract this trend and aim at forecasting the national de-trended consumption, which is then given by Y c t = Y t -s(t) -μ. We apply the stacked GAM and RF methodology to predict national load consumption, using only data available at the national level. Note that this is a special case of the general transfer learning framework, with D T = D S , and where the final forecast is obtained using RF on the data enriched with the transfer of information performed using the design of new features. We begin by fitting a semi-parametric GAM on the learning set. The GAM is given by

Y c
Y c t = 7 j=1 m j I DayType t =j + m 8 I Holiday t =1 + m 9 I LongWeekEnd t =1 + g 1 (Instant t , Temp t ) + 7 j=1 f j (Instant t )I Daytype t =j + s(ToY t ) + s(Temp99 t ) + ε t (2)
where the variables are presented in Table 1, and ε t is a centered Gaussian noise. Each univariate smooth component of the above GAM model is fitted using regression spline functions with 40 knots (50 knots for ToY) and a tensor basis of spline functions for the interaction between time and temperature with 20 and 10 knots, respectively.

Then, once the fit (2) has been performed, we extract the estimated effects g 1 , and f j of the features, and add them to the set of initial covariates. This enriched dataset will then be used to train the RF. Note that the initial number of covariates in the database taken into account in the Equation (2) is 7, and the number of additive components extracted by the GAM methodology is 15. We thus find ourselves, after transfer, with a sample having a number of observed covariates equal to 22. We apply the GAM-RF stacking methodology to fit a nonparametric regression called GAM.RF.nat on the training sample. Finally, we evaluate the prediction of this stacked GAM and RF on the test sample, and compare it to the predictions obtained with the GAM (2) model.

We also compare this model to a standard regression model by random forests, denoted hereafter RF.nat.

In a second time, we apply the stacked GAM and RF methods to transfer information from the smart meters data. We begin by computing the total consumption of the customers on the smart meter data set, and we fit a GAM model to forecast this total. Using the same methodology as for the national data, we obtain the model presented in Equation (3). We chose to use a simpler model than the national one, because the dataset used to train it is smaller.

y t = 7 j=1 m j I DayT ypet=j + g 1 (Instant t , T t ) + 7 j=1 f j (Instant t )I DayT ypet=j + s(ToY t ) + ε t (3)
We then extract the 10 non-linear features of this model as supplementary covariates and add them to the dataset consisting of all original covariates and of the effect extracted from the GAM at the national level. Finally, we use these covariates to train the stacked GAM-RF, and obtain a model called GAM.RF.local. We underlined that the GAM (3) used to model the aggregated smart-meter load is fitted on the small dataset consisting of smart-meter data. However, the effects f k extracted from this model are then used to create new features for each entry of the large national dataset. An importance by permutation analysis of the variables used in the stacked RF after learning by transfer retains as most important for GAM.RF.nat the instant of the day, followed by three terms from the national GAM modeling. For the model GAM.RF.local, the most important variables are the instant of the day, followed by two terms from the national GAM, and by one term from the local GAM.

By analyzing the mean absolute percentage errors (MAPE) and the root mean squared errors (RMSE) of the different methods, presented in Table 2, we see that for the British national data set, the RF are more efficient than the adopted reference model GAM. Interestingly, the stacked GAM and RF trained using only national data GAM.RF.nat outperforms these two models. This indicates that the stacking of GAM and RF allows to obtain the best of both worlds: the RF is able to correct effects or interactions of variables (such as the instant of the day) that are not well captured by the GAM, while being robust to the large number of covariates taken as input (up to 28). Finally, the best model both in terms of MAPE and RMSE is obtained by stacking GAM and RF using effects learned from both national and smart meter data. These results underscore the value of leveraging available data at a finer scale, even when no hierarchical constraints are implemented in the algorithm.

Electricity load forecasting during the first Covid-19 lockdown

In this Section, we apply our methodology to short-term electricity load forecasting during the Covid-19 lockdown and post-lockdown period in France, at a resolution of half an hour and at the national level. To do so, we leverage information available at the regional level. Electricity consumption has been significantly affected by the measures taken by the government to cope with the epidemic: closures of non-essential businesses, as well as stay-at-home directives, have led to a decrease in electricity consumption of about 10%, as well as to changes in its daily and weekly patterns (see [START_REF] Obst | Adaptive methods for short-term electricity load forecasting during covid-19 lockdown in france[END_REF] for a description of the impact of these measures on french electricity consumption). Common models trained on historical data, which rely on calendar and weather data, fail to account for these significant changes. Similarly, transfer learning methods relying on data present at a finer (e.g., regional) scale, if trained on data with different distribution than that of the target, will make poor predictions, especially if the relationship between local and global variables changes over time. Thus, these models, trained on data from the pre-pandemic period, make relatively large prediction errors on the period following the start of the lockdown.

To ensure adaptativity of our models, we combine the stacked GAM-RF methodology presented in Section 3 with the online aggregation of quantile experts presented in Section 3.1.2.

Transfer learning proves to be essential to address the problem of electricity load forecasting during the Covid-19 pandemic. Indeed, as the data for this period is scarce, especially since we want to make predictions from its very beginning, it is crucial to use information from the pre-pandemic period to predict power consumption during the pandemic period. To do so, we use the methods presented above to transfer information from the large data set corresponding to historical electricity consumption during the pre-pandemic period (hereafter called the source period) to improve predictions during the pandemic period (called the target period). This can be done using again stacked GAM and RF: this transfer learning algorithm allows us to rely on a GAM trained on a large set of observations of historical electricity consumption, coming from the source distribution, while correcting its error on the target using RF based on scarce observations.

On the other hand, because of the important changes in electricity consumption consecutive to the lockdown, we expect that the relationship between effects learned on regional data and national load will also change. Indeed, our studies reveal that containment measures induce changes in electricity consumption at the regional level, which however differ according to the region considered.

To make use of electricity consumption data available at the regional level, we must remain adaptative to changes in the distribution of both national and regional data. This is achieved by using online aggregation of experts, which allows us to combine forecasts at the regional and national levels in an adaptative fashion. We choose to forecast electricity consumption separately region by region using stacked GAM and RF, and then combine the forecasts of these regional models in order to predict national electricity consumption in a hierarchical fashion. In doing so, the hierarchical model captures regional phenomena that are not apparent at a more aggregated scale and leverages this information to improve predictions at the national level. Thus, our methods allow for transferring knowledge both at a temporal level (data from the pre-pandemic period are used to improve forecasts during the pandemic period), and at a hierarchical level (regional predictions are used to produce forecasts at the national level).

The rest of the section is organized as follows. In Section 5.1, we present the data used to design and evaluate our models. In Section 5.2 we present the models used for forecasting electricity consumption at the national and regional levels. The results of our study are presented in Section 5.3: first, we compare the performances of different approaches, then we present a more detailed analysis of the stacked GAM and RF, and of the online aggregation of experts.

Data

The data are from the french TSO (Transmission System Operator) RTE. It consists of electricity consumption (in MW) at a half-hourly temporal resolution at the French national level ("Load") and for the 12 metropolitan administrative regions (it does not include Corsica): Nou-velle Aquitaine, Auvergne Rhônes-Alpes, Bourgogne-Franche-Comté, Occitanie, Hauts-de-France, Normandie, Bretagne, Centre-Val de Loire, Île-de-France, Pays de la Loire, Provence-Alpes-Côte d'Azur, Grand Est. Our goal is to forecast the French national consumption, exploiting the regional loads information. For all the load consumption data, we compute the lags for one day and one week and denote it with the subscripts".48" and ".336".

Our models use the temperature and weighted temperature as explanatory variables. These variables were collected on the website of the French weather forecaster Météo France. For each region, we compute the weighted mean of meteorological stations where the weights are proportional to exp(-dist) where dist is the distance of the station to the barycenter of each region. Note that we use the observed temperatures instead of their predicted values in our forecast. In doing so, we cancel out the errors caused by the uncertainty of a particular weather forecast, which allows for a more precise comparison of the different models. Moreover, this choice allows us to only use open data, so as to ensure reproducibility of our results.

Our models also rely on variables characterizing the impact of the restrictions implemented to fight the epidemic. The first of these variables is the Oxford Covid-19 Government Response

Tracker. This index, freely available at https://www.bsg.ox.ac.uk/research/research-projects/ covid-19-government-response-tracker, aggregates indicators characterizing the measures taken by governments to mitigate the epidemic in terms of containment, health, and economic support.

It is available at the national level. The methodology used to calculate the index and the measures on which it is based are known a few days in advance, so we assume that it is known for the day we wish to forecast. The remaining variables used to characterize the impact of lockdown measures are Google Mobility Indices. These indices are provided by Google, and obtained by aggregating geolocalisation data. They characterize the changes in the frequentation of categorized places (residential, workplaces, transports, parks, grocery and pharmacy, retail and recreation). The data are freely available at https://www.google.com/covid19/mobility/, albeit with a little less than a week delay. Therefore, we considered lagged versions of these indicators in our prediction. The government response and mobility indices are available respectively from January and February 2020 onwards. Therefore, we do not use them as covariates in the source model, but only in the target model.

Hereafter, we call source models the models trained on historical data, collected between the beginning of 2012 to the end of August 2019. We evaluate their performances on data with the same distribution, during the pre-lockdown period ranging from September 2019 to March 15th 2020, and compare it to their performance on data from the target distribution, ranging from March 16th to September 17th. By contrast, the models specific to the lockdown and post-lockdown period, henceforth called target models, are retrained every day during this target period, so as to leverage all observations available. Note that while the first french lockdown officially started on March 17th, we consider March 16th as the first day of the target distribution, as the electricity consumption pattern had already changed by that day.

Models

Generalized additive models for the pre-pandemic period

We use GAM to predict the electricity load under normal circumstances. We fit one model for each region of mainland France, as well as one at the national level, and obtain thus 13 models.

To take into account the daily patterns of electricity consumption, each model is composed of 48 GAM fitted independently and forecasting the electricity load at a given instant of the day. Thus, the 624 time-series corresponding to the 48 half-hours for the 12 regions and the national level are treated independently. In order to compare the predictions, terms, and errors of the models, regional and national electricity loads are normalized, that is, they are divided by their average value for the region and the half-hour considered. GAM are then fitted to predict this normalized load. In the following, we denote respectively by y and y norm the load and the normalized load.

The model used to predict the electrical load for a zone z at a time t corresponding to the h-th half-hour of the day is the following:

y norm z,t = 7 i=1 1 j=0 α (z,h) i,j 1 DayType t =i 1 DLSt=j + 7 i=1 β (z,h) i Load.48 z,t 1 DayT ype=i (4) +γ (z,h) Load.336 z,t + f (z,h) 1 (t) + f (z,h) 2 (ToY t ) + f (z,h) 3 (t, Temp z,t ) (5) +f (z,h) 4 (Temp95 z,t ) + f (z,h) 5 (Temp99 z,t ) + f (z,h) 6 (TempMin99 z,t , TempMin99 z,t ) + ε z,t (6)
where ε z,t is gaussian white noise, and the variables are presented in Table 3. Each univariate smooth component of the above GAM model is fitted using regression spline functions with respectively 20 knots for ToY, 10 knots for Temp95 and Temp99, 5 knots for Date, and a tensor basis of spline functions for the interaction between time and temperature with 3 and 5 knots, respectively.

Quantile GAM-RF experts aggregation

We design experts by stacking GAM and RF, following the methodology described in Section 3. The RF are trained in a streaming fashion on the target data (pandemic and post-pandemic period). Building on the results of Section 4, we choose to take as input for these RF the usual covariates, but also the GAM effects learned on the source dataset. Interestingly, preliminary results postponed to Appendix A indicate that while the RF inputs are high-dimensional, variable selection only marginally affects the performance of our model. The RF appear to be robust against the high dimension of the features, even in the early days of lockdown, where few observations are available.

Using RF to correct the errors of the GAM during the pandemic period allows us to obtain an adaptative model able to produce predictions from the very beginning of the target period. Note that the corrections of the RF remain small compared to the predictions of the GAM: the first order of the prediction is given by the source model, trained on the large set of historical data, while the corrections learned on the scarce observations from the target dataset only provide a second order correction.

For each of the 12 regions and at the national level, we obtain 11 experts, corresponding to the GAM experts, the 5 GAM-RF quantiles experts trained on the residuals of the zone, and the 5 GAM-RF quantiles experts trained on the aggregated residuals. Then, we compare 4 aggregation techniques (full disaggregated model, vectorial aggregation, hierarchical aggregation of scaled predictions, and hierarchical aggregation of unscaled predictions).

Results

In this Section, we compare the methods presented above. First time, we compare their performances in terms of MAPE and RMSE in Section 5.3.1. Then, we lead an importance by permutation analysis of the RF, which is presented in Section 5.2.2. Finally, we analyze and compare the different aggregation methods in Section Appendix B.2.

Performances

In Table 4, we compare the MAPE and the RMSE of the 4 methods, of the GAM at the national level, and of the stacked individual RF predicting the median of the residuals at the national level.

We split the test period into 3 sub-periods. In the pre-pandemic period between September 1st GAM-RF stacking improves GAM significantly. Using a stacked RF predicting the median of the GAM residuals at the national level is enough to decrease its MAPE during and after the lockdown by respectively 50 and 45%. All hierarchical aggregation strategies, except for vector aggregation, outperform GAM and GAM-RF during the lockdown period: these results indicate that online aggregation is an efficient way to take into account information available at a finer scale. Our analysis in Appendix B shows that regional GAM have in average errors much larger than that of the GAM at the national level, due to larger fluctuations present at the finer scale.

Interestingly, aggregating these low-accuracy models allows to obtain better performances than that of the GAM at the national level, even in the pre-pandemic period. This confirms the interest of aggregating quantile GAM-RF experts to track changes in the data. While vectorial aggregation performs rather poorly compared to other aggregation strategies during the lockdown, it improves over all other models after the end of the lockdown.

In Appendix B, we analyze the stacked GAM and RF. We plot the evolution of the importance of the variables across time. Our results show that variables important for predicting one quantile tend to be important for predicting the other quantiles. Moreover, the effects of the GAM are among the most important covariates for predicting the GAM residuals. Using these effects as covariates allows to transfer information on the impact of weather and calendar variables learned on the large dataset of pre-pandemic observations. We also note that as time passes and the size of the training set for the RF increases, relevant variables such as the Government Response

Tracker, or relative occupation of some places of interest become more important for the prediction.

Conversely, spurious variables are discarded as unimportant. Interestingly, the common RF trained on residuals across all regions detects these relevant variables more quickly than the individual RF trained solely on residuals at the national level. This highlights the interest of aggregating the data across zones and scales in this sparse data context.

The fact that scaled and unscaled hierarchical aggregation obtain similar performances is somewhat counterintuitive, given that in the scaled model the aggregation must learn the contribution of the different regions to the national consumption. To analyze this phenomenon, we investigate in Appendix B the relative weight given to the experts corresponding to the different regions. We find that the weights in the unscaled hierarchical aggregation do not correspond to the proportions of electricity consumed by the regions, and that they typically exhibit much more flexibility than the true weights. The fact that the scaled hierarchical aggregation outperforms its unscaled counterpart both in the pre-pandemic and in the post-lockdown period suggests that the flexibility provided by the second layer of aggregation used in the scaled model compensates for the lack of knowledge of the relative contribution of the different regions.

We also study the weights given by the experts in the vectorial aggregation, and note that it gives a predominant weight to the GAM and median staked RF experts, which appears as the most relevant experts across all regions; however, these weights are highly unstable during the beginning of the lockdown. The performance of the vectorial aggregation during this period is worst than that of all other aggregation models, and than that of the stacked RF predicting the median of residuals. This behavior mirrors the fact that the impact of the pandemic strongly differs from one region to another, as is shown in Appendix B. On the other hand, vectorial aggregation achieves the best performance during the post-lockdown period and appears as a promising approach to predicting consumption under normal circumstances.

Conclusions and Future Work

We propose new transfer learning methods designed for forecasting time series observed at different hierarchical scales. We present two different settings and illustrate them with two different usecases:

1. To transfer information from finer scale (an aggregate of smart meters) to wider scale (national) data when the distribution of the data is stable with time, we propose to stack features from GAM obtained at these two scales into random forests.

2. To transfer information from local to global data when the distribution of the data is changing with time we propose hierarchical online aggregation of experts where the experts are generated at a finer scale (regional level) using quantile stacked random forest.

We demonstrate the interest of our proposed approach in both cases. In both cases transfer learning by RF stacking at a single scale improve significantly the forecasting performance of single GAM or RF model: 14% of improvement over GAM and 9% over the RF for case 1, 38% over GAM for case 2. It supports our original intuition that stacked RF gather both the ability of GAM to extrapolate and RF to model automatically interaction between covariates.

Regarding multi-scale transfer performances, we also obtained convincing results. In case 1, we improved the day-ahead forecasting performance of the wider scale stacked GAM-RF of about 1.5%

with our multi-scale transfer algorithm. For case 2, the best hierarchical aggregation algorithm improves about 10% the stacked GAM-RF at a wider scale. Our relatively simple strategy of rescaling plus aggregation behaves well in this bi-level hierarchy. We also saw that introducing strong constrains in the aggregation weight (vectorial aggregation) can be an interesting transfer strategy when the experts behave similarly at the different scales of the hierarchy. This is true during the post-covid period but not during the hard lockdown in France of March-April 2020 (we suspect that the effect of COVID on the electricity load impacts the different regions in a desynchronized way).

The main learner used in the paper for the final forecasting is based on stacked GAM-RF. We could have chosen other machine learning methods such as tree-based gradient boosting or neural networks, which can be tested in future work. Our experiments revealed that automatic variable selection when forecasting didn't show any improvement. However, in a high dimensional setting with a large number of features generated when learning the source, we believe that a possible approach that is worth exploring, is to use for forecasting a regression-reinforced random forest (RFRF) approach that may have better prediction performance than RFs. The idea behind RFRF is to borrow the strength of penalized parametric regression to improve RF. For example, for RFRFs, we may run a SCAD (or LASSO) (see [START_REF] Fan | Variable selection via nonconcave penalized likelihood and its oracle properties[END_REF]) based selection before RF, then construct a RF on the residuals from the SCAD (or LASSO) penalized fit. Preliminary simulation results show that RFRFs can capitalize on the strength of both parametric and nonparametric methods and may give reliable predictions in high-dimensional extrapolation problems such as those encountered in transfer learning.

In our first usecase, we did not investigate the clustering of smart meter data to generate diverse GAM features, but this is clearly a possible improvement. Introducing hierarchical constrains in the weights, as proposed in [START_REF] Brégère | Online hierarchical forecasting for power consumption data[END_REF], is an other potential perspective for our second usecase. Finding the good warping of weights constraints for vectorial aggregation could also be a way to improve the performance of this method on desynchronized data. We note that the effects of the GAM are among the most important covariates for predicting the GAM residuals. Using these effects as covariates allows to transfer information on the impact of weather and calendar variables learned on the large dataset of pre-pandemic observations. We observe a change in the importance of the different types of variables after the end of the lockdown, indicating that the RF is able to account for a relative change in electricity consumption patterns.

As time passes and the size of the training set for the RF increases, relevant variables such as the Government Response Tracker, or relative occupation of residence, and grocery and pharmacies, become more important for the prediction. Conversely, spurious variables (for example, the relative frequentation of parks, highly correlated with weather) are discarded as unimportant. Interestingly, the common RF trained on residuals across all regions detects these relevant variables more quickly (a) Weights of the regional and national experts in the prediction at the national level. Red:

sum of the weights of the quantile and GAM experts by region, in the aggregation targeting the national load using the full disaggregated approach. Green: weights of the regional experts, and for the national level in the aggregation targeting the national load using the scaled hierarchical approach. Blue: true proportion of the national electricity load consumed by the region.

(b) Weights of the quantile and GAM experts in the prediction at the national level. Weights of the quantile experts and the GAM expert in the aggregation targeting the national load using a full disaggregated approach (red), a hierachical aggregation approach (green), and a vectorial aggregation approach (blue).

regions in the scaled hierarchical aggregation presented in Figure B.7a, we note that the weights do not correspond to the proportion of electricity consumed by the regions (for example, regions with low true weights such as Provence-Alpes-Côte d'Azur may receive more weight in the aggregation than regions with high true weights, such as Île-de-France). Moreover, the weights in the aggrega-

Figure 1 :

 1 Figure 1: Experts used for predicting the normalized responses for the different zones and at the global level.

  (a) Fully disaggregated model. (b) Vectorial aggregation.

Figure 2 :

 2 Figure 2: Fully disaggregated and Vectorial aggregations strategies.

Figure 3 :

 3 Figure 3: Unscaled and scaled hierarchical Aggregations strategies.

  2019 and March 15th 2020, only the GAM predictions are available. During this period, vectorial aggregation makes little sense since there is only one type of expert. The lockdown period ranges between March 16th and May 11th: during this period, training data are very scarce, and models must quickly adapt to a dramatic change in electricity consumption patterns. The post-lockdown period, from May 12th to September 17th, corresponds to a new change in load pattern, due to a relative rebound in activity, to which the models must adapt.

  the sum of the importances of the variables in this group. The importance of the mobility measures is detailed in Figures B.4c and B.4d. (a) Average importance of types of variables in the staked RF at the national level. (b) Average importance of types of variables in the staked RF common to all regions and the national level. (c) Average importance of mobility measures in the staked RF at the national level. (d) Average importance of types of mobility measures in the staked RF common to all regions and the national level.

Figure B. 4 :

 4 Figure B.4: Evolution of the importance of the types of variables (top) and the mobility measures (bottom) in the RF trained on GAM residuals at the national level (left), and on GAM residuals for all regions and at the national level.

Figure B. 5 :

 5 Figure B.5: Importance of the variables in the stacked RF predicting the quantiles 0.05, 0.5 and 0.95 of the GAM residuals at the national level. The variables "GAMX " denotes the GAM effect corresponding to variable "X".

Figure B. 6 :

 6 Figure B.6: Accumulated Local Effects of the measure of relative frequentation of residential places (left) and workplaces (right) for the RF at the national level predicting the quantiles 0.05 (red), 0.5 (black), and 0.95 (blue).

Table 1 :

 1 Variables used in the models 2 and 3

	t	de-trended electricity load
	Temp t	weighted temperature
	Temp99 t	weighted and exponentially smoothed temperature
	Instant t	instant of the day
	DayType t	day of the week
	Holiday t	binary variable indicating public holiday days
	LongWeekEnd t binary variable indicating the presence of a long weekend
	ToY t	time of year

Table 2 :

 2 Thus, the models RF.nat, GAM.nat, GAM.RF.nat, and GAM.RF.local are trained on the same number of observations from the national dataset. Errors of prediction for the learners GAM.nat, RF.nat, GAM.RF.nat, and GAM.RF.local

		GAM.nat	RF.nat	GAM.RF.nat	GAM.RF.local
	RMSE	1409 MW	1339 MW	1214 MW	1193 MW
	MAPE	2.670	2.560	2.360	2.310
	Nb of covariates	7	7	22	32

Table 3 :

 3 TempMax99 z,t maximal value over the day of Temp99 z,t Load.48 z,t normalized load of the day before in the zone z Load.336 z,t normalized load of the week before in the zone z Variables at time t used in model 4.

	y norm z,t	normalized electricity load for the zone z
	Daytype t	categorical variable indicating the day of the week
	DLS t	binary variable indicating whether t is in summer hour or winter hour
	ToY t	time of year
	Temp z,t	temperature in the zone z
	Temp95 z,t	weighted and exponentially smoothed temperature of smoothing factor 0.95
	Temp99 z,t	weighted and exponentially smoothed temperature of smoothing factor 0.99
	TempMin99 z,t minimal value over the day of Temp99 z,t

Table 4 :

 4 Mean Absolute Percentage Error and Root of the Mean Squared Error of the stacked GAM and RF models.

https://www.noaa.gov/

https://www.ofgem.gov.uk/gas/retail-market/metering/transition-smart-meters/energy-demandresearch-project

Acknowledgements

The authors would like to thank the associate editor and the anonymous reviewers for their valuable suggestions and comments.

Appendix A. Variable selection for electricity load forecasting during the first Covid-

lockdown

We allow the RF to use many variables for their predictions, including usual calendar and weather variables, as well as mobility data, containment index, and estimated GAM effects, without knowing a priori which ones will be relevant to predict electricity consumption during the pandemic period. It is reasonable to think that including all covariates might be detrimental to the prediction, given the high correlations between some variables and the small number of observations available to train the model, especially in the early days of the lockdown.

Variable selection for the RF. We allow the RF to use many variables for their predictions, including usual calendar and weather variables, as well as mobility data, containment index, and estimated GAM effects, without knowing a priori which ones will be relevant to predict electricity consumption during the pandemic period. It is reasonable to assume that including all covariates might be detrimental to the prediction, given the high correlations between some variables and the small number of observations available to train the model, especially in the early days of lockdown.

We want to take advantage of the fact that the number of observations increases rapidly, by repeating the variable selection operation several times during the pandemic period, in order to be able to enrich the model if necessary. Moreover, we expect that the relevant variables might differ from one region to the other, and so we want to perform the variable selection region by region.

To do so, we select every week the variables to be used to train the RF for the following week's forecasts for a given region. Feature selection in RF is an ongoing field of research. State-ofthe-art methods rely on the ranking of variable importance measure, such as VSURF [START_REF] Genuer | VSURF: An R Package for Variable Selection Using Random Forests[END_REF], or on permutation of variables, such as Boruto [START_REF] Kursa | Feature selection with the Boruta package[END_REF]. These methods suffer from their important computational cost: VSURF, in particular, is too slow to be used in our context of numerous variable selection operations. We suggest an alternative approach to determine the relevant covariates, using the technics developed for variable selection in linear regression. More precisely, we fit a linear model to predict the residuals of the GAM during the pandemic period using a LASSO penalty. Without prior knowledge of the number of covariates necessary to accurately forecast electricity load, we design three models corresponding to different numbers of covariates. More precisely, we fit a LASSO with an ad-hoc penalty to select respectively 5 and 10 covariates. This variable selection step is repeated every week. Finally, the predictions 32 of the RF taking these 5 (respectively 10) covariates as input are combined with that of the RF taking all covariates as input using an expert aggregation method.

Before implementing this method for all regions and all quantiles, we evaluate its interest in predicting the 0.5 quantile of the national load using the available national data. We compare the MAPE of the predictor obtained using Boruto, Lasso variable selection with an aggregation step, and of the full model with 16 variables. The MAPE for the lockdown and post-lockdown periods are presented in Table A The preliminary results indicate that variable selection only marginally affects the performance of the RF. This underlines the robustness of the RF against a high dimension of the inputs, even when trained on relatively small data sets. We therefore consider the RF obtained using the full models, taking as input all covariates and estimated GAM effects. respectively the importance and normalized importance of variable v at time t, we have at any time t

We group the variables into 5 categories: the GAM effects, the measures of mobility, the government response tracker, the lagged residuals, and the day of the week. The importance of a group is simply than the individual RF trained solely on residuals at the national level. This highlights the interest of multi-task learning in this sparse data context.

We also investigate the relative importance of the variables in the stacked RF predicting the different quantiles. More precisely, we consider the stacked RF trained on the residuals at the national level for the pandemic period. We compute an importance measure of a given variable as the average increase in error in term of the pinball loss corresponding to a given quantile when the values of this variable are permuted at random (the error is computed over the training set).

The importances of the different variables are normalized so that their sum is equal to 100. We compare the importance of the variables for predicting the 0.05, 0.5, and 0.95 quantiles in Figure B.5. Variables important for predicting one quantile tend to be important for predicting the other quantiles. However, this is not the case for all variables: for example, the normalized load for the relative frequentation of residential place and workplaces have an outstanding importance for predicting the 0.05 and 0.95 quantiles. These variables have a very high (negative) correlation: the frequentation of workplaces is very low during the lockdown period, and remains relatively low in the post-lockdown period during weekdays; on the opposite, the frequentation of residential places is high during the lockdown period and remains relatively high in the post-lockdown period during weekdays. Looking at the Accumulated Local Effects of these variables, plotted in Figure B.6, we see that they have a much larger impact on the prediction of the two extreme quantiles than on that of the median. However, we expect their effects to partially cancel each other out because of the correlation between these variables.

Appendix B.2. Analysis of online aggregation

Our results indicate that online aggregation is an efficient way to take into account information available at a finer scale. Note that the regional GAM have in average errors much larger than that of the GAM at the national level, as illustrated in Figure B.8, due to larger fluctuations present at the finer scale. Interestingly, aggregating these low-accuracy models allows to obtain better performances than that of the GAM at the national level, even in the pre-pandemic period, as indicated by our results in Table 4.

The fact that scaled and unscaled hierarchical aggregation obtain similar performances is somewhat counterintuitive, given that in the scaled model the aggregation must learn the contribution of the different regions to the national consumption. Looking at the distribution of the weights of the tion typically exhibit much more flexibility than the true weights: this phenomenon is all the more striking in the fullydisaggregated model. The high variability of the weights suggests that some of the models considered are fairly interchangeable. The fact that the scaled hierarchical aggregation outperforms its unscaled counterpart both in the pre-pandemic and in the post-lockdown period suggests that the flexibility provided by the second layer of aggregation used in the scaled model compensates the lack of knowledge of the relative contribution of the different regions.

We see in Figure B.7b that all quantiles and GAM experts contribute to the prediction, both in the fully disaggregated model and in the hierarchical aggregation. By contrast, the vectorial aggregation gives a predominant weight to the GAM and median staked RF experts, which appears as the most relevant experts across all regions. Figure B.7 shows the weights given by an aggregation predicting the national load using only the national experts, and the weights given by the aggregation. Day 25 corresponds to the first day of the pandemic period; before that day only the GAM forecast is available to the aggregation. We note that the weights in the vectorial aggregation are highly unstable during the beginning of the lockdown. The performance of the vectorial aggregation during this period is worst than that of all other aggregation models, and than that of the stacked RF predicting the median of residuals. This behavior mirrors the fact that the impact of the pandemic strongly differs from one region to another, as is shown in Figure B.8. On the other hand, vectorial aggregation achieves the best performance during the post-lockdown period, and appears as a promising approach to predicting consumption under normal circumstances.


K Alkama
email: kalkama@atair.com

G Meunier

O Chadebec

J-M Guichon

B Bannwarth

E Vialardi

J Siau

R Perrin-Bit

Adaptive Mesh Procedure for the Unstructured Inductive PEEC Formulation

An adaptive mesh refinement procedure is presented in order to address efficiently low frequencies electromagnetic problems with the unstructured inductive PEEC method. An a posteriori error estimator based on an equilibrated energy criterion and on a method of calculating a second admissible solution are proposed. TEAM Workshop problem no • 7 has been treated in order to show the good efficiency of the procedure.

Index Terms-Unstructured Partial Element Equivalent Circuit (PEEC) method, Error Estimator, Adaptive mesh refinement.

I. INTRODUCTION

I N the process of designing power electronics devices, the correct representation of physical phenomena is crucial to ensure, for example, the electromagnetic compatibility. The sub-discretization of the studied domain can be a major cause of numerical error in electromagnetic simulations, and a good discretization requires having a good knowledge of the studied phenomena, which is generally not the case. The main motivation of this work is to develop an efficient error estimator for the unstructured Partial Element Equivalent Circuit (PEEC) method [START_REF] Siau | Volume Integral Formulation Using Face Elements for Electromagnetic Problem Considering Conductors and Dielectrics[END_REF], and to couple it with an adaptive mesh refinement procedure. These developments will improve the accuracy without excessively increasing the number of degrees of freedom (DOF). This will make in fine the method much more functional and attractive to model complex devices.

The approach consists in using an a posteriori equilibrated error estimator [START_REF] Remacle | Error estimation based on a new principle of projection and reconstruction[END_REF]. It is based on the non-verification of the material constitutive relationship (e.g. Ohm's law) discretization in the active domain using two complementary solutions, the initial unstructured PEEC solution J and an another admissible solution E . The admissible solution is obtained by projecting J interpolated in the facet function space and reconstructing it in the edge function space using the appropriate tools as shown in [START_REF] Remacle | Error estimation based on a new principle of projection and reconstruction[END_REF].This approach has been well validated on the TEAM workshop problem 7 [3] using a refinement mesh algorithm of the Altair Flux™ software [START_REF]Altair Flux™[END_REF].

II. UNSTRUCTURED INDUCTIVE PEEC FORMULATION

Considering the integral representation of the electric field E and the linear constitutive law J = σ • E in the conductive domain Ω, we can write

J (P ) σ (P ) = -jω µ 0 4π Ω J (Q) r dΩ -∇V (P ) (1)
where r is the distance between P and the integration point Q.

As proposed in [START_REF] Nguyen | An Integral Formulation for the Computation of 3-D Eddy Current Using Facet Elements[END_REF], J is interpolated with first-order face shape functions w f and with applying a standard Galerkin projection procedure to (1), a matrix system is obtained.

([R] + jω [L]) {I} = {δU}      [R] i,j = Ω w f i w f j σ dΩ [L] i,j = µ0 4π Ω w f i Ω w f j r dΩdΩ {δU} i = -Ω w f i ∇V dΩ
(2) It is seen as a circuit matrix system ZI = U, where each face of the mesh element represents one resistance and one self inductance and is completed by all mutual inductances, and I i is the current flowing through the face i. This equivalent circuit is solved using a classical circuit analysis approach i.e. an independent loop solver or an independent node solver. In this work, the solution J obtained by the system (2) is considered as a primal solution. As the facet functional space is used, the continuity of the normal component of J is naturally ensured, while the continuity of the tangential component of E would not be without the use of the edge functional space.

III. COMPUTING THE ADMISSIBLE SOLUTION E

In order to calculate the admissible solution E which ensures the continuity of its tangential component, a projection and reconstruction method of E is used, as proposed for the magnetic field H in [START_REF] Remacle | Error estimation based on a new principle of projection and reconstruction[END_REF]. J can be scaled and projected from the facet to the edge functional space, so this procedure is done by solving a finite element problem, according to:

j Ωe w ei • w ej • E j dΩ e = Ωe w ei • J σ dΩ e (3)
where w e are the edge shape functions used for the interpolation, and J σ represents values of the electric field E at Gauss points of each mesh element. The field E is obtained and the continuity of its tangential component on the mesh edges is ensured. This method is very efficient because a complete dual problem does not need to be solved, but only a FEM limited to the active material, i.e. very few DOF and a low memory are needed compared to PEEC approach to get the initial solution.

IV. ERROR ESTIMATION CRITERION

The error in the discretization of the constitutive relation can be estimated using the energy-based estimator [START_REF] Ladas | An energy based approach of electromagnetism applied to adaptive meshing and error criteria[END_REF]. The local error estimator is written in a normalized way according to a global quantity in the domain Ω. This normalization helps to highlight the contribution of the local error of a mesh element to the global error.

η elem = N × | ∫ Ω E J 2 dΩ E -∫ Ω E (σ • E ) 2 dΩ E Ω J 2 dΩ | (4)
And the global error estimator is written as follows

η global = | ∫ Ω J 2 dΩ -∫ Ω (σ • E ) 2 dΩ Ω J 2 dΩ | (5)
N is the number of mesh elements, and Ω E a volume element.

V. APPLICATION EXAMPLE

The TEAM Workshop problem 7 device is presented in Fig. 1. The plate is meshed with a initial tetrahedral conform mesh composed of 380 elements and solved at 50 Hz. The Joule losses are compared with the references obtained in [START_REF] Nguyen | An Integral Formulation for the Computation of 3-D Eddy Current Using Facet Elements[END_REF] with a dense FEM mesh of 2,000,000 elements. Fig. 1 shows the Joule losses in the plate versus the iterations of the adaptive and the uniform refinement (each element is divided into four sub-elements). Table I presents a summary of the comparison between the results obtained over the adaptive refinement iterations with the FEM reference. It is noticed that a solution close to the reference is quickly obtained, even if the starting mesh is coarse as in this case. At the 3 rd iteration, the same value of Joule loss is obtained for uniform and adaptive refinement, but with a large difference in terms of number of elements, as shown in Fig. 2, and also in terms of computation time: the refinement procedure takes 12 min and 103 min for the adaptive and the uniform strategies, respectively. If we have a look at the uniform refinement procedure, the 4 th iteration could not be solved with our computer due to the large number of elements (around 800,000), unlike adaptive refinement where the number is around 165,000. If the frequency is increased i.e skin depth highly reduced or if we need to deal with a more complex geometry, basic uniform mesh refinement becomes unsustainable for the PEEC method making the adaptive mesh technique very interesting. In Fig. 3, a comparison is done between the estimated global errors and real error, i.e. the Joule losses by taking the final mesh as a reference. The global estimated error has globally the same behavior compared to the real, which proves that the calculating method of the second admissible solution and the error estimator proposed are very efficient for dealing with this type of Eddy current problem.

Fig. 1 .

 1 Fig. 1. (Left) TEAM problem 7 geometry (mm) (Right) Joule losses evolution

Fig. 2 .

 2 Fig. 2. The mesh obtained for the 3 rd iteration of refinement at 50 Hz: (left) uniform (112.000 elements), (right) adaptive (34.000 elements)

Fig. 3 .

 3 Fig. 3. Global errors on the plate at 50 Hz

TABLE I RELATIVE

 I ERROR OF THE ADAPTIVE REMESHING COMPARED WITH FEM

		Elements	Joule losses (W)	Diff
	FEM	2.000.000	4,70	Ref
	PEEC 2 nd mesh iteration	6.868	4,63	1,48%
	PEEC 3 rd mesh iteration	33.977	4,70	0,08%


Innocent Niyonzima

Olivier Chadebec

Gérard Meunier

Nicolas Galopin

Jacob Fish

Multiphysics modeling of electromagnetically controlled shape memory polymer medical stents

Keywords: Biomedical implants, large deformation models, electromagnetic coupling, temperature control, thermomechanical processes

come

I. INTRODUCTION

S HAPE MEMORY POLYMERS (SMP) biomaterials can be used for the prevention and cure of diseases such as the coronary heart disease and the stroke [START_REF] Yahia | Shape memory polymers for biomedical applications[END_REF]. These smart materials can change their physical properties (morphing, Young modulus, etc.) when subjected to external stimuli such as temperature, pH and electromagnetic fields. They are mainly thermally activated and can be chosen biocompatible and biodegradable [START_REF] Yahia | Shape memory polymers for biomedical applications[END_REF]. For applications inside the human body, thermal contactless control can be achieved by the addition of electric/magnetic (nano)particles inclusions that can react to electromagnetic fields. Fig. 1. depicts the deployment of a stent in the blood vessel. Numerical models for composites biomaterials must account for the multiphysics coupling and the multiscale nature of the materials. This paper deals with the multiphysics modeling. The major challenge in developing multiphysics models in this application arises from the geometric non-linearity due to large mechanical deformations and that leads to the modification of the equations that govern the electromagnetic and thermal problems to account for motion. The other challenge is handling material non-linearities due to the presence of plastic and viscous behaviour for mechanics and nonlinear behaviour for electromagnetism. This paper introduces a multiphysics quasistatic model using the Lagrangian formalism for an electromagnetically controlled vascular stent excited by a coil.

II. LAGRANGIAN MULTIPHYSICS FORMULATIONS OF THE COUPLED PROBLEM

The general coupled problem is derived from Maxwell's equations and conservation laws. Physical phenomena that take place on the deformed configuration can be described using the Eulerian coordinates x. In this paper, we use the Lagrangian formalism and define the coupled problem using the coordinates X defined on the undeformed configuration. The open domains Ω Mec 0 , Ω The 0 and Ω Ele 0 denote the undeformed computational domains for the mechanical, thermal and electromagnetic problems, respectively. The differential operators Grad , Curl and Div denote the gradient, rotational and divergence operators defined on the undeformed configurations. The Lagrangian description can be used when the mapping

ϕ : Ω 0 → Ω t , X → x = ϕ(X) = X + u(X) is smooth enough.
The domain Ω t denotes the deformed configuration at the time t ∈ [t 0 , t end ) and the vector field u is the displacement field for large deformation.

The kinematics is described by the deformation gradient tensor and its determinant:

F = ∂x ∂X = 1 + Grad u , J = detF . (1)
In this paper, we consider a time-dependent thermal problem and quasistatic mechanical and electromagnetic problem thus neglecting electromagnetic waves and computing eddy currents by neglecting their contribution to the total field. The last assumption is reasonable for exciting sources with low frequencies and materials with low electric conductivity. The resulting problem can be solved using the a s -φ formulation where a s is the source vector potential, e.g., produced by a coil and that can be pre-computed, and φ is the unknown scalar electric potential. The Lagrangian description uses the pull-back of physical fields from the deformed to the undeformed configurations and the resolution of the multiphysics problem on the undeformed configuration. While the approach is very common for thermo-mechanical problems [START_REF] Belytschko | Nonlinear finite elements for continua and structures[END_REF], [START_REF] Wriggers | Nonlinear finite element methods[END_REF], it needs to be extended to electromagnetic problems. The resolution of the electromagnetic problem is relatively easy for the electric scalar potential formulation which does not need to be defined in the air. In the context of the finite element method, it becomes involved when the resolution requires a mesh of the air. An interesting alternative consists in using integral methods [START_REF] Meunier | A Magnetic Flux-Electric Current Volume Integral Formulation Based on Facet Elements for Solving Electromagnetic Problems[END_REF], and restricting the accurate computation of eddy currents to the mechanical domain. In this paper we describe the coupled problem with the scalar electric formulation.

In the Lagrangian description, Maxwell's equations remain unchanged while Piola transformations depend on the differential-form [START_REF] De Castro | Mathematical models and numerical simulation in electromagnetism[END_REF]. The transformations of the Eulerian 0differential form φ, 1-differential form e, 2-differential form b, 3-differential form f E and of the Eulerian second order tensors σ E and κ E read:

Φ = φ, A s = F T a s , B s = JF -1 b s f L = Jf E , σ L = JF -1 σ E F -T , κ L = JF -1 κ E F -T , (2)
where Φ, A s , B s , f L , σ L and κ L are Lagrangian electric scalar potential, source vector potential, source magnetic induction, volume force, electric and thermal conductivities expressed in the undeformed configuration. The indices E and L are used to denote Eulerian and Lagrangian quantities, respectively.

The weak form of the coupled problem reads [START_REF] Belytschko | Nonlinear finite elements for continua and structures[END_REF], [START_REF] Bossavit | omputational Electromagnetism. Variational Formulations, Complementarity, Edge Elements[END_REF], [START_REF] Niyonzima | Modeling and simulation of nonlinear electro-thermo-mechanical continua with application to shape memory polymeric medical devices[END_REF] :

find Φ × u × ϑ L such that Ω Ele 0 σ L Grad Φ•Grad Φ dΩ 0 + Ω Ele 0 σ L ∂ t A s •Grad Φ dΩ 0 = 0, Ω Mec 0 S EP (E, ϑ L , Z L ): δE -f L • u dΩ 0 = 0, (2 a-b) Ω The 0 ρ 0 c p ∂ϑ L ∂t •ϑ L dΩ 0 + Ω The 0 κ L Grad ϑ L -q L •Grad ϑ L dΩ 0 - Ω The 0 (F (σ L E eff + J s )) • (F -T E eff ) w L •ϑ L dΩ 0 + Γ conv,The 0 h L (t)(ϑ L -ϑ L,B ) n L •q L •ϑ L dΓ 0 = 0 (3)
holds for all test functions Φ × u × ϑ L in appropriate test function space. In (2 a-b)-( 3), S EP is the second Piola-Kirchoff stress tensor which depends on the Green-Lagrange strain tensor E = 1 2 (F T F -1) and a set of internal variables of the mechanical problem Z L . The quantity δE = F T u and E eff = -∂ t A s -Grad Φ is the pull-back of the effective electric field e eff = e + v × b. The terms J s , w L and h L are the source electric current, the Joule losses and the convection coefficient. The last term of (3) accounts for the convection that results from the exchange of heat with a fluid at the temperature ϑ L,B . The dependence of the electromagnetic force f L on the displacement u is achieved through J(u) and F (u) by:

f L = J -1 F (σ L E eff + J s ) J ×F Curl (A s ) B . (4)
III. NUMERICAL TESTS The multiphysics problem has been solved for 3D problem with a cylindrical SMP stent described in [START_REF] Niyonzima | Modeling and simulation of nonlinear electro-thermo-mechanical continua with application to shape memory polymeric medical devices[END_REF]. Fig. 2. depicts the displacement u, the Joule losses w L and the temperature ϑ L during the last process of recovery. In the extended paper, more theoretical details and results of the electro-thermo-mechanical problem will be given. We will also use the integral method to solve the electromagnetic problem.

Fig. 1 .

 1 Fig. 1. Schematic of the deployment of a stent in a blood vessel [1].

Fig. 2 .

 2 Fig. 2. Physical fields during the recovery. The left images correspond to t = 4.78125 × 10 -3 s and the right images correspond to t = 4.84375 × 10 -3 s. Top : displacement u. Middle : Joule losses w L . Bottom : Temperature ϑ L .


Quang-Anh Phan

Olivier Chadebec

Gerard Meunier

Jean-Michel Guichon

Bertrand Bannwarth

3D BEM Formulations for Eddy Current Problems with Multiply Connected Domains and Circuit Coupling

Keywords: Boundary Element Method, eddy currents, quasi-static, coupling circuits

Quasi-static linear problems can be solved efficiently with Boundary Element Method (BEM). This method is based on surface integral equations dealing with equivalent magnetic and electric surface current densities. Many works have shown the potentiality of BEM especially for the modeling of non-destructive testing devices. In this paper, after selecting formulations enabling the modeling of multiply-connected regions, an original coupling is proposed in order to take into account external electric circuit in the problem.

I. INTRODUCTION

T HIS study is motivated by the need of efficient low- frequency electromagnetic formulations associated to non-simply connected domains and which can be coupled with circuit equations. For this kind of problems, methods based on coupling between BEM and Finite Element Method (FEM) have already shown very good results. However, the accuracy of these methods is strongly influenced by the volume mesh of the conductive region which has to be adapted to the skin-depth in the FEM context. The pure BEM method does not suffer from this disadvantage because it is only based on surface discretizations and is more insensitive to frequency increase keeping the same mesh.

Many BEM formulations have already been proposed to solve Eddy Current (EC) problems and two options are possible. The first one consists in solving the full Maxwell equations including capacitive effects and to use an Helmholtz-Hodge decomposition to remove low-frequency numerical noise like proposed in [START_REF] Vigneron | Formulations Par Equations Integrales de Surface Pour La Simulation Numerique Du Controle Non Destructif Par Courants de Foucault[END_REF]. The second option is to solve directly Maxwell equations under the quasi-static assumption (i.e the EC problem) like proposed in [START_REF] Rucker | A bem code for 3-d eddy current calculations[END_REF], [START_REF] Zheng | Three-dimensional eddy current analysis by the boundary element method[END_REF] or [START_REF] Hiptmair | Boundary element methods for eddy current computation[END_REF]. In this work, the preference is given to the last approach.

In classical EC problems (like eddy current testing problems for instance), the active region can be multiply connected, meaning that it can have through-holes. It is fundamental to develop formulations which can solve accurately such a problem. An another key point is the ability of the formulation to be coupled with external electric circuits which create the external inductor field. This is what we aim to do in this paper. After selecting efficient BEM formulations for EC problems, an original circuit coupling is proposed. All the formulations are validated on numerous examples by a comparison with FEM.

II. SURFACE INTEGRAL FORMULATION

Let us consider a linear, isotropic and homogeneous conducting material region Ω characterized by the conductivity σ 1 and the permeability µ 1 and embedded in the free space Ω 0 . Γ is the border of the region Ω with the outward unit normal n. Surface integral equations of E and H at an arbitrary target point P in Ω 0 are :

(1) hH = H ex + Γ ((n • H 0 ) ∇G 0 + J s × ∇G 0 )dΓ (2) hE = E ex + Γ ((n • E 0 ) ∇G 0 -M s × ∇G 0 )dΓ -jωµ 0 Γ J s G 0 dΓ
and for a target point in Ω are :

(3) hH = - Γ µ 0 µ 1 (n • H 0 ) ∇G 1 -σ 1 M s G 1 dΓ - Γ J s × ∇G 1 dΓ (4) hE = Γ (M s × ∇G 1 + jωµ 1 J s G 0 )dΓ
where h = 0.5 if P is a regular point of the border Γ, h = 1 if P belongs to Ω or Ω 0 . The Green kernels expressions are

G 0 = 1 r and G 1 = 1 4πr e -(1+j)kr with k = ωµ1σ1 2
, H 0 and E 0 are the magnetic and electric fields in the air region respectively, H ex is the inductor magnetic field and E ex is the inductor electric field. J s and M s are equivalent fictitious magnetic and electrical surface currents such as :

(5)

J s = n × H (6) M s = -n × E
From the four equations above and by considering their normal and tangential projections on Γ, we get eight integral boundary equations. By combining these integral equations like presented in Table I, one obtains two formulations whom one calls EC1 and EC2. Let us notice that EC1 has already been presented in [START_REF] Zheng | Three-dimensional eddy current analysis by the boundary element method[END_REF] and EC2 in [START_REF] Vigneron | Formulations Par Equations Integrales de Surface Pour La Simulation Numerique Du Controle Non Destructif Par Courants de Foucault[END_REF], [START_REF] Hiptmair | Boundary element methods for eddy current computation[END_REF]. Both formulations can treat multiply connected problems and can be coupled with external electric circuits.

TABLE I FORMULATIONS Label Formulations

Unknown variables

EC1 n × [(1) + (3)], n × [(2) + (4)], n • [(2) + (4)] Js, Ms, n • E 0 EC2 n × [(1) -(3)], n × [(2) -(4)], n • [(2)] Js, Ms, n • E 0

III. CIRCUIT COUPLING

In the context of circuit coupling, the conducting region Ω is excited by external electrical circuits Ω k connected to voltage sources U k . The equation governing the k th electric circuit is presented in [START_REF] Meunier | Computation of coupled problem of 3D eddy current and electrical circuit by using T/sub 0/-T-/spl phi/ formulation[END_REF]:

(7) U k = I k R k + jω Ω k j 0k .AdΩ.
where R k is the ohmic resistance of Ω k , I k is the total current flowing in the circuit, j 0k is the normalized (1A) current density associated to Ω k and A is a total magnetic vector potential.

Let us consider equation [START_REF] Rucker | A bem code for 3-d eddy current calculations[END_REF]. By setting the coefficient h to 1 and thanks to the relation E = -jωA, we get a vector relation linking the unknowns to A in the air region and A ex . A ex is linked to I k by the Biot-Savart law which can be integrated numerically over Ω k . In a symmetrical way, the vector potential in (7) can be expressed with problem unknowns. This step and all the matrix coefficients will be explained in the full paper but an overview of the matrix system is presented in Fig. 1.

Formulations EC1 or EC2 and their coupling with electric circuit are solved at once. Unknown variables in our system consist of M s , J s , n • E 0 and {I k }.

M s J s E n0 M 21 M 22 {I k } {U k } M 11 M 12 = 0 Fig. 1.
Representation of the matrix system for the coupling.

IV. NUMERICAL RESULTS

A first simple test with a non-magnetic and conducting axisymmetric torus σ = 5.5E7(S/m) excited by a circular coil with current of 1000(A) is proposed. Obtained results are presented in Table II and Fig. 2 with the reference computed by 2D axisymmetric FEM. The geometry is meshed with about 2.300 quadrangle elements. It can be seen that results remains quite good even if the skin depth highly decrease keeping the mesh unchanged. This is one of the main advantage of BEM method compared to FEM where the mesh in the volume has to be adapted. The circuit coupling is now tested. A square section ring excited by an electric circuit described in Table III is considered. The reference is calculated by FEM with 2D axisymmetric model and a circuit coupling. The total currents flowing in the electric circuit are compared in Table IV. The difference is very low even if the frequency is high validating the coupling and demonstrating its performance.

Fig. 2 .

 2 Fig. 2. Comparisons of magnetic field computed on a line located in the air region.