Laurent Gardes

Stéphane Girard

Gilles Stupfler

Extreme tail L p -median estimation

Keywords: asymptotic normality, conditional tail expectation, extreme value statistics, heavytailed distribution, L p -optimisation, median shortfall, semiparametric extrapolation

The Conditional Tail Expectation is an indicator of tail behaviour that takes into account both the frequency and magnitude of a tail event. However, the asymptotic normality of its empirical estimator requires that the underlying distribution possess a finite variance; this can be a strong restriction in actuarial and financial applications. A valuable alternative is the Median Shortfall, although it only gives information about the frequency of a tail event. We construct a class of tail L p -medians encompassing the Median Shortfall and Conditional Tail Expectation.

For p in (1, 2), a tail L p -median depends on both the frequency and magnitude of tail events, and its empirical estimator is, within the range of the data, asymptotically normal under a condition weaker than a finite variance. We extrapolate this estimator and another technique to extreme levels using the heavy-tailed framework. The estimators are showcased on a simulation study and on real fire insurance data.

Introduction

A precise assessment of extreme risk is a crucial question in a number of fields of statistical applications. In actuarial science and finance, especially, a major question is to get a good understanding of potential extreme claims and losses that would constitute a threat to the survival of a company.

This has historically been done by simply using a quantile, also called Value-at-Risk (VaR) in the actuarial and financial world. The quantile of a real-valued random variable X at level α ∈ (0, 1) is, by definition, the lowest value q(α) which is exceeded by X with probability not larger than 1 -α. As a consequence, quantiles only provide an information about the frequency of a tail event; in particular, the quantile q(α) gives no indication about how heavy the right tail of X is or, perhaps more concretely, as to what a typical value of X above q(α) would be. From a risk assessment perspective, this is clearly an issue, as quantiles allow to quantify what a risky situation is (i.e. the quantile level), but not what the consequences of a risky situation would be (i.e. the behaviour of X beyond the quantile level).

The notion of Conditional Tail Expectation (CTE) precisely addresses this point. This risk measure, defined as CTE(α) := E[X | X > q(α)], is exactly the average value of X given that X > q(α).

When X is continuous, CTE(α) coincides with the so-called Expected Shortfall ES(α), also known as Tail Value-at-Risk or Conditional Value-at-Risk and discussed in [START_REF] Acerbi | On the coherence of expected shortfall[END_REF], [START_REF] Rockafellar | Conditional Value-at-Risk for general loss distributions[END_REF], [START_REF] Tasche | Expected shortfall and beyond[END_REF], which is the average value of the quantile function τ → q(τ ) over the interval [α, 1). The potential of CTE for use in actuarial and financial risk management has been considered by a number of studies, such as [START_REF] Brazauskas | Estimating conditional tail expectation with actuarial applications in view[END_REF], [START_REF] Tasche | Capital allocation to business units and sub-portfolios: the Euler principle[END_REF], [START_REF] Wüthrich | Financial modeling, actuarial valuation and solvency in insurance[END_REF], [START_REF] Emmer | What is the best risk measure in practice? A comparison of standard measures[END_REF]. Outside academic contexts, the CTE risk measure is used in capital requirement calculations by the Canadian financial and actuarial sectors (IMF, 2014), as well as for guaranteeing the sustainability of life insurance annuities in the USA (OECD, 2016). European regulators, via the Basel Committee on Banking Supervision, also recently recommended to use CTE rather than VaR in internal market risk models (BCBS, 2013).

Whether the CTE or VaR should be used in a given financial application is still very much up for debate: we point to, among others, [START_REF] Artzner | Coherent measures of risk[END_REF], [START_REF] Embrechts | Multivariate extremes and the aggregation of dependent risks: examples and counter-examples[END_REF], [START_REF] Gneiting | Making and evaluating point forecasts[END_REF], [START_REF] Daníelsson | Fat tails, VaR and subadditivity[END_REF], [START_REF] Kou | On the measurement of economic tail risk[END_REF] who discuss the various intrinsic axiomatic properties of CTE and/or VaR and their practical interpretations.

Aside from axiomatic considerations, the estimation of the CTE by the empirical conditional tail moment requires a finite (tail) second moment if this estimator is to be asymptotically normal.

This should of course be expected, since a condition for the sample average to be an asymptotically normal estimator of the sample mean is precisely the finiteness of the variance. In heavy-tailed models, which are of interest in insurance/finance and that will be the focus of this paper, such moment restrictions can be essentially reformulated in terms of a condition on the tail index γ of X. The variable X is heavy-tailed with index γ > 0 if its distribution behaves approximately like a power law distribution with exponent 1/γ: P(X > x) = x -1/γ (x) for x large enough,

(1)

where is a slowly varying function at infinity, namely (tx)/ (t) → 1 as t → ∞ for any x > 0 (Beirlant et al., 2004, p.57). In such a model, the finite second moment condition is violated when the tail index γ, controlling the right tail heaviness of X, is such that γ > 1/2. At the finite-sample level, it is often desirable to have a finite fourth moment; this stronger condition is violated whenever γ > 1/4. Table 1 in the simulation study of El [START_REF] El Methni | Extreme versions of Wang risk measures and their estimation for heavy-tailed distributions[END_REF] shows a quite strong deterioration in the finite-sample performance of the empirical conditional tail moment as γ increases to 1/4. A number of actuarial and financial data sets have been found

to violate such integrability assumptions: we refer to, for instance, the Danish fire insurance data set considered in Example 4.2 of [START_REF] Resnick | Heavy-tail phenomena: probabilistic and statistical modeling[END_REF], emerging market stock returns data [START_REF] Hill | Least tail-trimmed squares for infinite variance autoregressions[END_REF][START_REF] Ling | Self-weighted least absolute deviation estimation for infinite variance autoregressive models[END_REF] and exchange rates data [START_REF] Hill | Expected shortfall estimation and Gaussian inference for infinite variance time series[END_REF]. The deterioration in finite-sample performance as the number of finite moments decreases is due in no small part to increased variability in the right tail of X as γ increases, see Section 3.1 in El [START_REF] El Methni | Improved estimators of extreme Wang distortion risk measures for very heavy-tailed distributions[END_REF]. To counteract this variability, one could move away from the CTE and use the Median Shortfall MS [START_REF] Kou | External risk measures and Basel accords[END_REF][START_REF] Kou | On the measurement of economic tail risk[END_REF], just as one can use the median instead of the mean for added robustness.

However, MS(α) is nothing but q([1 + α]/2) and as such, similarly to VaR, does not contain any information on the behaviour of X beyond its value.

Our goal here is to design a class of tail indicators that realise a compromise between the sensitivity of the Conditional Tail Expectation and the robustness of the Median Shortfall. We will start by

