Moduli of Continuity in Metric Models and Extension of Liveability Indices

Index spaces serve as valuable metric models for studying properties relevant to various applications, such as social science or economics. These properties are represented by real Lipschitz functions that describe the degree of association with each element within the underlying metric space. After determining the index value within a given sample subset, the classic McShane and Whitney formulas allow a Lipschitz regression procedure to be performed to extend the index values over the entire metric space. To improve the adaptability of the metric model to specific scenarios, this paper introduces the concept of a composition metric, which involves composing a metric with an increasing, positive and subadditive function $\phi$. The results presented here extend well-established results for Lipschitz indices on metric spaces to composition metrics. In addition, we establish the corresponding approximation properties that facilitate the use of this functional structure. To illustrate the power and simplicity of this mathematical framework, we provide a concrete application involving the modelling of livability indices in North American cities.


Introduction
Metric models, constructed from the aggregation of various variables, serve as useful frameworks that enable prospective approaches in fields such as the social sciences.One version of these models is given by so-called index spaces (see [7] and related literature) which consist of a triple (M, d, I), where (M, d) represents a metric space and I denotes an index (essentially a non-negative Lipschitz function satisfying additional regularity properties).Such models prove advantageous in practical contexts, as they allow the extension of significant indices defined within a metric subspace of (M, d) to the entire space, while preserving the Lipschitz constant, as seen in the classical scenario of Lipschitz regression.This methodology is justified when attempting to model special circumstances that do not conform to linear constraints.The usefulness of these results has been demonstrated in recent years by a large number of research papers in various disciplines.For example, concrete applications can be observed in machine learning, where this conceptual framework is employed [1].Analogous concepts are also widely used in other scientific fields [10,3].these elements, which will be the main point of interest.Finally, in section 4 we will explore the practical application of the above findings to algorithms that numerically execute the described extension procedures.We will delve into specific examples where we examine their functionality, paying particular attention to performance differences compared to the original alternative and other potential procedures.

Basic definitions and concepts
We begin this section by recalling results and basic concepts related to Lipschitz maps, having previously established the theoretical framework in which they are found: metric spaces.The work of Deza et al. [4] and Cobzaş et al. [2] has been followed for this part.
If  D, d) is called metric space, and for any subset D 0 ⊆ D with the distance restricted to it, d ↾ D 0 , it is called metric subspace.Furthermore, it is said that D 0 is bounded if there exists M > 0 such that d(x, y) ≤ M for all x, y ∈ D 0 .From now on we will assume that (D, d) denotes a metric space and (D 0 , d ↾ D 0 ) a metric subspace of it.Recall that (D, d) is a compact metric space if, and only if, for every sequence {a n } n ⊆ D there exists {a n k } k a subsequence of {a n } n that converges to some a ∈ D. This property is sometimes called the sequential characterisation of compactness in metric spaces.
The maps we are interested in in this paper are those that satisfy the Lipschitz condition.If (D, d) and (R, r) are metric spaces, a map f : D → R is called Lipschitz if there exists a constant L ∈ R such that r(f (x), f (y)) ≤ Ld(x, y), for all x, y ∈ D.
It is said that L is a Lipschitz constant of f and we say f is L-Lipschitz to emphasize this constant.The infimum of all constants satisfying last inequality is the Lipschitz norm of f , denoted by Lip(f ).This can be written as Suppose f is a real function defined on D, but known only in S ⊂ D. Several classical results concern the extension of f to D while preserving some initial properties of f in S. The main result in this direction is when the property we want to preserve is the Lipschitz condition, and is called the McShane-Whitney theorem [9,14].Because of the useful extension formulae that can be obtained, this result has been the starting point for much research on the subject.remark 2.2.We notice that any extension F of a Lipschitz function f verifies that F M ≤ F ≤ F W .Moreover, for any t ∈ (0, 1), F := tF W + (1 − t)F M is also a Lipschitz extension of f with the same constant.
The explanation and proofs of general results on Lipschitz maps can be found in [2].
2.1.Composition metrics and modulus of continuity.We now focus on the possibility of generalising the Lipschitz condition to include a broader class of functions, satisfying a more relaxed criterion, and thereby preserving the extension theorems.This paper will address this in a positive way by introducing the concept of ϕ-Lipschitz functions.First, we will define the class of functions Φ, which will serve as a form of generalised continuity module [6].However, our main focus will be on metrics that can be formulated as compositions of a pre-existing metric with these functions, rather than on the functions themselves.Our specific interpretation of such a continuity module is outlined below: Definition 2.3.We will say that a function ϕ : R + → R + belongs to Φ if for each x, y ∈ R + it holds that ((i)) ϕ(x + y) ≤ ϕ(x) + ϕ(y) (subadditivity), ((ii)) ϕ(x) < ϕ(y) if x < y (strictly monotonically increasing), ((iii)) ϕ(0) = 0, ((iv)) ϕ is continuous in R + .Let us remark that conditions (ii) and (iii) guarantee that ϕ(x) ≥ 0 for all x ∈ R + , so these functions are well defined.
As we said, such functions are often called modulus of continuity.A modulus of continuity is a non-decreasing function ω : [0, +∞) → [0, +∞) that ω(0) = 0 and are continuous at 0, but depending on the context they may satisfy other conditions.In fact, in [2, Chapter 6, Section 4] continuity modules are related to metrics in a similar way to the one we present here, although restricted to the context of the study of uniform continuity.Now, following the scheme of the definition of the Lipschitz map, we will introduce a function ϕ ∈ Φ of the distance.The definition is as follows.
Definition 2.4.Let (D, d) and (R, r) be metric spaces and let f : D → R be a map.For ϕ ∈ Φ we will say that f is a ϕ-Lipschitz map if there exists K > 0 such that r(f (x), f (y)) ≤ Kϕ(d(x, y)), for all x, y ∈ D.
As in the standard case, the constant K > 0 is a Lipschitz constant of the ϕ−Lipschitz map f .From now on, when we will compose the function ϕ ∈ Φ with the metric d we will write d ϕ .That is, We observe that every L-Lipschitz map is also a ϕ-Lipschitz map for ϕ(x) = x and K = L.In addition, consider the function f : R + → R + , defined as f (x) = √ x.While this function is not Lipschitz, it meets the criteria of being ϕ-Lipschitz for ϕ = f ∈ Φ and K = 1.Thus, this new category of mappings effectively generalises the original set of L-Lipschitz mappings.Moreover, the boundary of the distance between the images of two points given by the Lipschitz condition can be improved by considering it as ϕ-Lipschitz.This case, which as we will see in Section 3 is fundamental in practical matters, is presented for example by the function f (x) = log(x+1).We know that f is 1-Lipschitz and therefore d(f (x), f (y)) ≤ d(x, y), but f is also ϕ-Lipschitz for ϕ = f and K = 1, and therefore d(f (x), f (y)) ≤ log(d(x, y) + 1), which is a better bound because log(d(x, y) + 1) ≤ d(x, y).
In fact, our proposal is to redefine the distance in such a way that the resulting metric space contains new maps that satisfy the proposed condition (in addition to the Lipschitz maps).In this way, by varying ϕ, we have direct control over how to modify the original metric so that the resulting metric is better suited to the problem posed.Next we will see that d ϕ does indeed define a distance.proposition 2.5.Let (D, d) be a metric space and ϕ ∈ Φ.Then d ϕ is a metric.
Proof.Since ϕ is an injective function (because it is strictly monotonic) and ϕ(0) = 0, it is clear that d ϕ (x, y) = 0 if, and only if, d(x, y) = 0.And since d is a metric this happens if, and only if, x = y, and we have just proved the identity of the indiscernibles for d ϕ .From the symmetry of d as metric we directly deduce the symmetry of d ϕ .Taking into account the triangle inequality, the monotonicity and the subadditivity of ϕ we get The reciprocal of this result is usually false.For example, if D = R and we let ϕ ∈ Φ be ϕ(x) = √ x for x ≥ 0, and d(x, y) = |x − y| 2 , we know that d ϕ = |x − y| is a metric on D, but d is not.To see this, it is enough to take x = 0, y = 1 and z = 3 and check that d(x, z) > d(x, y) + d(y, z), and therefore d does not satisfy the triangular inequality.However, there is a kind of reverse implication.From the assumption that for any metric space (D, d), the function d ϕ is a metric, we can deduce some conditions that ϕ must satisfy.For example, it is easy to check that ϕ(0) = 0, and we will see next that ϕ must be subadditive.Let x, y ∈ R + and define a metric space D = {a, b, c} such that d(a, b) = x, d(b, c) = y and d(a, c) = x + y.Such a d is clearly a metric in D. As d ϕ is a metric, by the triangle inequality we obtain ϕ(x + y) = d ϕ (a, c) ≤ d ϕ (a, b) + d ϕ (b, c) = ϕ(x) + ϕ(y), and so ϕ is subadditive.Thus, if a function ϕ : R + → R + satisfies that d ϕ is a metric for all metrics d, then ϕ is subbaditive and ϕ(0) = 0. Nevertheless, it may happen that the conditions of monotonicity and continuity that ϕ muat satisfy are not met.That is, d ϕ can be a metric for all metric space (D, d) without ϕ being strictly monotonically increasing or continuous.For example, consider ϕ defined as ϕ(x) = 0 if x = 0 and ϕ(x) = 1 if x > 0. For each metric space (D, d) we note that If a, b, c are different from each other then x, y, z > 0 since d is a metric, and so ϕ(x) = ϕ(y) = ϕ(z) = 1.From this we conclude that d ϕ satisfy the triangular inequality for a, b, c.In case some of the elements of D that we have taken coincide, the triangular inequality of d ϕ for them is trivial.For a better understanding of how d and d ϕ relate to each other, we present in Figures 1 and 2 a graphical representation of the behavior of two concrete metrics: the euclidean metric d in R and its composition with ϕ(x) = log(1 + x), that is, d ϕ .In the Figure 1 it can be seen that d ϕ "smooths" the distance between two real numbers with respect to d.More specifically, d and d ϕ have a similar behavior for x and y "close" to each other, but for more distant values d ϕ attenuates growth with respect to d. Figure 2 provides a comparison between the behavior of the triangular inequality of d and d ϕ .As before, we can see how the logarithmic growth of ϕ carries over to d ϕ , and also to its triangular inequality.• A map f : R n → R is called α-Hölder continuous if there exist C > 0 and α > 0 such that r(f (x), f (y)) ≤ Cd(x, y) α , for all x, y ∈ D.
These maps are ϕ-Lipschitz maps for K = C. Indeed, if α ∈ (0, 1] then ϕ defined as ϕ(x) = x α belongs to Φ and f is ϕ-Lipschitz for K = C.If α > 1 it can be proven that f is a constant map, so it is ϕ-Lipschitz for any α ≥ 0. • Consider R equipped with its usual metric and let ϕ ∈ Φ.From the subadditivity it follows that ϕ(x Compactness for subsets of the metric spaces (D, d ϕ ) in terms of compactness of (D, d) is straightforward.

Index extension
The aim of this section is to adapt the concepts of index and index space in the terms that were introduced in [7] to the context of the composition metrics.We will also explain the extension methods available to obtain an approximation framework for Lipschitz regression.For this purpose, we will present two different techniques.The first is based on what are known in [7] as standard indices, which are essentially defined by the distance to a reference point.The second is based on the McShane and Whitney extension formulae already explained.
Our models essentially consist of a metric space (D, d) and an index I (a real Lipschitz function) defined on it.These indices give meaningful values to the elements of D, which are the objects of the models.The Lipschitz condition of the index is the tool that introduces a certain concordance of the metric with the nature of the distance in D. Thus, for example, a ranking of the elements of D can be constructed according to the value of their index.The essence of the research we propose in this paper is that we introduce another tool to improve models based on index spaces: the construction of composition metrics d ϕ that improve the fit of the metric to the situation we want to model.
In [7] it is said that a triplet (D, d, I) is an index space.The index The infimum of all such constants C satisfying the last inequality is denoted by B(I).That is, B(I) = sup a∈D |I(a)|.In case we are considering the normed space structure of the space of functions with the uniform norm, we will write ∥ • ∥ ∞ instead of B(•).
We will need two more boundedness type properties to characterize the set of indexes we are interested in.Definition 3.1.Let (D, d) be a metric space.An index I : These functions are often called Katetov functions.The infimum of all such constants Q is the normalization constant of I; we write N (I) for it.Definition 3.2.Let (D, d) be a metric space.An index I : that is, if the index I is ϕ-Lipschitz for the constant K.The infimum of all constants K satisfying last inequality is the coherence constant of I, and we will write for it C(I).
In practice, when building models using index spaces, the index value will not always be available for all elements of the metric space.This may be the case, for example, when it is costly or impossible to obtain all the data for the situation on which the model is built.In this context, it is useful to have tools that allow us to approximate the index from non-indexed elements.As mentioned above, in this section we propose two ways of doing this: the first is to identify/approximate the index of interest using what we will call standard indices, while the second is to approach the question as a Lipschitz regression problem using the classical extension formulae.Both techniques can be adapted to the case of composition metrics, as we will see below.Typically, the selection criterion for a is to identify the element that minimises certain properties, although any other element could be chosen.The aim of this section is to introduce an additional tool, the composition metric d ϕ , which allows us to use the associated standard indices b → d ϕ (a, b).Our interest, therefore, is to show how we can approximate any given index using standard indices.We will first present some results on compactness in index spaces in order to establish the necessary theoretical framework.We will then turn our attention to the central issue of approximation.The main goal is to show that a robust approximation method is possible, at least in theory.
Note that uniformly bounded sets of indices (without Lipschitz-type requirements) are pointwise compact.Indeed, let C > 0 and consider the set of functions F C := {I : D → R : B(I) ≤ C}.In it we can define two natural topologies: the uniform topology (for the norm B(I) := sup a∈D |I(a)|) and the topology of pointwise convergence.
it is a compact space with the topology of pointwise convergence, since we can identify each function of {I η } η∈Λ with an element of Π a∈D [k, C] (product of compact spaces in the product topology) and by Tychonoff's theorem gives that it is compact.
However, although we cannot expect compactness with respect to the topology of uniform convergence of the entire space of uniformly bounded functions, the space of standard indices is compact.This allows us to obtain that there is always a best approximation for each Lipschitz index I by the elements of S, as stated in Corollary 3.4.corollary 3.4.Let ϕ ∈ Φ and let (D, d) be a compact metric space.For every Lipschitz index I acting in the compact space (D, d ϕ ), there is an element a 0 ∈ S such that the standard index I a 0 ,ϕ is the best approximation to I in S, that is, Proof.A direct compactness argument gives the proof.The function F : S → R defined as is continuous (and even Lipschitz), since Let us now focus our attention on the approximation bound for general Lipschitz indices.In particular, we will show that we can always get an estimate of the error made by this approximation procedure in terms of the generalisation of the normalisation and the coherence constants.For technical reasons, we also need to name a type of sequence that will appear in the result we are looking for.
A sequence {a n } n ⊂ D is pointwise Cauchy if for each b ∈ D there exists lim n d(a n , b).Every convergent sequence is pointwise Cauchy, but the converse is false.The sequence a n = 1/n in D = (0, 1] with the Euclidean metric is an example of non-convergent pointwise Cauchy sequence.The definition above can directly be translated for composition metrics d ϕ , ϕ ∈ Φ.
The following result will finally give us the tool to approximate an index using the standard indices, in a sense of improvement of [7, Th. 1].We will also see that this approximation depends on the product of the normalisation and coherence constants.Specifically, we will see these results for the following set of indices to be approximated: The proof of the following result is similar to the theorem discussed before.We include the proof for the aim of completeness.Proof.Take b ∈ D. Fix n ∈ N. Then for every n ∈ N there is an element and therefore So if KQ ≈ 1 the comparison between Ĩ and I is reasonable, but as these constants increase the approximation may get worse.
In addition, taking b = a 0 in the result of Theorem 3.5 we have and so I(a 0 ) = inf(I).Consequently we can write Ĩ(•) = I(a 0 ) + d ϕ (a 0 , •), being a 0 ∈ D a point in which I attains their minimum.In addition, we can assume for the indices we work with that inf(I) = 0, so we can make this approximation for any Q-normalised and ϕ-coherent index for K.In this case K Ĩ(•) = d ϕ (a 0 , •).

Extension theorems: McShane and Whitney formulas.
Another approach to the extension problem is to formulate an approximation for the unknown values using the extension formulas outlined in section 2. While there are alternative expansion techniques, such as those discussed in [8], which may be more suitable for specific purposes, for our overarching application it proves more advantageous to use the classical McShane and Whitney formulas.The method follows the procedure explained in [7], adapted to the case of the composition metric.A full explanation can be found in Section 4 of that article, and in the example given in Section 5 of the same article.
remark 3.7.To ensure that the composition d ϕ defines a metric, in the proof of Proposition 2.5 we only considered properties (i)-(iii) of Φ.That is, the continuity property is not necessary, although it was needed to ensure the compactness results for standard indices and to obtain the result of the Theorem 3.5.However, this is not the case for these results on the McShane-Whitney extensions, since all that is required is that d ϕ defines a metric.Thus, the functions of Φ can be more general than a continuity modulus for this technique.
Convex combinations of the classical extension formulas can also be used.Furthermore, as in the case of standard indices, the product of the normalisation and coherence constants is related to the accuracy of the approximation.Note that

Applications: the liveability index for cities
In this section we present a methodological proposal for implementing the theoretical content of this paper in order to extend a given index.We start with a finite set of elements, characterised by certain real variables, for which we want to determine the value of a certain index I.For some of these elements, the value of the index of interest is already known.Our aim is to extrapolate this known information to estimate the value of the index for those elements where it is not defined.Mathematically, this set constitutes a metric space D, equipped with an appropriate distance metric related to the nature of the data or the problem at hand.In addition, there is a known index within a subset D 0 ⊂ D that we want to extend to the whole space D. To achieve this goal, we propose the following methodology.

4.1.
Methodology.The first question we need to address is whether the diverse nature of the variables could distort the metric under consideration, given the heterogeneity of their scales.To mitigate this potential problem, we suggest normalising the variables to a common scale by subtracting the minimum value and dividing by the range.More precisely, let D = {y j } n j=1 and y j = (x j 1 , • • • , x j m ).Let a k := max j x j k and b k := min j x j k for each k = 1, • • • , m.We then transform for all j and k, so that we have the new variables restricted to [0,1], in the same scale.
To assess the accuracy of the approximation we are about to make, we need a measure of the error made, which in our case will be the Root Mean Square Error (RMSE).This gives the expected absolute error and is defined as where a 1 , . . ., a n are the observations where we want to estimate the error, and Ĩ is the approximation to I.However, since we have no information about the index values we want to approximate, we need a strategy to estimate this error.In our approach, we will divide D 0 , the subset of observations with known indices, into two subsets: a training set and a test set.We will use observations from the training set, which is seventy percent of the total observations and is randomly selected, to perform the expansion.We will then use the remaining observations from the test set to calculate the Root Mean Square Error (RMSE).Nevertheless, the randomness inherent in this process can affect the resulting error, so it may not be representative.To mitigate this problem, we use a technique known as cross-validation.This involves repeating the process multiple times (twenty times in our case) in order to accumulate the resulting errors and providing a more robust conclusion regarding accuracy.
In order to select a ϕ function that best fits the model, we engage in an optimisation process aimed at minimising the error bound on the test set.According to theorem 3.5, this means minimising the product of the coherence and normalisation constants.Ideally, we would divide our dataset into three subsets: the training and test subsets mentioned above, and a validation subset from which we would perform the fitting.However, due to the potentially limited number of observations available, the resulting subsets may not be sufficiently significant for this study.Therefore, we will use the values obtained from the test set as a reference for our optimisation process.To do this, we will consider that the linear combination of functions in Φ with positive scalars is another function in Φ.We will first choose a set of elementary functions {ϕ j } n j=1 ⊂ Φ and we will discuss for which values λ 1 , . . ., λ n ≥ 0 the function ϕ := λ 1 ϕ 1 + . . .+ λ n ϕ n ensures that the metric d ϕ is optimal in terms of the bound.To do this, we will consider the particle swarm optimisation algorithm of the R library "pso".This type of algorithm, unlike those based on the gradient of the function, explores the entire possible set of parameters and thus avoids convergence to local minima.
If we consider the extension using the Whitney and McShane formulae, which are maximum and minimum extensions respectively, we can ask whether we can consider an intermediate extension that minimises the error.That is, for which α ∈ [0, 1] the extension I := (1 − α)I W + αI M minimises the error.As in the previous point, the preferred way to obtain this parameter would be from a validation set, but for the reasons already explained, we will use the test set as a reference.To do this, we will choose the value of α according to the following result. for 2 and note that Solving the equation F ′ (α) = 0 we obtain the α 0 we are looking for, since

□
We have chosen to use the RMSE to quantify the error instead of other alternatives because it ensures the differentiability of the function F under consideration.This facilitates a straightforward analysis of its minimum, as demonstrated in the previous proposition.Had we chosen other error measures defined in terms of absolute value, such as Mean Absolute Error (MAE) or Symmetric Mean Absolute Percentage Error (SMAPE), it would have been necessary to use a more complicated and indirect approach to determine the optimal α due to the non-differentiable nature of such definitions.
If we consider the extension by identifying the index with a standard one, we will proceed to find the element a 0 ∈ D that minimises the index.In this case we will take Ĩ(b) := Kd ϕ (a 0 , b) as an approximation of I(b), since min(I) = 0 after scaling.4.2.Extension of a liveability index.In the following, we will validate our proposed approach using the so-called AARP Livability Index.In 2018, 55 per cent of the world's population lived in urban areas, a figure that is expected to rise to 68 per cent by 2050, according to [12].This rapid urbanisation underlines the growing importance of studying and quantifying concepts such as quality of life or liveability in cities, as evidenced by various indices outlined in [11].The purpose of these indices is twofold: first, to define the concept of livability and identify the parameters that describe it; and second, to provide insights into which cities or neighbourhoods offer better living conditions.Armed with this information, urban planners can identify areas in need of intervention, while public administrations can target development and investment initiatives to regions with poor living conditions.However, assessing liveability can be a complex task due to the large number of factors involved, many of which are difficult to assess.For example, The Economist's Global Liveability Index, one of the most widely used, includes thirty indicators across five categories, with some indicators building on others.In addition, certain factors, such as climate discomfort for travellers or levels of corruption, are subjective and inherently difficult to quantify.In this section, we propose to use the index extension theory developed in the previous section to approximate livability using only indicators related to alternative mobility.The aim is to shift the focus away from subjective or complex social indicators and instead focus on factors that can be easily estimated based on existing infrastructure and the connectivity of urban patterns.
Let us explain the databases we will consider.Walk Score ®1 is a website that scores, from 0 to 100, the walkability performance of 123 cities in the United States and Canada according to a series of parameters, such as intersection density, block length, access to amenities in less than a 5minute walk, etc.In addition, Walk Score uses a similar scoring system to rate the performance of cities for walking and cycling.Our aim will be to use these three indicators to approximate the AARP livability index 2 .This index evaluates 61 different indicators in seven categories (housing, neighbourhood, transportation, environment, health, engagement and opportunity) to assess the livability of US cities, such as housing costs, crime rates, air quality or income inequality.The final score is a number between 0 and 100, with 50 being an average score and higher scores corresponding to above-average performance and vice versa.In mathematical terms our metric space is D ⊂ [0, 100] 3 , where each element (x, y, z) ∈ D represents a city with walk, transport and bike scores x, y and z respectively, equipped with the canonical metric d of R 3 .For 101 US cities we have defined the index of interest, which we will call I, and our goal is be able to define it for 22 Canadian cities as well.Table 1 shows an example of our data.

City
Walk We have implemented the extension of our index according to the considerations of 4.1.In particular, for illustrative purposes, we study our method by considering two linear combinations of functions of Φ as follows: ϕ(x) = p 1 x + p 2 log(1 + x) + p 3 arctan(x) + p 4 x 1 + x , p 1 , . . ., p 4 ≥ 0, and Table 2 presents a comparative analysis of the performance of the two extension procedures studied (identification with a standard index and McShane-Whitney extensions) and of the various metrics considered.The results show that the identification of our index with a standard index gives poor performance, as evidenced by a significantly high estimated mean error, making it unsuitable for consideration.As far as the extension formulas are concerned, our technique maintains the standard deviation of the error while reducing the expected RMSE, although not significantly.However, it should be noted that our technique requires a longer computation time, mainly due to the optimisation process involved.Furthermore, table 3 shows the results of considering a linear combination as ψ in this scenario, alongside the results of the classical technique.In particular, there is a more significant improvement in performance compared to the original metric, particularly noticeable in the case of standard indices.This variance in performance  highlights the fact that the choice of ϕ-metric has a significant impact on the degree of improvement obtained relative to the original metric.
We also provide a comparison of these results with those obtained by applying different regression algorithms widely studied in the literature: neural networks and linear regression.The results of this comparison are summarised in Table 4.It is noteworthy that the results obtained by a neural network are comparable to those obtained by the McShane-Whitney technique, both in terms of the estimated error and its deviation, and in terms of execution time.We can also compare the performance of the standard indices with that of a linear regression.For our example, similar results are obtained, except for the computation time, where linear regression proves to be more efficient.To allow a more comprehensive comparison of these behaviours, Figure 3 illustrates the different errors obtained in each iteration of the cross-validation.Each of the ψ metric models is plotted next to the most similar one discussed above.It should also be noted that the way in which this improvement is achieved could vary from one method to another and from one metric to another.With this in mind, we have taken a concrete division into training and test sets (the 71 most populated cities will serve as training and the rest as test) and applied the results of the extension studied.In the case of standard indices, if we look at Figure 4, we can see that by redefining the metric to d ϕ or d ψ , the improvement is general, i.e. we obtain a lower error for each element following the original trend.However, in the case of the McShane-Whitney method, Figure 5 shows that depending on the new metric, the accuracy can be different for each element, although on average it is lower, as we have seen before.
Finally, in the Table 5 we present the predictions resulting from each method and provide a ranking according to them.Since we do not have a benchmark for our index, we will compare it with other existing indices when evaluating the resulting rankings.The Mercer quality of living city ranking3 classifies Canadian cities in the following order: Vancouver, Toronto, Ottawa, Montreal and Calgary.As we can see, this ranking is reasonably consistent with the one we have offered and, although the standard indices do not provide an exact approximation of the index in question, they do provide an accurate overview when it comes to establishing a ranking.

Conclusions
In this paper we have shown a new methodology for the extension of indices defined on metric subspaces of metric models.The main contribution of our results is that they include a new class of metrics (composition metrics) that give us more flexibility in the approximation tools for finding adapted results of Lipschitz regression processes.While the state of the art Lipschitz extensions are highly dependent on the chosen metric, this methodology provides us with a straightforward way to improve extension results D is a nonempty set and d : D × D → R + , where R + is the set of non-negative real numbers, d is a distance or metric if it satisfies: d(a, b) = 0 if and only if a = b, d(a, b) = d(b, a) and d(a, b) ≤ d(a, c)+d(c, b) for all a, b, c ∈ D. The pair (

Theorem 2 . 1 .
If f : S ⊂ D → R is an L-Lipschitz function, then there exists an L-Lipschitz function F : D → R such that F ↾ S = f .This function F is not unique, and two possible formulae are F M (x) := sup y∈S {f (y)−Ld(x, y)} and F W (x) := inf y∈S {f (y)+Ld(x, y)}, x ∈ D, which are known as the McShane and Whitney extensions respectively.

( 1 )
For a, b ∈ D, condition d ϕ (a, b) = 0 holds if, and only if, d(a, b) = 0 because ϕ is only null at 0. Since d is a metric we have that it holds if, and only if, a = b, so d ϕ satisfy the identity of indiscernibles.(2) Since d(a, b) = d(b, a) for all a, b ∈ D it is clear that d ϕ (a, b) = d ϕ (b, a), that is, d ϕ is symmetric.(3) Take a, b, c ∈ D and write x = d(a, b), y = d(b, c) and z = d(a, c).

Figure 2 .
Figure 2. Representation of the triangular inequality of d and d ϕ .

3. 1 .
Approximation through standard indices.In a metric space, the distance function d allows us to define indices that are inherently natural, known as standard indices.For a given point a ∈ D, we can define an index I a as I a (b) := d(a, b), where b ∈ D. These functions are called standard indices.

proposition 3 . 3 .
Let ϕ ∈ Φ.Let (D, d) be a compact metric space.Then there exists C > 0 such that the space S := {d ϕ (a, •) : a ∈ D} of standard indices associated with the metric d ϕ , is included in F C and it is compact with respect to the topology of uniform convergence.Proof.First, note that due to the compactness of (D, d) the metric d is bounded by a certain constant R > 0. Then S is bounded by C := ϕ(R) and so S ⊂ F C .In addition, let {d ϕ (a n , •)} n ⊂ S. By the compactness of (D, d) again and by Proposition 2.7 we know that (D, d ϕ ) is also compact, so the sequence {a n } n admits a subsequence {a n k } k that converge to a 0 ∈ D with respect to d ϕ .So, for every ε > 0 there existsk 0 ∈ N such that d ϕ (a n k , a 0 ) < ε for all k ≥ k 0 .Then,for every b ∈ D, by the triangular inequality we get sup b∈D |d ϕ (a n k , b) − d ϕ (a 0 , b)| ≤ sup b∈D d ϕ (a n k , a 0 ) = d ϕ (a n k , a 0 ) < ε, for k ≥ k 0 .That is, {d ϕ (a n k , •)} k converges uniformly to d ϕ (a 0 , •), so by the sequential characterization of compactness we conclude the desired result.□ for all a, b ∈ D. Compactness of S (Proposition 3.3) proves the result.□

Theorem 3 . 5 .
Let K, Q > 0 such that KQ ≥ 1.For every I ∈ R K,Q,C there exists a pointwise Cauchy sequence {a n } n such that I(b) ≤ inf(I) + lim n Kd ϕ (a n , b) ≤ KQI(b), for each b ∈ D.
for all n ∈ N and b ∈ D. Now note that d ϕ (a n , •) = I an (•) ∈ S, thus, from the compactness of S seen in Proposition 3.3 there exists a subsequence {a n k } k such that lim k d ϕ (a n k , b) = d ϕ (a 0 , b) for each b ∈ D and certain a 0 ∈ D. Therefore {a n k } k is a pointwise Cauchy sequence, and from the last inequality we conclude that I(b) ≤ inf(I) + K lim k d ϕ (a n k , b) ≤ KQI(b) for every b ∈ D. □ This result leads us to identify the function Ĩ := inf(I) + K lim k d ϕ (a n k , •) as an approximation for I ∈ R K,Q,C .The maximum error committed is bounded by sup b∈D Ĩ(b) − I(b) ≤ sup b∈D |KQI(b) − I(b)| = (KQ − 1)C.

remark 3 . 6 .
The condition QK ≥ 1 stated in Theorem 3.5 is in a sense universal in index spaces.Indeed, since I ≥ 0 and I attains the minimum in b ∈ D (a circumstance that arises, for instance, when D is finite or compact) and this minimum is 0, thenI(a) = I(a) − I(b) = |I(a) − I(b)| ≤ Kd ϕ (a,b) ≤ KQ(I(a) + I(b)) = KQI(a).Consequently, if there exists a point b ∈ D such that I(b) = 0, we can ensure KQ ≥ 1.Moreover, even if such a scenario does not arise, in the case of an index defined within a compact metric space, we will still have inf(I) = I(b) for some b ∈ D, implying that I 0 (a) := I(a) − I(b) constitutes another positive index that retains the same order properties as I, with I 0 (b) = 0.
b∈D {I(b) + Kd ϕ (a, b)} ≤ inf b∈D {I(b) + KQ(I(a) + I(b))} = (1 + KQ) inf b∈D I(b) + KQI(a), for any a ∈ D. So, sup a∈D I W (a) − I(a) ≤ (1 + KQ) inf b∈D I(b) + |KQ − 1| sup a∈D |I(a)| .If we suppose that inf b∈D I(b) = 0 and KQ ≥ 1, as in the case of standard indices, the last bound is reduced to sup a∈D I W (a) − I(a) ≤ (KQ − 1)C, what indicates that the approximation improves when KQ → 1.Similar bounds can be found for the McShane formula, and then for any convex combination of both.

proposition 4 . 1 .
Let (D, d) be a finite metric space and Results for d (yellow) and d ϕ (blue).
Results for d (yellow) and d ψ (blue).

Figure 3 .
Figure 3.Comparison of extension errors using McShane-Whitney formulas, for different metrics.
Results for d (yellow) and d ϕ (green).
Results for d (yellow) and d ψ (green).

Figure 4 .
Figure 4. Comparison of extension errors using standard indices, for different metrics.
Results for d (yellow) and d ϕ (green).
Results for d (yellow) and d ψ (green).

Figure 5 .
Figure 5.Comparison of extension errors using McShane-Whitney formulas, for different metrics.

Table 1 .
Score Transit Score Bike Score I Examples of scores and index for some cities.

Table 2 .
Comparison of method performance for function ϕ.

Table 3 .
Comparison of method performance for function ψ.