showing that these two quantities can be obtained in a new unified framework, which we call the class of tail L p -medians. A tail L p -median at level α ∈ (0, 1) is obtained, for p ≥ 1, by minimising an L p -moment criterion which only considers the probabilistic behaviour of X above a quantile q(α). As such, it satisfies a number of interesting properties we will investigate. Most importantly, the class of tail L p -medians is linked to the notion of L p -quantiles introduced by [START_REF] Chen | Conditional L p -quantiles and their application to testing of symmetry in nonparametric regression[END_REF] and recently studied in heavy-tailed frameworks by [START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF], a tail L p -median being the L p -quantile of order 1/2 (or L p -median) of the variable X | X > q(α). In particular, the classical median of X is the L 1 -median and the mean of X is the L 2 -median (or expectile of order 1/2, in the terminology of [START_REF] Newey | Asymmetric least squares estimation and testing[END_REF], and we will show that similarly, the Median Shortfall is the tail L 1 -median, while the Conditional Tail Expectation is the tail L 2 -median. Like L p -quantiles, tail L p -medians with p > 1 depend on both the frequency of the event {X > q(α)} and the actual behaviour of X beyond q(α). At the technical level, a condition for a tail L p -median to exist is that γ < 1/(p -1), and it can be empirically estimated at high levels by an asymptotically Gaussian estimator if γ < 1/[2(p -1)]. When p ∈ (1, 2), the tail L p -median and the L p -quantile therefore simultaneously exist and are accurately estimable in a wider class of models than the CTE is.

However, there are a number of differences between tail L p -medians and L p -quantiles. For example, the theoretical analysis of the asymptotic behaviour of tail L p -medians, as α → 1 -(where throughout the paper, "→ 1 -" denotes taking a left limit at 1), is technically more complex than that of L p -quantiles. The asymptotic results that arise show that the tail L p -median at level α is asymptotically proportional to the quantile q(α), as α → 1 -, through a non-explicit but very accurately approximable constant, and the remainder term in the asymptotic relationship is exclusively controlled by extreme value parameters of X. This stands in contrast with L p -quantiles, which also are asymptotically proportional to the quantile q(α) through a simpler constant, although the remainder term crucially features the expectation and left-tail behaviour of X. The remainder term plays an important role in the estimation, as it determines the bias term in our eventual estimators, and we will then argue that the extreme value behaviour of tail L p -medians is easier to understand and more natural than that of L p -quantiles. We will also explain why, for heavytailed models, extreme tail L p -medians are able to interpolate monotonically between extreme MS and extreme CTE, as p varies in (1, 2) and for γ < 1. By contrast, L p -quantiles are known not to interpolate monotonically between quantiles and expectiles (see Figure 1 in [START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF]. The interpolation property also makes it possible to interpret an extreme tail L p -median as a weighted average of extreme MS and extreme CTE. This is likely to be helpful as far as the practical applicability of tail L p -medians is concerned, to the extent that it allows for a simple choice of p reflecting a pre-specified compromise between the extreme MS and CTE.

We shall then examine how to estimate an extreme tail L p -median. This amounts to estimating a tail L p -median at a level α = α n → 1 -as the size n of the sample of data tends to infinity.

We start by suggesting two estimation methods in the so-called intermediate case n

(1 -α n ) → ∞.
Although the design stage of our tail L p -median estimators has similarities with that of the L p -quantile estimators in [START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF], the investigation of the asymptotic properties of the tail L p -median estimators is more challenging and technically involved. These methods will provide us with basic estimators that we will extrapolate at a proper extreme level α n , which ), using the heavy-tailed assumption. We will, as a theoretical byproduct, demonstrate how our results make it possible to recover or improve upon known results in the literature on Conditional Tail Expectation. Our final step will be to assess the finite-sample behaviour of the suggested estimators. Our focus will not be to consider heavy-tailed models with a small value of γ: for these models and more generally in models with finite fourth moment, it is unlikely that any improvement will be brought on the CTE, whether in terms of quality of estimation or interpretability. Our view is rather that the use of tail L p -medians with p ∈ (1, 2) will be beneficial for very heavy-tailed models, in which γ is higher than the finite fourth moment threshold γ = 1/4, and possibly higher than the finite variance threshold γ = 1/2. For such values of γ and with an extreme level set to be α n = 1 -1/n (a typical choice in applications, used recently in [START_REF] Cai | Estimation of the marginal expected shortfall: the mean when a related variable is extreme[END_REF][START_REF] Gong | Estimation of extreme quantiles for functions of dependent random variables[END_REF], we shall then evaluate the finite-sample performance of our estimators on simulated data sets, as well as on a real set of fire insurance data featuring an estimated value of γ larger than 1/2.

satisfies n(1 -α n ) → c ∈ [0, ∞
The paper is organised as follows. We first give a rigorous definition of our concept of tail L p -median and state some of its elementary properties in Section 2. Section 3 then focuses on the analysis of asymptotic properties of the population tail L p -median, as α → 1 -, in heavy-tailed models. Estimators of an extreme tail L p -median, obtained by first constructing two distinct estimators at intermediate levels which are then extrapolated to extreme levels, will be discussed in Section 4. A simulation study of the finite-sample performance of our estimators is presented in Section 5, and an application to real fire insurance data is discussed in Section 6. Proofs and auxiliary results are deferred to an online Supplementary Material document.

Definition and first properties

Let X be a real-valued random variable with distribution function F and quantile function q

given by q(α)

:= inf{x ∈ R | F (x) ≥ α}.
It is assumed throughout the paper that F is continuous, so that F (q(α)) = α for any α ∈ (0, 1). Our construction is motivated by the following two observations. Firstly, the median and mean of X can respectively be obtained by minimising an expected absolute deviation and expected squared deviation:

q(1/2) = arg min m∈R E (|X -m| -|X|) and E(X) = arg min m∈R E |X -m| 2 -|X| 2 (provided E|X| < ∞).
The first identity is shown in e.g. [START_REF] Koenker | Regression quantiles[END_REF] and [START_REF] Koenker | Quantile regression[END_REF]; the minimiser on the right-hand side thereof may actually not be unique (although it is if F is strictly increasing).

Our convention throughout this paper will be that in such a situation, the minimiser is taken as the smallest possible minimiser, making the identity valid in any case. Note also that subtracting |X| (resp. |X| 2 ) within the expectation in the cost function for q(1/2) (resp. E(X)) makes it possible to define this cost function, and therefore its minimiser, without assuming any integrability condition on X (resp. by assuming only E|X| < ∞), as a consequence of the triangle inequality (resp. the identity |X -m| 2 -|X| 2 = m(m -2X)). These optimisation problems extend their arguably better-known formulations

q(1/2) = arg min m∈R E|X -m| and E(X) = arg min m∈R E(X -m) 2
which are only well-defined when E|X| < ∞ and E(X 2 ) < ∞ respectively.

Secondly, since F is continuous, the Median Shortfall MS(α) = q([1 + α]/2) is the median of X given X > q(α), see Example 3 in [START_REF] Kou | On the measurement of economic tail risk[END_REF]. Since CTE(α) is the expectation of X given X > q(α), we find that

MS(α) = arg min m∈R E (|X -m| -|X| | X > q(α))
and CTE(α) = arg min

m∈R E |X -m| 2 -|X| 2 | X > q(α) (provided E(|X| | X > q(α)) < ∞).
Our construction now encompasses these two quantities by replacing the absolute or squared deviations by power deviations.

Definition 1. The tail L p -median of X, of order α ∈ (0, 1), is (when it exists)

m p (α) = arg min m∈R E (|X -m| p -|X| p | X > q(α)) .
Let us highlight the following important connection between the tail L p -median and the notion of L p -quantiles: recall, from [START_REF] Chen | Conditional L p -quantiles and their application to testing of symmetry in nonparametric regression[END_REF] and [START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF], that an L p -quantile of order τ ∈ (0, 1) of a univariate random variable Y , with E|Y | p-1 < ∞, is defined as

q τ (p) = arg min q∈R E |τ -1 {Y ≤q} | • |Y -q| p -|τ -1 {Y ≤0} | • |Y | p .
Consequently, the L p -median of Y , obtained for τ = 1/2, is

q 1/2 (p) = arg min q∈R E (|Y -q| p -|Y | p ) .
For an arbitrary p ≥ 1, the tail L p -median m p (α) of X is then exactly an L p -median of X given that X > q(α). This construction of m p (α) as an L p -median given the tail event {X > q(α)} is what motivated the name "tail L p -median" for m p (α).

We underline again that subtracting |X| p inside the expectation in Definition 1 above makes the cost function well-defined whenever E(|X| p-1 | X > q(α)) is finite (or equivalently E(X p-1 + ) < ∞, where X + := max(X, 0)). This is a straightforward consequence of the triangle inequality when p = 1; when p > 1, this is a consequence of the fact that the function x → |x| p is continuously differentiable with derivative x → p|x| p-1 sign(x), together with the mean value theorem. If X is moreover assumed to satisfy E(X p + ) < ∞, then the definition of m p (α) is equivalently and perhaps more intuitively

m p (α) = arg min m∈R E (|X -m| p | X > q(α)) .
The following result shows in particular that if E(X p-1 + ) < ∞ for some p ≥ 1, then the tail L p -median always exists and is characterised by a simple equation. Especially, for p ∈ (1, 2), the tail L p -median m p (α) exists and is unique under a weaker integrability condition than the assumption of a finite first tail moment which is necessary for the existence of CTE(α).

Proposition 1. Let p ≥ 1. Pick α ∈ (0, 1) and assume that E(X p-1 + ) < ∞. Then:

(i) The tail L p -median m p (α) exists and is such that m p (α) > q(α).

(ii) The tail L p -median is equivariant with respect to increasing affine transformations: if m X p (α) is the tail L p -median of X and Y = aX + b with a > 0 and b ∈ R, then the tail L p -median

m Y p (α) of Y is m Y p (α) = a m X p (α) + b. (iii) When p > 1, the tail L p -median m p (α) is the unique m ∈ R solution of the equation E[(m -X) p-1 1 {q(α)<X<m} ] = E[(X -m) p-1 1 {X>m} ].
(iv) The tail L p -median defines a monotonic functional with respect to first-order stochastic dominance: if Y is another random variable such that E(Y p-1 + ) < ∞ then

(∀t ∈ R, P(X > t) ≤ P(Y > t)) ⇒ m X p (α) ≤ m Y p (α).
(v) When E|X| p-1 < ∞, the function α → m p (α) is nondecreasing on (0, 1).

Let us highlight that, in addition to these properties, we have most importantly MS(α) = m 1 (α) and CTE(α) = m 2 (α).

(2)

In other words, the Median Shortfall is the tail L 1 -median and the Conditional Tail Expectation is the tail L 2 -median: the class of tail L p -medians encompasses the notions of MS and CTE. We conclude this section by noting that, like MS, the tail L p -median is not subadditive (for 1 < p < 2).

Our objective here is not, however, to construct an alternative class of risk measures which have perfect axiomatic properties. There have been several instances when non-subadditive measures were found to be of practical value: besides the non-subadditive VaR and MS, L p -quantiles define, for 1 < p < 2, non-subadditive risk measures that can be fruitfully used for, among others, the backtesting of extreme quantile estimates (see [START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF]. This work is, rather, primarily intended to provide an interpretable middleway between the risk measures MS(α) and CTE(α), for a level α close to 1. This will be useful when the number of finite moments of X is low (typically, less than 4) because the estimation of CTE(α), for high α, is then a difficult task in practice.

3 Asymptotic properties of an extreme tail L p -median

It has been found in the literature that heavy-tailed distributions generally constitute appropriate models for the extreme value behaviour of actuarial and financial data, and particularly for extremely high insurance claims and atypical financial log-returns [START_REF] Embrechts | Modelling extremal events for insurance and finance[END_REF][START_REF] Resnick | Heavy-tail phenomena: probabilistic and statistical modeling[END_REF]. Our first focus is therefore to analyse whether m p (α), for p ∈ (1, 2), does indeed provide a middle ground between MS(α) and CTE(α), as α → 1 -, in heavy-tailed models. This is done by introducing the following regular variation assumption on the survival function

F := 1 -F of X.
C 1 (γ) There exists γ > 0 such that for all x > 0, lim t→∞ F (tx)/F (t) = x -1/γ .

In other words, condition C 1 (γ) means that the function F is regularly varying with index -1/γ in a neighbourhood of +∞ [START_REF] Bingham | Regular variation[END_REF]; for this reason, condition C 1 (γ) is equivalent to assuming (1). Note that, most importantly for our purposes, assuming this condition is equivalent to supposing that the tail quantile function t → U (t) := q(1 -t -1 ) of X is regularly varying with tail index γ. We also remark that when C 1 (γ) is satisfied then X does not have any finite conditional tail moments of order larger than 1/γ; similarly, all conditional tail moments of X of order smaller than 1/γ are finite (a rigorous statement is Exercise 1.16 in de [START_REF] De Haan | Extreme value theory: an introduction[END_REF]. Since the existence of a tail L p -median requires finite conditional tail moments of order p -1, this means that our minimal working condition on the pair (p, γ) should be γ < 1/(p -1), a condition that will indeed appear in many of our asymptotic results.

We now provide some insight into what asymptotic result on m p (α) we should aim for under condition C 1 (γ). A consequence of this condition is that above a high threshold u, the variable X/u is approximately Pareto distributed with tail index γ, or, in other words:

∀x > 1, P X q(α) > x X q(α) > 1 → x -1/γ as α → 1 -.
This is exactly the first statement of Theorem 1.2.1 in de [START_REF] De Haan | Extreme value theory: an introduction[END_REF]. The above conditional Pareto approximation then suggests that when α is close enough to 1, the optimisation criterion in Definition 1 can be approximately written as follows:

m p (α) q(α) ≈ arg min M ∈R E [|Z γ -M | p -|Z γ | p ]
where Z γ has a Pareto distribution with tail index γ. For the variable Z γ , we can differentiate the cost function and use change-of-variables formulae to get that the minimiser M of the righthand side should satisfy the equation g p,γ (1/M ) = B(p, γ -1 -p + 1), where g p,γ (t) := 1 t (1u) p-1 u -1/γ-1 du for t ∈ (0, 1) and B(x, y) = 1 0 v x-1 (1 -v) y-1 dv denotes the Beta function. In other words, and for a Pareto random variable, we have

m p (α) q(α) = 1 κ(p, γ) where κ(p, γ) := g -1 p,γ (B(p, γ -1 -p + 1))
and g -1 p,γ denotes the inverse of the decreasing function g p,γ on (0, 1). Our first asymptotic result states that this proportionality relationship is still valid asymptotically under condition C 1 (γ).

Proposition 2. Suppose that p ≥ 1 and C 1 (γ) holds with γ < 1/(p -1). Then:

lim α→1 - m p (α) q(α) = 1 κ(p, γ) .
It follows from Proposition 2 that a tail L p -median above a high exceedance level is approximately a multiple of this exceedance level. This first-order result is similar in spirit to other asymptotic proportionality relationships linking extreme risk measures to extreme quantiles: we refer to Daouia analysis of extreme Wang distortion risk measures. A consequence of this result is that, similarly to extreme L p -quantiles, an extreme tail L p -median contains both the information contained in the quantile q(α) plus the information on tail heaviness provided by the tail index γ. This point shall be further used and discussed in Sections 4.2 and 5. Let us also highlight that Proposition 2 does not hold true for γ = 1/(p -1), since κ(p, γ) is then not well-defined.

The asymptotic proportionality constant κ(p, γ) ∈ (0, 1) does not have a simple closed form in general, due to the complicated expression of the function g p,γ . It does however have a nice explicit expression in the two particular cases p = 1 and p = 2. For p = 1, we have κ(1, γ) = 2 -γ , see Lemma 2(ii) in the Supplementary Material document. This clearly yields the same equivalent as the one obtained using the regular variation of the tail quantile function U with index γ, i.e. in virtue of (2): 2), Proposition 2 agrees here with the asymptotic equivalent of CTE(α) in terms of the exceedance level q(α), see e.g. [START_REF] Hua | Second order regular variation and conditional tail expectation of multiple risks[END_REF].

m 1 (α) q(α) = q((1 + α)/2) q(α) = U (2(1 -α) -1 ) U ((1 -α) -1 ) → 2 γ as α → 1 -. When p = 2 and γ ∈ (0, 1), κ(2, γ) = 1 -γ, see Lemma 3(ii) in the Supplementary Material document. Since in this case, m 2 (α) is nothing but CTE(α) by (
For other values of p, an accurate numerical computation of the constant κ(p, γ) can be carried out the functions p → κ(p, γ) and γ → κ(p, γ) seem to be both decreasing. This and (2) entail in particular that, for all p 1 , p 2 ∈ (1, 2) such that p 1 < p 2 , we have, for α close enough to 1:

MS(α) = m 1 (α) < m p 1 (α) < m p 2 (α) < m 2 (α) = CTE(α).
The tail L p -median m p (α) can therefore be seen as a risk measure interpolating monotonically between MS(α) and CTE(α), at a high enough level α. Actually, Proposition 2 yields, for all p ∈

[1, 2] and γ < 1/(p -1) that, as α → 1 -,

m p (α) ≈ λ(p, γ)MS(α) + [1 -λ(p, γ)]CTE(α), (3)
where the weighting constant λ(p, γ) ∈ [0, 1] is defined by

λ(p, γ) := lim α→1 - m p (α) -CTE(α) MS(α) -CTE(α) = 1 -(1 -γ)/κ(p, γ) 1 -2 γ (1 -γ) . (4)
Extreme tail L p -medians of heavy-tailed models can then be interpreted, for p ∈ (1, 2), as weighted averages of extreme Median Shortfall and extreme Conditional Expectation at the same level. It should be noted that, by contrast, the monotonic interpolation property (and hence the weighted average interpretation) is demonstrably false in general for L p -quantiles, as is most easily seen from Figure 1 The fact that γ → κ(p, γ) is decreasing, meanwhile, can be proven rigorously by noting that its partial derivative ∂κ/∂γ is negative (see Theorem 2 below). More intuitively, the monotonicity of γ → κ(p, γ) can be seen as a consequence of the heavy-tailedness of the distribution function F .

Indeed, we saw that heuristically, as α → 1 -,

m p (α) q(α) ≈ arg min M ∈R E [|Z γ -M | p -|Z γ | p ]
where Z γ is a Pareto random variable with tail index γ. When γ increases, the random variable Z γ tends to return higher values because its survival function

P(Z γ > z) = z -1/γ (for z > 1)
is an increasing function of γ. We can therefore expect that, as γ increases, a higher value of M = m p (α)/q(α) will be needed in order to minimise the above cost function.

Our next goal is to derive an asymptotic expansion of the tail L p -median m p (α), relatively to the high exceedance level q(α). This will be the key theoretical tool making it possible to analyse the asymptotic properties of estimators of an extreme tail L p -median. For this, we need to quantify precisely the error term in the convergence given by Proposition 2, and this prompts us to introduce the following second-order regular variation condition:

C 2 (γ, ρ, A)
The function F is second-order regularly varying in a neighbourhood of +∞ with index -1/γ < 0, second-order parameter ρ ≤ 0 and an auxiliary function A having constant sign and converging to 0 at infinity, that is,

∀x > 0, lim t→∞ 1 A(1/F (t)) F (tx) F (t) -x -1/γ = x -1/γ x ρ/γ -1 γρ ,
where the right-hand side should be read as x -1/γ log(x)/γ 2 when ρ = 0.

∀x > 0, lim t→∞ 1 A(t) U (tx) U (t) -x γ = x γ x ρ -1 ρ . (5)
In ( 5), the right-hand side should be read as x γ log x when ρ = 0 (similarly, throughout this paper, quantities depending on ρ are extended by continuity using their left limit as ρ → 0 -).

The next result is the desired refinement of Proposition 2 giving the error term in the asymptotic proportionality relationship linking m p (α) to q(α) when α → 1 -.

Proposition 3. Suppose that p ≥ 1 and C 2 (γ, ρ, A) holds with γ < 1/(p -1). Then, as α → 1 -,

m p (α) q(α) = 1 κ(p, γ) 1 + [R(p, γ, ρ) + o(1)]A (1 -α) -1 with R(p, γ, ρ) = [κ(p, γ)] -(ρ-1)/γ (1 -κ(p, γ)) p-1 × 1 -ρ γρ B(p, (1 -ρ)γ -1 -p + 1) -g p,γ/(1-ρ) (κ(p, γ)) .
This result is similar in spirit to second-order results that have been shown for other extreme risk measures: we refer again to [START_REF] Zhu | Tail distortion risk and its asymptotic analysis[END_REF] and [START_REF] Yang | First-and second-order asymptotics for the tail distortion risk measure of extreme risks[END_REF], as well as to El Methni & Stupfler (2017), [START_REF] Daouia | Estimation of tail risk based on extreme expectiles[END_REF][START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF] for analogue results used as a basis to carry out extreme-value based inference on other types of indicators. It should, however, be underlined that the asymptotic expansion of an extreme tail L p -median depends solely on the extreme parameters γ, ρ and A, along with the power p. By contrast, the asymptotic expansion of an extreme L p -quantile depends on the expectation and left-tail behaviour of X, which are typically considered to be irrelevant to the understanding of the right tail of X. From an extreme value point of view, the asymptotic expansion of extreme tail L p -medians is therefore easier to understand than that of L p -quantiles.

Statistically speaking, it also implies that there are less sources of potential bias in extreme tail L p -median estimation than in extreme L p -quantile estimation. Both of these statements can be explained by the fact that the tail L p -median is constructed exclusively on the event {X > q(α)}, while the equation defining an L p -quantile q p (α) is [START_REF] Chen | Conditional L p -quantiles and their application to testing of symmetry in nonparametric regression[END_REF], Section 2). The left-hand side term ensures that the central and left-tail behaviour of X will necessarily have an influence on the value of any L p -quantile, even at an extreme level.

(1 -α)E((q p (α) -X) p-1 1 {X<qp(α)} ) = αE((X -q p (α)) p-1 1 {X>qp(α)} )
The construction of a tail L p -median as an L p -median in the right tail of X removes this issue.

Like the asymptotic proportionality constant κ(p, γ) on which it depends, the remainder term R(p, γ, ρ) does not have an explicit form in general. That being said, R(1, γ, ρ) and R(2, γ, ρ) have simple explicit values: for p = 1, R(1, γ, ρ) = (2 ρ -1)/ρ (with the convention (x ρ -1)/ρ = log x for ρ = 0), see Lemma 2(iii) in the Supplementary Material document. We then find back the result that comes as an immediate consequence of (2) and our second-order condition C 2 (γ, ρ, A),

via (5): m 1 (α) q(α) = U (2(1 -α) -1 ) U ((1 -α) -1 ) = 2 γ 1 + A((1 -α) -1 ) 2 ρ -1 ρ (1 + o(1)) .
For p = 2 and γ ∈ (0, 1), ( 2) and ( 5) suggest that:

m 2 (α) q(α) = ∞ 1 U ((1 -α) -1 x) U ((1 -α) -1 ) dx x 2 = 1 1 -γ 1 + 1 1 -γ -ρ A((1 -α) -1 )(1 + o(1))
which coincides with Proposition 3, given that R(2, γ, ρ) = 1/(1 -γ -ρ) from Lemma 3(iii) in the Supplementary Material document.

We close this section by noting that all our results, and indeed the practical use of the tail L p -median more generally, depend on the fixed value of the constant p. Just as when using L p -quantiles, the choice of p in practice is a difficult but important question. Although [START_REF] Chen | Conditional L p -quantiles and their application to testing of symmetry in nonparametric regression[END_REF] introduced L p -quantiles in the context of testing for symmetry in non-parametric regression, it did not investigate the question of the choice of p. In [START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF], extreme L p -quantiles were used as vehicles for the estimation of extreme quantiles and expectiles and for extreme quantile forecast validation; in connection with the latter, it is observed that neither p = 1 nor p = 2 provide the best performance in terms of forecast, but no definitive conclusion is reached as to which value of p should be chosen (see Section 7 therein). For extreme tail L p -medians, which unlike extreme L p -quantiles satisfy an interpolation property, we may suggest a potentially simpler and intuitive way to choose p. Recall the weighted average relationship (3):

m p (α) ≈ λ(p, γ)MS(α) + [1 -λ(p, γ)]CTE(α), with λ(p, γ) = 1 -(1 -γ)/κ(p, γ) 1 -2 γ (1 -γ)
for α close to 1. In practice, given the (estimated) value of γ, and a pre-specified weighting constant λ 0 indicating a compromise between robustness of MS and sensitivity of CTE, one can choose p = p 0 as the unique root of the equation λ(p, γ) = λ 0 with unknown p. Although λ(p, γ)

Extreme tail L p -median estimation does not have a simple closed form, our experience shows that this equation can be solved very quickly and accurately with standard numerical solvers. This results in a tail L p -median m p 0 (α)

satisfying, for α close to 1,

m p 0 (α) ≈ λ 0 MS(α) + (1 -λ 0 )CTE(α).
The interpretation of m p 0 (α) is easier than that of a generic tail L p -median m p (α) due to its explicit and fully-determined connection with the two well-understood quantities MS(α) and CTE(α).

The question of which weighting constant λ 0 should be chosen is itself difficult and depends on the requirements of the situation at hand; our real data application in Section 6 provides an illustration with λ 0 = 1/2, corresponding to a simple average between extreme MS and CTE.

4 Estimation of an extreme tail L p -median

Suppose that we observe a random sample (X 1 , . . . , X n ) of independent copies of X, and denote by X 1,n ≤ • • • ≤ X n,n the corresponding set of order statistics arranged in increasing order. Our goal in this section is to estimate an extreme tail L p -median m p (α n ), where

α n → 1 -as n → ∞.
The final aim is to allow α n to approach 1 at any rate, covering the cases of an intermediate tail

L p -median with n(1 -α n ) → ∞ and of a proper extreme tail L p -median with n(1 -α n ) → c,
where c is some finite positive constant.

Intermediate case: direct estimation by empirical L p -optimisation

Recall that the tail L p -median m p (α n ) is, by Definition 1,

m p (α n ) = arg min m∈R E (|X -m| p -|X| p | X > q(α n )) .
Assume here that n(1 -α n ) → ∞, so that n(1 -α n ) > 0 eventually. We can therefore define a direct empirical tail L p -median estimator of m p (α n ) by minimising the above empirical cost function:

m p (α n ) = arg min m∈R 1 n(1 -α n ) n(1-αn) i=1 (|X n-i+1,n -m| p -|X n-i+1,n | p ) . ( 6
)
We now pave the way for a theoretical study of this estimator. The key point is that since normalising constants and shifts are irrelevant in the definition of the empirical criterion, we clearly have the equivalent definition

m p (α n ) = arg min m∈R 1 p[m p (α n )] p n(1-αn) i=1 (|X n-i+1,n -m| p -|X n-i+1,n -m p (α n )| p ) . Consequently n(1 -α n ) m p (α n ) m p (α n ) -1 = arg min u∈R ψ n (u; p) with ψ n (u; p) = 1 p[m p (α n )] p n(1-αn) i=1 X n-i+1,n -m p (α n ) - um p (α n ) n(1 -α n ) p -|X n-i+1,n -m p (α n )| p . (7)
Note that the empirical criterion ψ n (u; p) is a continuous and convex function of u, so that the asymptotic properties of the minimiser follow directly from those of the criterion itself by the convexity lemmas of [START_REF] Geyer | On the asymptotics of convex stochastic optimization[END_REF] and [START_REF] Knight | Epi-convergence in distribution and stochastic equisemicontinuity[END_REF]. The empirical criterion, then, is analysed by using its continuous differentiability (for p > 1) in order to formulate an L p -analogue of Knight's identity [START_REF] Washington | Canada: financial sector assessment program-insurance core principles-detailed assessment of observance[END_REF] and divide the work between, on the one hand, the study of a n(1 -α n )-consistent and asymptotically Gaussian term which is an affine function of u and, on the other hand, a bias term which converges to a nonrandom multiple of u 2 . Further technical details are provided in the Supplementary Material document, see in particular Lemmas 6, 7, 9

and 11.

This programme of work is broadly similar to that of [START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF] for the convergence of the direct intermediate L p -quantile estimator. The difficulty in this particular case, however, is twofold: first, the affine function of u is a generalised L-statistic (in the sense of for instance [START_REF] Borisov | Probability inequalities for generalized L-statistics[END_REF] whose analysis requires delicate arguments relying on the asymptotic behaviour of the tail quantile process via Theorem 5.1.4 p.161 in de [START_REF] De Haan | Extreme value theory: an introduction[END_REF]. For L p -quantiles, this is not necessary because the affine term is actually a sum of independent, identically distributed and centred variables. Second, the bias term is essentially a doubly integrated oscillation of a power function with generally noninteger exponent. The examination of its convergence requires certain precise real analysis arguments which do not follow from those developed in [START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF] for the asymptotic analysis of intermediate L p -quantiles.

With this in mind, the asymptotic normality result for the direct intermediate tail L p -median estimator m p (α n ) is the following.

Theorem 1. Suppose that p ≥ 1 and C 2 (γ, ρ, A) holds with γ < 1/[2(p -1)]. Assume further that

α n → 1 -is such that n(1 -α n ) → ∞ and n(1 -α n )A((1 -α n ) -1 ) = O(1). Then we have, as n → ∞: n(1 -α n ) m p (α n ) m p (α n ) -1 d -→ N (0, V (p, γ)) .
Here

V (p, γ) = V 1 (p, γ)/V 2 (p, γ) with V 1 (p, γ) = [κ(p, γ)] 1/γ γ B(2p -1, γ -1 -2(p -1)) + g 2p-1,γ (κ(p, γ)) + [1 -κ(p, γ)] 2(p-1)
while V 2 (p, γ) is defined by: V 2 (1, γ) = 1/γ 2 and, for p > 1,

V 2 (p, γ) = p -1 γ [κ(p, γ)] 1/γ B(p -1, γ -1 -p + 2) + g p-1,γ (κ(p, γ)) 2 .
Moreover, the functions V 2 (•, γ) and V (•, γ) defined this way are right-continuous at 1.

The asymptotic variance V (p, γ) has a rather involved expression. ical study, which is not reported here, actually shows that we have V (p, γ) < V (1, γ) for any (p, γ) ∈ (1, 1.2] × [0.25, 0.5]. This suggests that for all heavy-tailed distributions having only a second moment (an already difficult case as far as estimation in heavy-tailed models is concerned), a direct L p -tail median estimator with p ∈ (1, 1.2] will have a smaller asymptotic variance than the empirical L 1 -tail median estimator, or, in other words, the empirical Median Shortfall.

We conclude this section by noting that, like the constants appearing in our previous asymptotic results, the variance term V (p, γ) has a simple expression when p = 1 or p = 2. In the case p = 1, we have V (1, γ) = 2γ 2 by Lemma 2(iv) in the Supplementary Material document. Statement (2) suggests that this should be identical to the asymptotic variance of the high quantile estimator MS(α n ) = X n-n(1-αn)/2 ,n , and indeed

n(1 -α n ) MS(α n ) MS(α n ) -1 = √ 2 n(1 -α n ) 2 X n-n(1-αn)/2 ,n q(1 -(1 -α n )/2) -1 d -→ N 0, 2γ 2
by Theorem 2.4.8 p.52 in de [START_REF] De Haan | Extreme value theory: an introduction[END_REF]. For p = 2, we have V (2, γ) = 2γ 2 (1 -γ)/(1 -2γ) by Lemma 3(iv) in the Supplementary Material document. By (2), we should expect this constant to coincide with the asymptotic variance of the empirical counterpart of the Conditional Tail Expectation, namely

CTE(α n ) = 1 n(1 -α n ) n(1-αn) i=1 X n-i+1,n .
This is indeed the case as Corollary 1 in El [START_REF] El Methni | Nonparametric estimation of extreme risks from conditional heavy-tailed distributions[END_REF] shows; see also Theorem 2 in El Methni et al. (2018). In particular, the function γ → V (2, γ) tends to infinity as γ ↑ 1/2, reflecting the increasing difficulty of estimating a high Conditional Tail Expectation by its direct empirical counterpart as the right tail of X gets heavier.

Intermediate case: indirect quantile-based estimation

We can also design an estimator of m p (α n ) based on the asymptotic equivalence between m p (α n ) and q(α n ) that is provided by Proposition 2. Indeed, since this result suggests that m p (α)/q(α) ∼ 1/κ(p, γ) when α → 1 -(with ∼ denoting asymptotic equivalence throughout), it makes sense to build a plug-in estimator of m p (α n ) by setting m p (α n ) = q(α n )/κ(p, γ n ), where q(α n ) and γ n are respectively two consistent estimators of the high quantile q(α n ) and of the tail index γ. Since we work here in the intermediate case n(1 -α n ) → ∞, we know that the sample counterpart X nαn ,n of q(α n ) is a relatively consistent estimator of q(α n ), see Theorem 2.4.1 in de [START_REF] De Haan | Extreme value theory: an introduction[END_REF]. This suggests to use the estimator

m p (α n ) := X nαn ,n κ(p, γ n ) . (8)
Our next result analyses the asymptotic distribution of this estimator, assuming that the pair

( γ n , X nαn ,n ) is jointly n(1 -α n )-consistent.
Theorem 2. Suppose that p ≥ 1 and C 2 (γ, ρ, A) holds with γ < 1/(p -1). Assume further that

α n → 1 -is such that n(1 -α n ) → ∞ and n(1 -α n )A((1 -α n ) -1 ) → λ ∈ R, and that n(1 -α n ) γ n -γ, X nαn ,n q(α n ) -1 d -→ (ξ 1 , ξ 2 )
where (ξ 1 , ξ 2 ) is a pair of nondegenerate random variables. Then we have, as n → ∞:

n(1 -α n ) m p (α n ) m p (α n ) -1 d -→ σ(p, γ)ξ 1 + ξ 2 -λR(p, γ, ρ),
with the positive constant σ(p, γ) being σ(p, γ) = -1 κ(p, γ) ∂κ ∂γ (p, γ). In other words,

σ(p, γ) = B(p, γ -1 -p + 1)[Ψ(γ -1 + 1) -Ψ(γ -1 -p + 1)] - 1 κ(p,γ) (1 -u) p-1 u -1/γ-1 log(u) du γ 2 [1 -κ(p, γ)] p-1 [κ(p, γ)] -1/γ
where Ψ(x) = Γ (x)/Γ(x) is Euler's digamma function.

Again, the constant σ(p, γ) does not generally have a simple explicit form, but we can compute it when p = 1 or p = 2. Lemma 2(v) shows that σ(1, γ) = log 2, while Lemma 3(v) entails σ(2, γ) = 1/(1-γ) (see the Supplementary Material document). Contrary to our previous analyses, it is more difficult to relate these constants to pre-existing results in high quantile or high CTE estimation because Theorem 2 is a general result that applies to a wide range of estimators γ n .

To the best of our knowledge, there is no general analogue of this result in the literature for the case p = 1. In the case p = 2, we find back the asymptotic distribution result in Theorem 1 of El [START_REF] El Methni | Extreme versions of Wang risk measures and their estimation for heavy-tailed distributions[END_REF]:

n(1 -α n ) m 2 (α n ) CTE(α n ) -1 d -→ 1 1 -γ ξ 1 + ξ 2 - λ 1 -γ -ρ .
It should be highlighted that, for p = 2, Theorem 2 in the present paper is a stronger result than Theorem 1 of El [START_REF] El Methni | Extreme versions of Wang risk measures and their estimation for heavy-tailed distributions[END_REF], since the condition on γ is less stringent than that of Theorem 1 therein. As the above convergence is valid for any γ < 1, one may therefore think that the estimator m 2 (α n ) is a widely applicable estimator of the CTE at high levels. Since it is also more robust than the direct empirical CTE estimator due to its reliance on the sample quantile X nαn ,n , this would defeat the point of looking for a middle ground solution between the sensitivity of CTE to high values and the robustness of VaR-type measures in very heavy-tailed models. The simulation study in El [START_REF] El Methni | Extreme versions of Wang risk measures and their estimation for heavy-tailed distributions[END_REF] shows however that in general, the estimator m 2 fares worse than the direct CTE estimator m 2 , and increasingly so as γ increases within the range (0, 1/4]. We will also confirm this in our simulation study by considering several cases with higher values of γ and showing that the estimator m 2 should in general not be preferred to m 2 . The benefit of using the indirect estimator m p will rather be found for values of p away from 2, when a genuine compromise between sensitivity and robustness is sought.

Theorem 2 applies whenever γ n is a consistent estimator of γ that satisfies a joint convergence condition together with the intermediate order statistic X nαn ,n . This is not a restrictive requirement.

For instance, if γ n = γ H n is the widely used Hill estimator [START_REF] Hill | A simple general approach to inference about the tail of a distribution[END_REF]:

γ H n := 1 n(1 -α n ) n(1-αn) i=1 log (X n-i+1,n ) -log X n-n(1-αn) ,n , (9)
then, under the bias condition n(1

-α n )A((1 -α n ) -1 ) → λ, we have the joint convergence n(1 -α n ) γ H n -γ, X nαn ,n q(α n ) -1 d -→ γN 1 + λ 1 -ρ , γN 2
where (N 1 , N 2 ) is a pair of independent standard Gaussian random variables (for a proof, combine Theorem 2.4.1, Lemma 3.2.3 and Theorem 3.2.5 in de [START_REF] De Haan | Extreme value theory: an introduction[END_REF]. As a corollary of Theorem 2, we then get the following asymptotic result on m p (α n ) when the estimator γ n is the Hill estimator γ H n .

Corollary 1. Suppose that p ≥ 1 and C 2 (γ, ρ, A) holds with γ < 1/(p -1). Assume further that It can be seen from these figures that the indirect estimator has a lower variance than the direct one. The difference between the two variances becomes sizeable when the quantity 2γ(p -1) gets closer to 1, as should be expected since the asymptotic variance of the direct estimator asymptotically increases to infinity (see Theorem 1), while the asymptotic variance of the indirect estimator is kept under control (see Corollary 1). This seems to indicate that the indirect estimator should be preferred to the direct estimator in terms of variability. However, the indirect estimator is asymptotically biased (due to the use of the approximation m p (α)/q(α) ∼ 1/κ(p, γ) in its construction), while the direct estimator is not. We will see that this can make one prefer the direct estimator in terms of mean squared error on finite samples, even for large values of γ and p.

α n → 1 -is such that n(1 -α n ) → ∞ and n(1 -α n )A((1 -α n ) -1 ) → λ ∈ R. Then, as n → ∞: n(1 -α n ) m p (α n ) m p (α n ) -1 d -→ N λ σ(p, γ) 1 -ρ -R(p, γ, ρ) , v(p, γ) , where v(p, γ) = γ 2 ([σ(p, γ)] 2 + 1).
We conclude this section by mentioning that similar joint convergence results on the pair ( γ n , X nαn ,n ), and therefore analogues of Corollary 1, can be found for a wide range of other estimators of γ.

We mention for instance the maximum likelihood estimator in an approximate Generalised Pareto model for exceedances and probability-weighted moment estimators; we refer to e.g. Sections 3 and 4 of de [START_REF] De Haan | Extreme value theory: an introduction[END_REF] for an asymptotic analysis of these alternatives. This can be used to construct several other indirect tail L p -median estimators.

Extreme case: an extrapolation device

Both the direct and indirect estimators constructed so far are only consistent for intermediate

sequences α n such that n(1 -α n ) → ∞.
Our purpose is now to extrapolate these intermediate tail L p -median estimators to proper extreme levels

β n → 1 -with n(1 -β n ) → c < ∞ as n → ∞.
The extrapolation argument is based on the fact that under the regular variation condition C 1 (γ),

the function t → U (t) = q(1 -t -1
) is regularly varying with index γ. In particular, we have:

q(β n ) q(α n ) = U ((1 -β n ) -1 ) U ((1 -α n ) -1 ) ≈ 1 -β n 1 -α n -γ when α n , β n → 1 -.
This approximation is at the heart of the construction of the classical Weissman extreme quantile estimator q W (β n ), introduced in Weissman (1978):

q W (β n ) := 1 -β n 1 -α n -γn X nαn ,n .
The key point is then that, when γ < 1/(p -1), the quantity m p (α) is asymptotically proportional to q(α), by Proposition 2. Combining this with the above approximation on ratios of high quantiles suggests the following extrapolation formula:

m p (β n ) ≈ 1 -β n 1 -α n -γ m p (α n ).
An estimator of the extreme tail L p -median m p (β n ) is obtained from this approximation by plugging in a consistent estimator γ n of γ and a consistent estimator of m p (α n ). In our context, the latter can be the direct, empirical L p -estimator m p (α n ), or the indirect, intermediate quantilebased estimator m p (α n ), yielding the extrapolated estimators

m W p (β n ) := 1 -β n 1 -α n -γn m p (α n ) and m W p (β n ) := 1 -β n 1 -α n -γn m p (α n ).
We note, moreover, that the latter estimator is precisely the estimator deduced by plugging the Weissman extreme quantile estimator q W (β n ) in the asymptotic proportionality relationship

m p (β n )/q(β n ) ∼ 1/κ(p, γ), since m W p (β n ) = 1 -β n 1 -α n -γn × X nαn ,n κ(p, γ n ) = q W (β n ) κ(p, γ n ) .
The asymptotic behaviour of the two extrapolated estimators m W p (β n ) or m W p (β n ) is analysed in our next main result.

Theorem 3. Suppose that p ≥ 1 and C 2 (γ, ρ, A) holds with ρ < 0. Assume also that α

n , β n → 1 - are such that n(1-α n ) → ∞ and n(1-β n ) → c < ∞, with n(1 -α n )/ log([1-α n ]/[1-β n ]) → ∞. Assume finally that n(1 -α n )( γ n -γ) d -→ ξ, where ξ is a nondegenerate limiting random variable. (i) If γ < 1/[2(p -1)] and n(1 -α n )A((1 -α n ) -1 ) = O(1) then, as n → ∞: n(1 -α n ) log[(1 -α n )/(1 -β n )] m W p (β n ) m p (β n ) -1 d -→ ξ. (ii) If γ < 1/(p -1) and n(1 -α n )A((1 -α n ) -1 ) → λ ∈ R then, as n → ∞: n(1 -α n ) log[(1 -α n )/(1 -β n )] m W p (β n ) m p (β n ) -1 d -→ ξ.
This result shows that both of the estimators m W p (β n ) and m W p (β n ) have their asymptotic properties governed by those of the tail index estimator γ n . This is not an unusual phenomenon for extrapolated estimators: actually, the very fact that these two estimators are built on an intermediate tail L p -median estimator and a tail index estimator γ n sharing the same rate of convergence guarantees that the asymptotic behaviour of γ n will dominate. A brief, theoretical justification for this is that while the intermediate tail L p -median estimator is n(1 -α n )-relatively consistent, the (estimated) extrapolation factor ([1 -β n ]/[1 -α n ]) -γn , whose asymptotic behaviour only depends on that of γ n , converges relatively to ([1 -

β n ]/[1 -α n ]) -γ with the slower rate of convergence n(1 -α n )/ log[(1 -α n )/(1 -β n )]
. This is explained in detail in the proof of Theorem 3, and we also refer to Theorem 4.3.8 of de [START_REF] De Haan | Extreme value theory: an introduction[END_REF] and its proof for a detailed exposition regarding the Weissman quantile estimator. In particular, if γ n is the Hill estimator (9), then the common asymptotic distribution of our extrapolated estimators will be Gaussian with [START_REF] De Haan | Extreme value theory: an introduction[END_REF].

mean λ/(1 -ρ) and variance γ 2 , provided n(1 -α n )A((1 -α n ) -1 ) → λ ∈ R, see Theorem 3.2.5 in de
Let us highlight though that while the asymptotic behaviour of γ n is crucial, we should anticipate that in finite-sample situations, an accurate estimation of the intermediate tail L p -median m p (α n ) is also important. A mathematical reason for this is that in the typical situation when 1 -β n = 1/n (considered recently by for instance [START_REF] Cai | Estimation of the marginal expected shortfall: the mean when a related variable is extreme[END_REF][START_REF] Gong | Estimation of extreme quantiles for functions of dependent random variables[END_REF], the logarithmic term log[(1 -α n )/(1 -β n )] has order at most log(n), and thus for a moderately high sample size n, the quantity n(1

-α n )/ log[(1 -α n )/(1 -β n )]
representing the rate of convergence of the extrapolation factor may only be slightly lower than the quantity n(1 -α n ) representing the rate of convergence of the estimator at the intermediate step. Hence the idea that, while for n very large the difference in finite-sample behaviour between any two estimators of the tail L p -median at the basic intermediate level α n will be eventually wiped out by the performance of the estimator γ n , there may still be a significant impact of the quality of the intermediate tail L p -median estimator used on the overall accuracy of the extrapolated estimator when n is moderately large. This is illustrated in the simulation study below.

Simulation study

Our goal in the present section is to assess the finite-sample performance of our direct and indirect estimators of an extreme tail L p -median, for p ∈ [1, 2]. In addition, we shall do so in a way that provides guidance as to how an extreme tail L p -median, and its estimates, can be used and interpreted in practical setups. Let us recall that our focus is not to consider cases with low γ, as in such cases the easily interpretable CTE risk measure can be used and estimated with good accuracy, including at extreme levels. We shall rather consider cases with γ > 1/4, where the fact that the tail extreme tail L p -median realises a compromise between the robust MS and the sensitive CTE should be expected to result in estimators with an improved finite-sample performance compared to that of the classical empirical CTE estimator. It was actually highlighted in (3) and (4) that, for p ∈ [1, 2] and γ < 1/(p -1), an extreme tail L p -median m p (α) can be understood asymptotically as a weighted average of MS(α) and CTE(α). In other words, defining the interpolating risk measure

R λ (α) := λMS(α) + (1 -λ)CTE(α),
we have m p (α) ≈ R λ (α) as α → 1 -with λ = λ(p, γ) as in (4). It then turns out that at the population level, we have two distinct (but asymptotically equivalent) possibilities to interpolate, and thus create a compromise, between extreme Median Shortfall and extreme Conditional Tail Expectation:

• Consider the family of measures m p (α), p ∈ [1, 2];

For each of these two distributions, we examine the cases γ ∈ {1/4, 1/2, 3/4}, corresponding to, respectively, a borderline case for finite fourth moment, a borderline case for finite variance, and a case where there is no finite variance. The accuracy of each of the three estimators m p (α n ), m p (α n ) and R λ(p,γ) (α n ) is measured by their respective empirical Mean Log-Squared Error (MLSE) on the N simulated samples. This is defined by

MLSE( m p (α n )) = 1 N N j=1 log 2 m (j) p (α n ) m p (α n )
where m (j)

p (α n ) is the estimate of m p (α n ) calculated on the jth sample, and similarly for m p (α n ) and R λ(p,γ) (α n ) (in the latter case, we replace m p (α n ) by R λ(p,γ) (α n )). The rationale for reporting MLSEs instead of the straightforward Relative Mean-Squared Errors is that, in the case γ ≥ 1/2, the direct CTE estimator m 2 (α n ) occasionally produces a very large error, due to its variance being infinite (a similar point is made in Section 4.2 of El [START_REF] El Methni | Improved estimators of extreme Wang distortion risk measures for very heavy-tailed distributions[END_REF]. Computing a logarithmic error therefore helps to assess the relative performance of all the considered estimators across our cases. MLSEs of our estimators are then represented, as functions of p ∈ [1, 2], in the top panels of Figures 123.

It can be seen from these graphs that, on the Burr distribution, the indirect estimator m p (α n ) has a lower MLSE than the direct estimator, except for γ close to 1 and p close to 2. This instability is very likely due to the fact that, for p close to 2, we have 1/κ(p, γ) ≈ 1/(1 -γ), and thus if γ is also close to 1, the quantity 1/κ(p, γ H n ( n(1 -α n ) )) appearing in the estimator m p (α n ) will be a highly unstable estimator of 1/κ(p, γ). By contrast, the direct estimator is generally more accurate than the indirect one when the underlying distribution is a Student distribution, especially for p ≥ 1.6. Furthermore, it should be noted that the direct estimator m p (α n ) performs overall noticeably better than the estimator R λ(p,γ) (α n ). This confirms our theoretical expectation that estimation of m p (α n ) should be easier than estimation of R λ(p,γ) (α n ), since m p (α n ) is relatively n(1 -τ n )-consistent as soon as γ < 1/[2(p-1)], which is a weaker condition than the assumption γ < 1/2 needed to ensure the relative n(1 -τ n )-consistency of R λ(p,γ) (α n ) (due to its reliance on the estimator CTE(α n )). In other words, on finite samples and at intermediate levels, it is preferable to interpolate between extreme MS and extreme CTE via tail L p -medians rather than using direct linear interpolation, even though these two ideas are asymptotically equivalent at the population level.

Extreme case

We now focus on the estimation of m p (β n ) and R λ (β n ) for a proper extreme level ). The estimators we consider are, for the estimation of the extreme tail L p -median m p (β n ), the two extrapolated estimators defined in Section 4.3: first, the extrapolated direct estimator, given by

β n → 1 -, such that n(1 -β n ) → c ∈ [0, ∞
m W p (β n , k) := m W p (β n ) = n(1 -β n ) k -γ H n (k) m p (1 -k/n),
where k ∈ {1, . . . , n -1}, and, second, the extrapolated indirect estimator

m W p (β n , k) := m W p (β n ) = n(1 -β n ) k -γ H n (k) m p (1 -k/n).
Recall that here, γ H n (k) denotes the Hill estimator introduced in (9). These two estimators are compared to the following extrapolated version of the estimator R λ :

R W λ (β n , k) := n(1 -β n ) k -γ H n (k) λX n-k/2 ,n + (1 -λ) CTE(1 -k/n) .
We take again λ = λ(p, γ) so that the estimators m W p (β n , k), m W p (β n , k) and R W λ (β n , k) can be compared on the range p ∈ [1,2]. In what follows, we also take β n = 1-1/n in all three estimators. These estimators depend on a tuning parameter k, which we take as

kopt := 1 J J j=1 arg min k∈{4,..., n/4 } 1-k/(4n) 1-k/n log 2 m W p j (α, k) m p j (α) dα ,
where J ∈ N \ {0} and 1 = p 1 < • • • < p J = 2. The idea behind this criterion is that for an intermediate order α, the empirical and extrapolated estimators should both be able to estimate accurately m p (α), across the range p ∈ [1, 2], and therefore the distance between these two estimators should be small at intermediate levels provided the parameter k is chosen properly. A related selection rule is used by [START_REF] Gardes | Estimating extreme quantiles under random truncation[END_REF] for extreme quantile estimation. We take here The reverse conclusion holds true on the Student distribution. The extrapolated direct estimator m W p (β n , kopt ) also performs generally better than the extrapolated linear interpolation estimator R W λ(p,γ) (β n , kopt ). There is a noticeable improvement for p ∈ [1.25, 1.75] in the case γ = 1/2 and even more so for γ = 3/4, which are the most relevant cases for our purpose. The accuracy of m W p (β n , kopt ) is also comparable overall to that of R W λ(p,γ) (β n , kopt ) for γ = 1/4, although this is not the case we originally constructed the tail L p -median for.

As a conclusion, this simulation study indicates that, whether at intermediate or proper extreme levels, our tail L p -median estimators provide a way of interpolating between extreme MS and extreme CTE that is more accurate in practice than a simple linear interpolation. This appears to be true on a wide range of values of γ, allowing for a flexible use of the class of tail L p -medians in practice, although the improvement is clearer for γ ≥ 1/2, where it is known that CTE estimation is a difficult problem. Finally, the fact that the extrapolated direct estimator performs better than its indirect competitor for certain distributions, and for high γ generally, is evidence that an extreme tail L p -median actually contains more information than a simple combination of a quantile with the tail index γ. This was also observed by by El Methni & Stupfler (2017), [START_REF] Daouia | Estimation of tail risk based on extreme expectiles[END_REF][START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF] in the context of, respectively, the estimation of extreme Wang distortion risk measures, expectiles and L p -quantiles.

Real data analysis

The data set we consider is made of n = 1098 commercial fire losses recorded between 1st January 1995 and 31st December 1996 by the FFSA (an acronym for the Fédération Française des Sociétés d'Assurance). This data set is available from the R package CASdatasets as data(frecomfire).

The data is converted into euros from French francs, and denoted by (X 1 , . . . , X n ). Insurance and financial companies have a strong interest in the analysis of this type of data set. For example, extremely high losses have to be taken into account in order to estimate, at company level, the capital requirements that have to be put in place so as to survive the upcoming calendar year with a probability not less than 0.995, as part of compliance with the Solvency II directive. At the same time, it is in the interest of companies to carry out a balanced assessment of risk: an underestimation of risk could threaten the company's survival, but an overestimation may lead the insurer to ask for higher premiums and deductibles, reducing the attractiveness of its products to the consumer, thus negatively affecting the company's competitiveness on the market. A single quantile, as in the above Solvency II compliance example, cannot account for a detailed picture of risk, which is why we investigate here the use of the alternative class of tail L p -medians.

Our first step in the analysis of the extreme losses in this data set is to estimate the tail index γ.

To this end, the procedure of choice of kopt outlined in Section 5.2 is used: the value of k returned by this procedure is kopt = 64, and the corresponding estimate of γ provided by the Hill estimator is γ H = 0.67. This estimated value of γ is in line with the findings of El Methni & Stupfler (2018), and it suggests that there is evidence for an infinite second moment of the underlying distribution.

We know, in this context, that the estimation of the extreme CTE is going to be a difficult problem, although it would give a better understanding of risk in this data set than a single quantile such as the VaR or MS would do. It therefore makes sense, on this data set, to use the class of tail L p -medians to find a middle ground between MS and CTE estimation by interpolation.

Estimates of the tail L p -median m p (1 -1/n), obtained through our extrapolated direct and extrapolated indirect estimators, are depicted on Figure 4. These estimates are fairly close overall on the range p ∈ [1, 2]. There is a difference for p close to 2, where the increased theoretical sensitivity of the direct estimator to the highest values in the sample makes it exceed the more robust indirect estimator; note that here γ is estimated to be 0.67, which is sufficiently far from 1 to ensure that the instability of the indirect estimator for very high γ is not an issue, and the estimate returned by the indirect extrapolated method can be considered to be a reasonable one.

To get a further idea of the proximity between the two estimators, we calculate asymptotic confidence intervals, on the basis of the convergence

σ -1 n γ m p (1 -1/n) m W p (1 -1/n) -1 d -→ N (0, 1), where σ n = log[n(1 -α n )] n(1 -α n ) .
This results from a straightforward combination of Theorem 3 and the delta-method, recalling that γ is estimated by the Hill estimator γ H which is asymptotically Gaussian with variance γ 2 .

Letting u ξ be the ξ-quantile of the standard Gaussian distribution, and

α n = 1 -kopt /n, a (1 -ξ)-asymptotic confidence interval for m p (1 -1/n) is then m W p (1 -1/n, kopt ) 1 + γ H σu ξ/2 , m W p (1 -1/n, kopt ) 1 + γ H σu 1-ξ/2 , with σ = log kopt kopt .
An analogue confidence interval is available using m W p (1 -1/n, kopt ) rather than m W p (1 -1/n, kopt ). On Figure 5, we report asymptotic 90% confidence intervals, corresponding to ξ = 0.1, constructed

  et al. (2018) for a result on extreme expectiles and Daouia et al. (2019) on the general class of L p -quantiles, as well as to Zhu & Li (2012), Yang (2015), El Methni & Stupfler (2017) for a similar

  instead. Results of such numerical computations on the domain (p, γ) ∈ [1, 2] × (0, 1) are included in Figure C.1 in the Supplementary Material document. One can observe from this Figure that

  in[START_REF] Daouia | Extreme M-quantiles as risk measures: From L 1 to L p optimization[END_REF]: this Figure suggests that high L p -quantiles define, for γ close to 1/2, a decreasing function of p when it is close to 1 and an increasing function of p when it is close to 2.

  Figures C.2 and C.3 in the Supplementary Material document provide graphical representations of this variance term. It can be seen on Figure C.2 that the function γ → V (p, γ) appears to be increasing. This reflects the increasing tendency of the underlying distribution to generate extremely high observations when the tail index increases (El Methni & Stupfler, 2018, Section 3.1), thus increasing the variability of the empirical criterion ψ n (•; p) and consequently that of its minimiser. It is not, however, clear from this figure that the function p → V (p, γ) is monotonic, like the proportionality constant κ was. It turns out that, somewhat surprisingly, the function p → V (p, γ) is not in general a monotonic function of p, and an illustration is provided for γ = 0.3 in Figure C.3. A numer-

  The asymptotic variance v(p, γ) is plotted, for several values of p, on Figure C.4 in the Supplementary Material document, and a comparison of the asymptotic variance V (p, γ) of the direct estimator with v(p, γ) is depicted on Figure C.5 of the Supplementary Material document, for γ ∈ [1/4, 1/2].

J = 4

 4 and p j = (j + 2)/3. Simulation settings (sample size, distributions, ...) are the same as those of the intermediate case; empirical MLSEs of the estimators m W p (β n , kopt ), m W p (β n , kopt ) and R W λ(p,γ) (β n , kopt ) are represented, as functions of p ∈ [1, 2], in the bottom panels of Figures 1-3. These graphs show that the conclusions reached in the intermediate case remain true in the extreme case β n = 1-1/n: on the Burr distribution, the extrapolated indirect estimator of m p (β n ) performs comparably or better than the extrapolated direct estimator, except for γ close to 1 and p close to 2.

Figure 1 :

 1 Figure 1: Simulation study, case γ = 1/4. Top panels: empirical MLSE of the estimator R λ(p,γ) (α n ) estimator (full line) and of the two tail L p -median estimators m p (α n ) (dashed line) and m p (α n ) (dotted line). Bottom panels: empirical MLSE of the extrapolated estimator R W λ(p,γ) (β n , kopt ) (full line) and of the two extrapolated tail L p -median estimators m W p (β n , kopt ) (dashed line) and m W p (β n , kopt ) (dotted line). Left: Burr distribution, right: Student distribution.

Figure 2 :

 2 Figure 2: Simulation study, case γ = 1/2. Top panels: empirical MLSE of the estimator R λ(p,γ) (α n ) estimator (full line) and of the two tail L p -median estimators m p (α n ) (dashed line) and m p (α n ) (dotted line). Bottom panels: empirical MLSE of the extrapolated estimator R W λ(p,γ) (β n , kopt ) (full line) and of the two extrapolated tail L p -median estimators m W p (β n , kopt ) (dashed line) and m W p (β n , kopt ) (dotted line). Left: Burr distribution, right: Student distribution.

Figure 3 :

 3 Figure 3: Simulation study, case γ = 3/4. Top panels: empirical MLSE of the estimator R λ(p,γ) (α n ) estimator (full line) and of the two tail L p -median estimators m p (α n ) (dashed line) and m p (α n ) (dotted line). Bottom panels: empirical MLSE of the extrapolated estimator R W λ(p,γ) (β n , kopt ) (full line) and of the two extrapolated tail L p -median estimators m W p (β n , kopt ) (dashed line) and m W p (β n , kopt ) (dotted line). Left: Burr distribution, right: Student distribution.

Figure 4 :

 4 Figure 4: Real fire insurance data set. Extrapolated tail L p -median estimators m W p (1 -1/n, kopt ) (dashed line) and m W p (1 -1/n, kopt ) (dotted line) as functions of p ∈ [1, 2].

Figure 5 :

 5 Figure 5: Real fire insurance data set. Extrapolated tail L p -median estimators m W p (1 -1/n, kopt ) (left panel) and m W p (1 -1/n, kopt ) (right panel) as functions of p ∈ [1, 2]. The lower and upper bounds of the asymptotic confidence intervals at the 90% level are represented by the dashed lines.

  tail of X by a purely Pareto tail will be. Further interpretation of this assumption can be found in[START_REF] Beirlant | Statistics of extremes: theory and applications[END_REF] and de[START_REF] De Haan | Extreme value theory: an introduction[END_REF] along with numerous examples of commonly used continuous distributions satisfying it. Let us finally mention that it is a consequence of Theorem 2.3.9 in de[START_REF] De Haan | Extreme value theory: an introduction[END_REF] that C 2 (γ, ρ, A) is actually equivalent to the following, perhaps more usual extremal assumption on the tail quantile function U :

This standard condition on F controls the rate of convergence in C 1 (γ): the larger |ρ| is, the faster the function |A| converges to 0 (since |A| is regularly varying with index ρ, in virtue of Theorems 2.3.3 and 2.3.9 in de

[START_REF] De Haan | Extreme value theory: an introduction[END_REF]

and the smaller the error in the approximation of the right

Acknowledgements

The authors acknowledge an anonymous Associate Editor and two anonymous reviewers for their helpful comments that led to an improved version of this paper. The second author gratefully acknowledges the support of the Chair Stress Test, Risk Management and Financial Steering, led by the French Ecole Polytechnique and its Foundation and sponsored by BNP Paribas, as well as the support of the French National Research Agency in the framework of the Investissements d'Avenir program (ANR-15-IDEX-02).

University Park Campus, Nottingham NG7 2RD, United Kingdom Email: gilles.stupfler@gmail.com

• Consider the family of measures R λ (α), λ ∈ [0, 1].

In the rest of this section, based on a sample of data (X 1 , . . . , X n ) of size n, we consider the estimation of the tail L p -median m p (α n ) for both intermediate and extreme levels α n , and how this estimation compares with direct estimation of the interpolating measure R λ (α n ).

Intermediate case

We first investigate the estimation of

is concerned, we compare the direct estimator m p (α n ) defined in ( 6) and the indirect estimator in (8). In the latter, γ n is taken as the Hill estimator defined in (9): in other words,

To further compare the performance of these two estimators, and therefore the practical applicability of the measure m p (α n ) for interpolating between extreme MS and extreme CTE, the finite sample behaviour of these estimators are compared to that of the estimator of R λ (α n ) given by

In order to be able to compare this estimator of R λ (α n ) to our estimators of the tail L p -median

We do so on N = 500 simulated random samples of size n = 500, with α n = 1 -75/n = 0.85. Two distributions satisfying condition C 2 (γ, ρ, A) are considered:

(here γ > 0). This distribution has tail index γ and second-order parameter ρ = -3/2.

• The Student distribution with 1/γ degrees of freedom, where γ > 0. This distribution has tail index γ and second-order parameter ρ = -2γ.

using both estimators. The confidence intervals largely overlap, which was to be expected since the two estimators m W p (β n , kopt ) and m W p (β n , kopt ) were seen to be fairly close on Figure 4. The confidence intervals are also quite wide, which was again to be expected because the effective sample size is the relatively low kopt = 64.

With these estimates at hand comes the question of how to choose p. This is of course a difficult question that depends on the objective of the analysis from the perspective of risk assessment: should the analysis be conservative (i.e. return a higher, more prudent estimation) or not? We do not wish to enter into such a debate here, which would be better held within the financial and actuarial communities. Let us, however, illustrate a simple way to choose p based on our discussion at the very end of Section 3. Recall from ( 3) and ( 4) that a tail L p -median has an asymptotic interpretation as a weighted average of MS and CTE:

We also know from our simulation study that it is generally more accurate to estimate m p (1 -1/n) rather than the corresponding linear combination of MS(1-1/n) and CTE(1-1/n). With λ 0 = 1/2, representing the simple average between MS(1 -1/n) and CTE(1 -1/n), choosing p = p as the unique root of the equation λ( p, γ) = λ 0 yields p = 1.711. The corresponding estimates, in million euros, of the linear combination

It is interesting to note that, although these quantities estimate the average of MS(1

The estimate m W p (1 -1/n) of the simple average between MS(1 -1/n) and CTE(1 -1/n) obtained through extrapolating the direct tail L p -median estimator is therefore itself a middleway between the indirect estimator m W p (1 -1/n), which relies on the VaR estimator q(1 -1/n), and the direct estimator of this average, which depends on the highly variable estimator CTE(1 -1/n).

Supplementary Material

A Supplementary Material document, available online, contains all necessary proofs as well as additional figures referred to in the present article.


Bertrand Massot
email: bertrand.massot@insa-lyon.fr

Member, IEEE Niels C Rattenborg
email: rattenborg@orn.mpg.de

Anders Hedenström

Susanne Akesson
email: susanne.akesson@biol.lu.se

Paul-Antoine Libourel

Anders Hedenstrom
email: anders.hedenstrom@biol.lu.se

Susanne Åkesson

An Implantable, Low-Power Instrumentation for the Long Term Monitoring of the Sleep of Animals under Natural Conditions

ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

I. INTRODUCTION

Classically, sleep is studied on laboratory animal models such as rats, mice, zebrafish, etc. Optogenetics, immunohistochemistry, behavioral tests, neuronal activity recordings, temperature measurements, electrophysiological studies (EEG, EMG, ECG, EOG) are various methods used to assess different aspects of sleep. However, most of these techniques involve restraining the animal which can induce stress and/or modify the natural sleep behaviour which would occur in a natural environment [START_REF] Tang | Effect of varying recording cable weight and flexibility on activity and sleep in mice[END_REF]. These restraints include, for example:

• The use of tethered devices; • A reduction in the animal's freedom of movement;

• The preclusion of using sleeping shelters. Portable, non-obtrusive solutions are therefore sought to enable the recording of signals under more natural conditions in order to reduce stress and preserve natural sleep patterns. Unfortunately, only a very few systems exist commercially for the recording of electrophysiological signals outside the 69008 Lyon, France. libourel@sommeil.univ-lyon1.fr laboratory. A method currently adopted by researchers in this area consists in the development and use of miniature loggers comprising an analog frontend for signal amplification and conditioning, analog-to-digital converters and an embedded storage media; the whole system being powered by a battery. The challenge is to produce an ultra-low power instrument which is as small as possible to be attached to the electrodes implanted in the animal. While several radiofrequency devices have been developed over the past 20 years (for example [START_REF] Lapray | A novel miniature telemetric system for recording eeg activity in freely moving rats[END_REF]- [START_REF] Zayachkivsky | Recording eeg in immature rats with a novel miniature telemetry system[END_REF]), only one logger appears to be well suited for the recording of EEG and EMG activity under natural conditions [START_REF] Vyssotski | Miniature neurologgers for flying pigeons: multichannel eeg and action and field potentials in combination with gps recording[END_REF]. However, this system may not achieve the autonomy necessary to record multiple sleep/wake cycles, due to battery lifetimes of less than 2 days. In a previous work [START_REF] Massot | Oneiros, a new miniature standalone device for recording sleep electrophysiology, physiology, temperatures and behavior in the lab and field[END_REF], we presented a miniature, portable system for the recording of signals dedicated to the study of sleep patterns with the advantages of:

• Being versatile (both capable of RF communication and data logging); • Being configurable (up to 26 channels for electrophysiology with independent sampling frequency); • Integrating a complete range of tools for behavioral, electrophysiology and metabolic measurements with the addition of an embedded, sleep deprivation system; • Battery lifetimes longer than 48 hours. While having the advantages of a large versatility, in terms of adaption to multiple protocols and experimental settings, this device was still oversized in order to make it implantable. In this paper we present an adaptation of this former system which benefit froms multimodal measurements within a miniaturised electronic device for the logging of data under natural conditions. The system's single, 20 mm x 10 mm electronic board (Fig. 1) hosts a dedicated, 16 channel amplifier and analog-to-digital converter for electrophysiological signals. This frontend is coupled with an ultra-low power microcontroller unit which sequences, collects and transfers data from the electrophysiological frontend, the temperature measurement circuits and the 3-axis accelerometer. These data are stored on an embedded micro-SD flash card specifically chosen for its low energy consumption and its reliability when operated under extreme environments. Moreover, the system integrates a real-time clock, which maintains a calendar up to date in order to program the initial system startup and the periodic intervals of operation, thus extending the battery life even further.

II. SYSTEM DESIGN

A. Electronic architecture of the system

The electronic board of the system includes a RHD2116 integrated analog frontend (Intan Technologies LLC, Los Angeles, California). This frontend comprises 16 differential amplifiers with programmable bandpass filters and a 16-bit, 1 Msps, analog-to-digital converter. These 16 channels are dedicated to electrophysiological measurements (EEG, ECG, EOG, EMG) and the electrodes are connected directly on the input of each channel. The gain of each channel is fixed at 192 V/V, hence the resolution is 0.195 µV over the range ±6.4 mV. The frontend also contains three additional, nonamplified channels that are used for the sampling of temperature measurements. The conditioning circuits for temperature were conveniently based on polarisation resistors normally used for NTC thermistors in order to reduce the size and consumption of the circuit (Fig. 2). The ambient temperature is measured by a NTCG104ED104DT1X 100 kΩ chip NTC thermistor (TDK Corporation, Tokyo, Japan), which is placed directly on the electronic board. This thermistor is polarised with a 510 kΩ parallel resistor R 2 and a 120 kΩ series resistor R 1 to provide a linear output with an error less than 0.2 °C over the range 5 -35 °C and less than 1 °C over the range 0 -40 °C. Implantable micro-NTC thermistors, e.g. the 223F3122-07U015 (Semitec USA Corporation, Torrance, California), can be used for their very small size (0.3 mm diameter) and encapsulation for in-body temprature measurements. When polarised with a single 10 kΩ series resistor R, the voltage obtained is linear with temperature over the range 25 -45 °C with an error less than 0.05 °C (Fig. 3). A digital accelerometer ADXL362 (Analog Device Incorporation, Norwood, Massachusetts) is used for the measurement of acceleration along 3 orthogonal axes. This accelerometer has the advantage of a very low energy consumption during measurement which is less than 10 µW with an output data rate of 400 Hz. The range of measurement can be selected between ±2 g, ±4 g or ±8 g, with a fixed resolution of 12 bits, leading to a resolution as small as 0.001 g, 0.002 g and 0.004 g, respectively.

Both the integrated analog frontend as well as the digital accelerometer are connected to a microcontroller unit (MCU) through serial peripheral interfaces (SPI) running at 8 Mbps. The MCU used in this system is a MSP430FR5964 (Texas Instruments, Dallas, Texas) which has been chosen because it contains 256 kB of internal ferroelectric random access memory (FRAM) and a real-time clock (RTC). The system benefits from this high memory size (considering this class of MCU) as it enables the allocation of space for a large buffering of data before writing on the flash memory. Indeed, the access and internal management of SD cards generates additional energy consumption which can be reduced by writing multiple sectors consecutively. The RTC is used to run a calendar to program dates and periods of measurements, as explained in the next section. Finally, this MCU has the advantage of low energy consumption (100 µA/MHz in active mode and less than 1 µA with active RTC when operating under 3.3 Volts).

Regarding power consumption, microSD cards can largely vary and particular care must be taken when choosing a specific model for use with the system. Examples of suitable models are industrial microSD cards such as the S-300u series from Swissbit (Swissbit, Bronschhofen, Swiss) for 2 GB models, or the U300 series from Delkin Devices (Delkin Devices, San Diego, California) for 8 GB models. These models have been chosen as they have guaranteed maximum current consumption for read, write and idle operations as reported in Table I.

For additional energy saving when the system is shut down while the RTC of the MCU remains active for future wakeup, a P-channel MOSFET transistor is used as a power switch for peripherals (RHD2116, ADXL362 and SD card). This enables the complete removal of standby currents, which can be particularly high, depending on the SD card model used Functional diagram of the system. A P-channel MOSFET is used as a controlled power switch for peripherals to ensure minimal power consumption during shut down periods.

B. Embedded software

The software embedded in the MCU (firmware) executes the following tasks :

1) Configures the analog frontend and the digital accelerometer; 2) Sets cyclic awake and shut down periods using alarms from the calendar; 3) Collects data from electrophysiological, temperature and accelerometric channels and stores them temporarily in the internal FRAM; 4) Transfers buffers of data from FRAM to SD card. The number of channels for electrophysiological, temperature and accelerometric data, as well as the sampling rate (common for every channel) are defined in the firmware at programming time. A measurement cycle is defined by the duration of a period of measurement (from one minute up to indefinite) and the duration of a shutdown period. Initially, the system enters a low-power mode at boot and monitors periodically for the insertion of a micro SD card in the dedicated slot (Fig. 5). When SD card is inserted, a programmable delay enables postponing the beginning of the measurement cycles. All cycles consist of an "awake" state where signals are recorded, and a "standby" state where the system is shut down to save power. Duration of periods is programmable.

Other parameters such as the current date, the initial date of measurement following the insertion of the SD card, the period of active measurement, the duration of shutdown and the number of cycles are written into the SD card before its insertion into the system. These parameters provide a advantageous flexibility when recording signals from animals under natural conditions and extends the autonomy of the system. Indeed, when recording specific periods of the year, for example for migratory birds, the system can remain in a very low power state to save battery energy by setting a programmed alarm in the real-time calendar to only start the measurements at a specific date. Also, when very long experiments are desired (over a year for example), cyclic measurements (a few hours per day or a few days per month) can also be programmed in order to reduce the system consumption by using cycles of measurement. This enables the use of the system with a smaller battery in order to reduce the overall size, and more importantly, its weight (especially for small animals such as birds). were carried out in the field to confirm the ability of the system to acquire signals on animals under natural conditions. One of these experiments was carried out on adult common swifts (Apus apus) captured at breeding sites in southeastern Sweden, which were recorded over 48 hours while left free-flying in their natural habitat. After the implantation of subcutaneous, flexible, printed electrodes (Fig. 6a), the system was connected to the flexible electrode circuit using a zero-insertion force (ZIF) connector, and finally attached on the back of the animal using a full body harness (Fig. 6b) [START_REF] Åkesson | Migration routes and strategies in a highly aerial migrant, the common swift apus apus, revealed by light-level geolocators[END_REF].

Permission to capture common swifts was given by the landowners involved, the Swedish Environmental Protection Agency and the Swedish Ringing Centre at the Swedish Museum of Natural History (no. 440) to Susanne Åkesson. Ethical permission for field work on logged common swifts in Sweden was given by Malmö-Lunds djurförsöksetiska nämnd (Dnr 5.8.18-06330/2018) to Susanne Åkesson.

Figure 7 illustrates signals that were obtained from common swifts during the experiment. On the left, it can be seen on the accelerometer spectrogram that the bird is flying with continuous wing-beats. Additionally, the decrease in temperature over the 20 minute recording clearly indicates a rising elevation, i.e the bird was climbing. On the right, one can observe alternate flap-gliding flight. The EEG signal thus indicates an animal in an awaked state during this period. This example demonstrates the ability of the system to provide physiological information and combining behavioral and environmental measurements on a freely moving animal under natural conditions.

IV. CONCLUSION

In conclusion, this miniature device dedicated to record physiological, behavioral and environmental signals furnishes opportunities for further experiments which were not possible to undertake before. Future works will concentrate on the reliability of the system especially, when used as an implant regarding the sealing and biocompatibility of the casing. In research concerning sleep studies, the device will provide signals relevant to the analysis of sleep/wake cycles with the advantage of being implantable, thus enabling monitoring of the animal in its natural environment, and, as a consequence, reducing induced stress and favoring more natural sleep patterns.

Fig. 1 .

 1 Fig. 1. Picture of the new miniature logger device

  Conditioning circuit for ambient temperature thermistor and theoretical absolute error associated with the linear model.

Fig. 3 .

 3 Fig. 3. Conditioning circuit for implanted temperature thermistors and theorical absolute error associated with the linear model.

Figure 4

 4 Figure4shows a functional diagram of the entire hardware involved in the system.

Fig. 5 .

 5 Fig.5. Chronogram of successive states of the device. When SD card is inserted, a programmable delay enables postponing the beginning of the measurement cycles. All cycles consist of an "awake" state where signals are recorded, and a "standby" state where the system is shut down to save power. Duration of periods is programmable.

IIIFig. 6 .Fig. 7 .

 67 Fig. 6. (a) Flexible printed electrodes array for subcutaneous EEG and (b) picture of a common swift with the system attached to its back.

TABLE II CURRENT

 II CONSUMPTION OF THE SYSTEM UNDER 3.3 VOLTS.

	SD card series	Sampling rate	Shut down Awake (average)
	S-300u (2 GB)	13 × 128 sps/s		1.12 mA
	U300 (8 GB) S-300u (2 GB)	13 × 128 sps/s 13 × 1024 sps/s	1.7 µA	1.93 mA 2.53 mA
	U300 (8 GB)	13 × 1024 sps/s		5.42 mA

Paul-Antoine Libourel is with the Lyon Neuroscience Research Center, UMR CNRS

5292, UMR INSERM U1028, UCBL, University of Lyon,