MAHA-z: A Mahalanobis distance kNN estimator for photometric redshifts

arXiv:2611.14582 · astro-ph.IM, astro-ph.CO, astro-ph.GA · Submitted 2026-11-10 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Astrophysics. The day in astrophysics: observations, models and what the data forces.

Vera: I'm Vera.

Jocelyn: And I'm Jocelyn, here with Subrahmanyan.

Vera: We're looking at the paper: "MAHA-z: A Mahalanobis distance kNN estimator for photometric redshifts".

Jocelyn: Here's the gist of the paper. MAHA-z presents a photometric-redshift (photo-z) estimator that combines k-nearest neighbour (kNN) regression with a Mahalanobis distance metric learned from the covariance of a spectroscopic reference sample, making it a practical option for iterative photo-z production and validation in Stage-IV surveys<ref:2611.14582#pg2>.

Vera: MAHA-z assigns a photometric redshift to each target galaxy by combining three ingredients: (i) a feature vector built from magnitudes, colours, and optionally morphological parameters; (ii) a Mahalanobis metric whose covariance encodes the structure of the galaxy population; and (iii) a k-nearest neighbour regression whose mean gives 1 point estimate and whose spread gives the per-galaxy uncertainty<ref:2611.14582#pg4>.

Jocelyn: The Mahalanobis distance generalizes the Euclidean distance to a space whose coordinates are correlated and carry different physical units, which is invariant under invertible linear transformations of the coordinates, essential when dealing with magnitudes and colours measured in different bands with very different variances<ref:2611.14582#pg4>.

Vera: Feature Space and Metric Construction The feature vector for each galaxy is defined as f = m1,..., mNb, c1,..., cNc, µ1,..., (3)<ref:2611.14582#pg4>.

Paper summary: Vera: So wrapping up on this paper, MAHA-z is a photometric redshift estimator that uses k nearest neighbour regression combined with a Mahalanobis distance metric learned from the covariance of a spectroscopic training sample.

Jocelyn: The main implication for me is that it gives us a tool that respects the geometry of the galaxy population when we are dealing with different photometric bands and different units.

Subrahmanyan: From my side, I see this as a way to get redshift estimates faster and with better statistical rigor without needing the heavy computational burden of more complex neural network codes.

Vera: It’s a transparent, training light alternative to template fitting or neural network photo-z codes that provides a posterior as informative as that of a neural network at a fraction of the computational cost.

Jocelyn: The combination of properties is not just aesthetic because the covariance matrix C absorbs the units and correlations, allowing for native treatment of heterogeneous photometry without imputation.

Subrahmanyan: We’re talking about a metric that respects how galaxies are actually clustered in their data space, which is what we need when dealing with heterogeneous photometry across different surveys.

Conclusion: Vera: So we’ve looked at MAHAz, this new photometric redshift estimator that uses k nearest neighbour regression with a Mahalanobis distance metric learned from spectroscopic data.

Jocelyn: It boils down to taking the features of a galaxy, like its colours and magnitudes, and finding its neighbours in that feature space.

Subrahmanyan: And instead of just looking at how far away it is using simple Euclidean distance, they use this Mahalanobis thing which accounts for how those different measurements are correlated.

Vera: Exactly. The paper shows this setup works well on four different datasets, including simulations and actual survey data like the Euclid Flagship mock and the DES Year Three sample.

Jocelyn: The numbers look pretty promising too, especially when you compare its performance to other methods like ANNz2 on some of those samples.

Subrahmanyan: And what this means for us is that we get a method that’s fast enough to do lots of photo-z estimations iteratively in big surveys without needing massive training sets for complex neural networks.

Vera: It gives us a way to get good redshift estimates with very low scatter, like the sigma NMAD values they report on the Euclid Flagship data.

Jocelyn: But it's still important to remember that this is a tool, not a perfect oracle; you still need to check those caveats about outliers and how well it handles missing bands.

Subrahmanyan: That’s the key; we need to see if this geometric approach actually captures the underlying structure of galaxy populations in the way they claim.

Vera: So, as we wrap up on MAHAz, it gives us a transparent, relatively simple way to get photometric redshifts that respects how galaxies are naturally arranged in their data space.

Jocelyn: It’s a practical step forward for getting those large catalogs populated with redshift information without the massive computational overhead of other machine learning codes.

Subrahmanyan: The next thing we need to watch is whether this method can handle the full complexity of structure formation and how it connects to the big cosmological picture.

Paula S. Ferreira, Ribamar R. R. Reis, Renyue Cen

Center for Cosmology and Computational Astrophysics, Institute for Advanced Study in Physics, Zhejiang University · Institute of Astronomy, School of Physics, Zhejiang University · Instituto de Física, Universidade Federal do Rio de Janeiro

astro-ph.IM, astro-ph.CO, astro-ph.GA

Submitted: 2026-11-10

Updated: 2026-11-10

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 91/100

The gist: MAHA-z presents a photometric-redshift (photo-z) estimator that combines k-nearest neighbour (kNN) regression with a Mahalanobis distance metric learned from the covariance of a spectroscopic…

Key concepts

k-nearest neighbour (kNN) regression
This technique finds the 'k' closest galaxies in a feature space defined by magnitudes, colours, and optionally morphology. The mean of these neighbors provides the primary redshift estimate for a target galaxy. The spread among these neighbors is used to determine the uncertainty of that estimate.
Mahalanobis distance
This metric generalizes standard distance by accounting for correlations between different features (like different filters) and their varying units. It learns a covariance matrix from spectroscopic data, allowing it to measure distances in a way that respects the actual structure of the galaxy population, which is crucial when dealing with heterogeneous photometric data.
Feature Space
This is a multi-dimensional space where each galaxy is represented by its measurements—magnitudes ($m$), colours ($c$), and optionally morphological parameters ($ ilde{ u}$). The Mahalanobis metric operates within this space, using the learned covariance to understand how these different measurements relate to each other in terms of physical structure.

Terminology

Summary

MAHA-z presents a photometric-redshift (photo-z) estimator that combines k-nearest neighbour (kNN) regression with a Mahalanobis distance metric learned from the covariance of a spectroscopic reference sample, making it a practical option for iterative photo-z production and validation in Stage-IV surveys<ref:2611. p. 0

Where the paper says it

Athos da Silveira Ramos, 149 – Cidade Universitária, Rio de Janeiro, Brasil 4 Observatório do Valongo, Universidade Federal do Rio de Janeiro, Ladeira Pedro Antônio, 43, Centro, Rio de Janeiro, Brasil e-mail: ribamar@if. br Received ; accepted ABSTRACT We present MAHA-z, a photometric-redshift (photo-z) estimator that combines k-nearest neighbour (kNN) regression with a Mahalanobis distance metric learned from the covariance of a spectroscopic reference sample.

14582#pg2>.

Methodology of MAHA-z

MAHA-z assigns a photometric redshift to each target galaxy by combining three ingredients: (i) a feature vector built from magnitudes, colours, and optionally morphological parameters; (ii) a Mahalanobis metric whose covariance encodes the structure of the galaxy population; and (iii) a k-nearest neighbour regression whose mean gives 1 point estimate and whose spread gives the per-galaxy uncertainty<ref:2611.14582#pg4>. The Mahalanobis distance generalizes the Euclidean distance to a space whose coordinates are correlated and carry different physical units, which is invariant under invertible linear transformations of the coordinates, essential when dealing with magnitudes and colours measured in different bands with very different variances<ref:2611. p. 2

Where the paper says it

Two properties are what motivate its use here. First, unlike the Euclidean metric, it is invariant under invertible linear transformations of the coordinates, so a rescaling or rotation of the feature space leaves every distance unchanged – an essential property when the coordinates are magnitudes and colours measured in different bands with very different variances.

14582#pg4>.

Feature Space and Metric Construction

The feature vector for each galaxy is defined as f = m1,..., mNb, c1,. p. 2

Where the paper says it

Feature space For each galaxy the feature vector is f = m1, . , mNb , c1, .

p. 2
Where the paper says it

Feature space For each galaxy the feature vector is f = m1, . , mNb , c1, .

p. 2
Where the paper says it

Feature space For each galaxy the feature vector is f = m1, . , mNb , c1, .

.., cNc, µ1,. p. 2
Where the paper says it

, mNb , c1, . , cNc , µ1, .

p. 2
Where the paper says it

, mNb , c1, . , cNc , µ1, .

p. 2
Where the paper says it

, mNb , c1, . , cNc , µ1, .

.., (3)<ref:2611. p. 0
Where the paper says it

Its importance stems from its probabilistic output and its long-standing validation at faint magnitudes with filter sets similar to those of current and near-future surveys. BPZ has been adopted in major survey analyses and remains a standard template-fitting refArticle number, page 1 of 14 arXiv:2611.

p. 0
Where the paper says it

Its importance stems from its probabilistic output and its long-standing validation at faint magnitudes with filter sets similar to those of current and near-future surveys. BPZ has been adopted in major survey analyses and remains a standard template-fitting refArticle number, page 1 of 14 arXiv:2611.

p. 0
Where the paper says it

Its importance stems from its probabilistic output and its long-standing validation at faint magnitudes with filter sets similar to those of current and near-future surveys. BPZ has been adopted in major survey analyses and remains a standard template-fitting refArticle number, page 1 of 14 arXiv:2611.

14582#pg4>. The Mahalanobis metric is estimated from the spectroscopic training sample with the mean photometric error variance of the photometric sample added on the diagonal to form C<ref:2611. p. 2
Where the paper says it

Three colour configurations supported are: – all (default): all pairwise colours, Nc = Nb 2 ; – adjacent: consecutive colours, Nc = Nb − 1; – reference: each band against a single reference band, Nc = Nb − 1; – none: no colours, only magnitudes, Nc = 0. Covariance matrix The covariance matrix C used by the Mahalanobis metric is estimated from the spectroscopic training sample, with the mean photometric error variance of the photometric sample added on the diagonal: C =     σ 2 11 + ⟨ϵ 2 1 ⟩ σ 2 12 · · · σ 2 1d σ 2 21 σ 2 22 + ⟨ϵ 2 2 ⟩ · · · σ 2 2d .

p. 2
Where the paper says it

Three colour configurations supported are: – all (default): all pairwise colours, Nc = Nb 2 ; – adjacent: consecutive colours, Nc = Nb − 1; – reference: each band against a single reference band, Nc = Nb − 1; – none: no colours, only magnitudes, Nc = 0. Covariance matrix The covariance matrix C used by the Mahalanobis metric is estimated from the spectroscopic training sample, with the mean photometric error variance of the photometric sample added on the diagonal: C =     σ 2 11 + ⟨ϵ 2 1 ⟩ σ 2 12 · · · σ 2 1d σ 2 21 σ 2 22 + ⟨ϵ 2 2 ⟩ · · · σ 2 2d .

14582#pg5>. The squared Mahalanobis distance between a target galaxy a and a spectroscopic galaxy s is d 2a,s = (fa - fs) T C-1 (fa - fs), evaluated with the pseudo-inverse of C<ref:2611. p. 2
Where the paper says it

If the training sample is small, the empirical covariance can optionally be shrunk towards a scaled identity via the Ledoit–Wolf estimator; the two estimates are averaged with equal weight. The squared Mahalanobis distance between a target galaxy a and a spectroscopic galaxy s is d 2 a,s = (fa − fs) ⊤ C−1 (fa − fs), (5) and is evaluated with the pseudo-inverse of C.

14582#pg6>.

Performance Validation Across Datasets

The method was validated on four datasets spanning simulations and survey photometry: the Euclid Flagship 2 mock, the Legacy-KiDZ calibration sample, VIPERS, and the DES Year 3 BAO sample<ref:2611.14582#pg6>. On Euclid Flagship 2 (LSST+NISP), MAHA-z achieves σNMAD = 0. p. 0

Where the paper says it

We validate the method on four datasets spanning simulations and survey photometry: the Euclid Flagship 2 mock, the Legacy-KiDZ calibration sample, VIPERS, and the DES Year 3 BAO sample. On Euclid Flagship 2 (LSST+NISP) we achieve σNMAD = 0.

0148 with a 0. p. 0
Where the paper says it

On Euclid Flagship 2 (LSST+NISP) we achieve σNMAD = 0. 0148 with a 0.

27% outlier fraction, and on DES Y3 we obtain σNMAD ≈ 0. p. 0
Where the paper says it

0148 with a 0. 27% outlier fraction, and on DES Y3 we obtain σNMAD ≈ 0.

023 with.

PDF Diagnostics and Comparison to Neural Networks

The estimator can optionally return a full posterior p(z f), built as a Gaussian kernel density estimate over the redshifts of the k neighbours<ref:2611.14582#pg4>. In the DES Y3 BAO sample, MAHA-z and ANNz2 produce statistically indistinguishable posteriors on the same 5 080 galaxies, with PIT KS distances of 0. p. 9

Where the paper says it

For comparison, the Pz Cats analysis of the same DES Y3 BAO sample reports that approximately 60 per cent of the ANNz2 posteriors satisfy their Gaussian criterion (Ferreira & Reis 2025). The Gaussian fraction of MAHA-z is therefore comparable to— and, for the i-band reference configuration, slightly higher than—that of a well-trained neural network on the same photometry, despite the different functional form of the two posteriors: MAHA-z builds its PDF from a kernel density estimate over a handful of neighbour redshifts, while ANNz2 constructs a weighted mixture of Gaussians.

102 and 0.101<ref:2611. p. 0
Where the paper says it

Its importance stems from its probabilistic output and its long-standing validation at faint magnitudes with filter sets similar to those of current and near-future surveys. BPZ has been adopted in major survey analyses and remains a standard template-fitting refArticle number, page 1 of 14 arXiv:2611.

14582#pg10>. The two estimators are comparable in peak position and width for the majority of galaxies<ref:2611. p. 8
Where the paper says it

For the majority of galaxies the two PDFs peak at the same redshift and have comparable widths; the largest discrepancies occur for galaxies whose MAHA-z posterior is itself double-peaked, in which case MAHA-z tends to concentrate on the mode closest to the true redshift. Figure 6 shows the PIT histograms for the two estimators on the same galaxies.

14582#pg10>.

Conclusion on Practicality

MAHA-z offers a transparent, training-light, computationally inexpensive alternative to template-fitting and neural-network photo-z codes<ref:2611.14582#pg11>. It does not replace them but provides a metric that respects the geometry of the galaxy population, a posterior as informative as that of a neural network at a fraction of the computational cost<ref:2611. p. 1

Where the paper says it

The Euclidean metric at the heart of standard kNN ignores the fact that the galaxy population occupies an elongated, correlated locus in colour–magnitude space, and it consequently weights differences along the main colour sequence in the same way as differences perpendicular to it, even though the latter are far more informative about redshift. In this paper we revisit the kNN approach with a metric that respects the geometry of the data.

p. 1
Where the paper says it

The Euclidean metric at the heart of standard kNN ignores the fact that the galaxy population occupies an elongated, correlated locus in colour–magnitude space, and it consequently weights differences along the main colour sequence in the same way as differences perpendicular to it, even though the latter are far more informative about redshift. In this paper we revisit the kNN approach with a metric that respects the geometry of the data.

14582#pg10>. The combination of properties is not merely aesthetic because the covariance matrix C absorbs the units and correlations, allowing for native treatment of heterogeneous photometry without imputation<ref:2611. p. 3
Where the paper says it

Heterogeneous photometry: Mahalanobis in a feature subspace A key property of the Mahalanobis metric is that it can be evaluated in any subset of features without imputation. For a target galaxy with a mask m (the set of features that are finite for that galaxy), the sub-covariance is the corresponding sub-block of the full matrix, Cm = C[m, m], Wm = Cm + δI −1 , (10) and the squared Mahalanobis distance in the subspace is d 2 m(x, y) = (xm − ym) ⊤ Wm (xm − ym).

p. 3
Where the paper says it

Heterogeneous photometry: Mahalanobis in a feature subspace A key property of the Mahalanobis metric is that it can be evaluated in any subset of features without imputation. For a target galaxy with a mask m (the set of features that are finite for that galaxy), the sub-covariance is the corresponding sub-block of the full matrix, Cm = C[m, m], Wm = Cm + δI −1 , (10) and the squared Mahalanobis distance in the subspace is d 2 m(x, y) = (xm − ym) ⊤ Wm (xm − ym).

p. 3
Where the paper says it

Heterogeneous photometry: Mahalanobis in a feature subspace A key property of the Mahalanobis metric is that it can be evaluated in any subset of features without imputation. For a target galaxy with a mask m (the set of features that are finite for that galaxy), the sub-covariance is the corresponding sub-block of the full matrix, Cm = C[m, m], Wm = Cm + δI −1 , (10) and the squared Mahalanobis distance in the subspace is d 2 m(x, y) = (xm − ym) ⊤ Wm (xm − ym).

14582#pg4>.

Pruning redundant reasoning tokens

The paper presents a photometric-redshift (photo-z) estimator that combines k-nearest neighbour (kNN) regression with a Mahalanobis distance metric learned from the covariance of a spectroscopic reference sample, making it a practical option for iterative photo-z production and validation in Stage-IV surveys<ref:2611.14582#pg2>.

How the training signal is built

The covariance matrix C used by the Mahalanobis metric is estimated from the spectroscopic training sample, with the mean photometric error variance of the photometric sample added on the diagonal<ref:2611.14582#pg5>. If a small training sample is used, this empirical covariance can optionally be shrunk towards a scaled identity via the Ledoit–Wolf estimator<ref:2611. p. 2

Where the paper says it

σ 2 d1 σ 2 d2 · · · σ 2 dd + ⟨ϵ 2 d ⟩     + δI, (4) where σ 2 ij is the covariance of the training features, ⟨ϵ 2 i ⟩ is the mean squared 1σ photometric error of feature i over the photometric sample. If the training sample is small, the empirical covariance can optionally be shrunk towards a scaled identity via the Ledoit–Wolf estimator; the two estimates are averaged with equal weight.

14582#pg5>.

Where the gains come from

The Mahalanobis metric respects the elongated, correlated locus of the galaxy population rather than treating every direction in colour space as equally meaningful<ref:2611.14582#pg4>. This is confirmed by a redshift-resolved leave-one-band-out analysis showing that each filter matters precisely where the 4000 Å break crosses it<ref:2611. p. 6

Where the paper says it

Redshift-resolved band importance from the leave-oneband-out analysis. Each row corresponds to one filter removed from the entire sample, each column to a redshift bin of the validation set, and the colour encodes ∆σNMAD, the change in NMAD relative to the no-omission baseline: orange cells mean that removing the band degrades the estimate, blue cells mean that removing it slightly improves it.

14582#pg8>. The resulting posteriors are predominantly unimodal and near-Gaussian, with the remaining third almost entirely bimodal, which reflects genuine colour–redshift degeneracies<ref:2611. p. 9
Where the paper says it

8 per cent) are classified as bimodal, which reflects the prevalence of genuine colour–redshift degeneracies in the photometry rather than a failure of the estimator: a k-neighbour KDE retains both solutions when the training set contains two distinct redshifts for the same colours, whereas a single Gaussian would average them into a broader peak centred between them. For comparison, the Pz Cats analysis of the same DES Y3 BAO sample reports that approximately 60 per cent of the ANNz2 posteriors satisfy their Gaussian criterion (Ferreira & Reis 2025).

14582#pg10>.

MAHA-z assigns a photometric redshift to each target galaxy by combining three ingredients: (i) a feature vector built from magnitudes, colours, and optionally morphological parameters; (ii) a Mahalanobis metric whose covariance encodes the structure of the galaxy population; and (iii) a k-nearest neighbour regression whose mean gives 1 point estimate and whose spread gives the per-galaxy uncertainty<ref:2611.14582#pg4>.

The feature vector for each galaxy is defined as f = m1,..., mNb, c1,..., cNc, µ1,..., (3)<ref:2611.14582#pg4>. The Mahalanobis metric is estimated from the spectroscopic training sample with the mean photometric error variance of the photometric sample added on the diagonal to form C<ref:2611.14582#pg5>.

The Mahalanobis metric generalizes Euclidean distance, rescaling each coordinate by its own variance and rotating axes along principal directions, which is essential when coordinates are magnitudes and colours measured in different bands with very different variances<ref:2611.14582#pg4>. This property allows the method to handle heterogeneous photometry without imputation<ref:2611. p. 0

Where the paper says it

The Mahalanobis metric accounts for correlated features and heterogeneous units, eliminating ad hoc normalisation, and its subspace restriction allows MAHA-z to handle missing bands on a per-galaxy basis without imputation. We validate the method on four datasets spanning simulations and survey photometry: the Euclid Flagship 2 mock, the Legacy-KiDZ calibration sample, VIPERS, and the DES Year 3 BAO sample.

14582#pg4>.

MAHA-z builds directly on that idea and extends it in two directions. First, it uses the same neighbourhood for the full estimate rather than for the error alone: the point estimate is the neighbour mean, and its spread gives the per-galaxy uncertainty<ref:2611. p. 1

Where the paper says it

MAHA-z builds directly on that idea and extends it in two directions. First, it uses the same neighbourhood for the full estimate rather than for the error alone: the point estimate is the neighbour mean, the per-galaxy uncertainty is the neighbour scatter, and the posterior is a kernel density estimate over the neighbour redshifts.

14582#pg4>. Second, it replaces the Euclidean distance with a Mahalanobis distance estimated from the covariance matrix of the spectroscopic training set<ref:2611. p. 2
Where the paper says it

: MAHA-z point estimate of the NNE approach and is what makes a full p(z | f) possible. Second, it replaces the Euclidean distance with the Mahalanobis distance (Mahalanobis 2018)1 , estimated from the covariance matrix of the spectroscopic training set, so that the neighbourhood respects the elongated, correlated locus of the galaxy population rather than treating every direction in colour space as equally meaningful.

14582#pg4>.

The squared Mahalanobis distance between a target galaxy a and a spectroscopic galaxy s is d 2a,s = (fa - fs) T C-1 (fa - fs), evaluated with the pseudo-inverse of C<ref:2611.14582#pg6>.

The Mahalanobis metric is invariant under invertible linear transformations of the coordinates, so a rescaling or rotation leaves every distance unchanged, which is an essential property when coordinates are magnitudes and colours measured in different bands with very different variances<ref:2611.14582#pg4>.

The code will be available at https://github.com/psilvaf/MAHA-z/ after publication<ref:2611. p. 2

Where the paper says it

2 The code will be available at https://github. com/psilvaf/ MAHA-z/ after publication.

14582#pg4>. The point estimate and whose spread gives the per-galaxy uncertainty is obtained by combining three ingredients<ref:2611. p. 2
Where the paper says it

com/psilvaf/ MAHA-z/ after publication. the point estimate and whose spread gives the per-galaxy uncertainty.

14582#pg4>.

For each galaxy, a feature vector is built from magnitudes, colours, and optionally morphological parameters<ref:2611.14582#pg4>. The covariance matrix C used by the Mahalanobis metric is estimated from the spectroscopic training sample<ref:2611. p. 2

Where the paper says it

Three colour configurations supported are: – all (default): all pairwise colours, Nc = Nb 2 ; – adjacent: consecutive colours, Nc = Nb − 1; – reference: each band against a single reference band, Nc = Nb − 1; – none: no colours, only magnitudes, Nc = 0. Covariance matrix The covariance matrix C used by the Mahalanobis metric is estimated from the spectroscopic training sample, with the mean photometric error variance of the photometric sample added on the diagonal: C =     σ 2 11 + ⟨ϵ 2 1 ⟩ σ 2 12 · · · σ 2 1d σ 2 21 σ 2 22 + ⟨ϵ 2 2 ⟩ · · · σ 2 2d .

p. 2
Where the paper says it

Three colour configurations supported are: – all (default): all pairwise colours, Nc = Nb 2 ; – adjacent: consecutive colours, Nc = Nb − 1; – reference: each band against a single reference band, Nc = Nb − 1; – none: no colours, only magnitudes, Nc = 0. Covariance matrix The covariance matrix C used by the Mahalanobis metric is estimated from the spectroscopic training sample, with the mean photometric error variance of the photometric sample added on the diagonal: C =     σ 2 11 + ⟨ϵ 2 1 ⟩ σ 2 12 · · · σ 2 1d σ 2 21 σ 2 22 + ⟨ϵ 2 2 ⟩ · · · σ 2 2d .

14582#pg5>.

The point estimate is the mean of k training galaxies, and its spread is the standard deviation of that same neighbourhood<ref:2611.14582#pg10>. This combination provides a robust method for estimating photometric redshifts<ref:2611. p. 1

Where the paper says it

2016) is a based on directional neighbourhood fitting that has been extensively used in the Dark Energy Survey (Toribio San Cipriano et al. It provides robust photo-z PDFs, performs well on deep survey data, and has been validated as a machine-learning counterpart to template-fitting codes in large photometric catalogues, making it suitable for future LSST- and Euclid-like analyses.

14582#pg4>.

The estimator can optionally return a full posterior p(z f), built as a Gaussian kernel density estimate over the redshifts of the k neighbours<ref:2611.14582#pg4>. The kernel bandwidth is chosen adaptively per galaxy, ha = maxh α 1 + ˜za hmin i<ref:2611. p. 3

Where the paper says it

(7), not the mode of this KDE; the KDE is a complementary output for downstream applications that need a full posterior. The kernel bandwidth is chosen adaptively per galaxy, ha = maxh α 1 + ˜za , hmin i .

14582#pg4>.

The PDF is evaluated on a fixed grid z ∈ [0, zmax], Nz = 100<ref:2611.14582#pg4>. For every galaxy with a PDF, the following quantities are written alongside the point estimate:– the mode, zmode = arg maxz p(z fa);– the median, zmed, defined by R zmed −∞ p dz = 0. p. 3

Where the paper says it

The density is p(z | fa) = 1 |Nk(a)| X s∈Nk(a) 1 √ 2π ha (14) exp" − 1 2 z − zspec,s ha 2 # , and is renormalised to unit integral on the grid. For every galaxy with a PDF, the following columns are written alongside the point estimate: – the mode, zmode = arg maxz p(z | fa); – the median, zmed, defined by R zmed −∞ p dz = 0.

50;– the 68% credible interval [z16, z84], defined by R z16 −∞ p dz = 0. p. 3
Where the paper says it

For every galaxy with a PDF, the following columns are written alongside the point estimate: – the mode, zmode = arg maxz p(z | fa); – the median, zmed, defined by R zmed −∞ p dz = 0. 50; – the 68% credible interval [z16, z84], defined by R z16 −∞ p dz = 0.

16 and R z84 −∞ p dz = 0. p. 3
Where the paper says it

For every galaxy with a PDF, the following columns are written alongside the point estimate: – the mode, zmode = arg maxz p(z | fa); – the median, zmed, defined by R zmed −∞ p dz = 0. 50; – the 68% credible interval [z16, z84], defined by R z16 −∞ p dz = 0.

84<ref:2611. p. 0
Where the paper says it

Its importance stems from its probabilistic output and its long-standing validation at faint magnitudes with filter sets similar to those of current and near-future surveys. BPZ has been adopted in major survey analyses and remains a standard template-fitting refArticle number, page 1 of 14 arXiv:2611.

14582#pg4>.

The combination of properties is not merely aesthetic because the covariance matrix C absorbs the units and correlations, allowing for native treatment of heterogeneous photometry without imputation<ref:2611.14582#pg4>. This makes MAHA-z directly applicable to surveys with heterogeneous photometric coverage<ref:2611. p. 3

Where the paper says it

Targets are grouped by the mask m they carry, and each group is regressed against the training galaxies that are complete in that mask, provided at least min_training_for_mask such galaxies exist; otherwise the group is left un-estimated (its zphot is stored as NaN). This makes MAHA-z directly applicable to surveys with heterogeneous photometric coverage.

14582#pg4>.

The code also stores the per-bin σ68 and bias of ∆z as functions of zspec for the diagnostic plot of σ68 versus redshift<ref:2611.14582#pg4>. The validation metrics compare zphot against zspec on the held-out validation sample, reporting bias, scatter (σNMAD), and catastrophic outlier fraction<ref:2611. p. 4

Where the paper says it

Validation metrics To quantify the performance of the estimator, we compare zphot against zspec on the held-out validation sample. Following the photo-z literature we adopt the normalised residual ∆z = zphot − zspec 1 + zspec , (15) and report: – the bias, B = median(∆z); – the scatter, quantified by the Normalised Median Absolute Deviation σNMAD = 1.

14582#pg4>.

The validation galaxies are withheld from the neighbour pool so that performance numbers reflect what the estimator achieves on galaxies it has never seen<ref:2611.14582#pg4>.

The results show that MAHA-z reaches a scatter of σNMAD = 0.0148 for the reference LSST+NISP configuration, and on DES Y3 we obtain σNMAD ≈ 0. p. 0

Where the paper says it

0148 with a 0. 27% outlier fraction, and on DES Y3 we obtain σNMAD ≈ 0.

023<ref:2611. p. 0
Where the paper says it

27% outlier fraction, and on DES Y3 we obtain σNMAD ≈ 0. 023 with < 1% outliers and posterior calibration comparable to the ANNz2 catalogue.

14582#pg6>. This demonstrates competitive performance at substantially lower computational cost than trained machine-learning models<ref:2611. p. 0
Where the paper says it

023 with < 1% outliers and posterior calibration comparable to the ANNz2 catalogue. MAHA-z processes millions of galaxies in minutes and provides competitive PDFs at substantially lower computational cost than trained machine-learning models, making it a practical option for iterative photo-z production and validation in Stage-IV surveys.

14582#pg6>.

The internal structure of the MAHA-z posteriors confirms that the estimator is extracting physical redshift information<ref:2611.14582#pg10>. A redshift-resolved leave-one-band-out analysis shows that each filter matters precisely where the 4000 Å break crosses it, and a second peak in the u band traces the Lyman-α break<ref:2611. p. 6

Where the paper says it

003) confirm that MAHA-z does not extract information from bands that do not carry any redshift information. Taken together, the map shows that each filter matters precisely where the 4000 Å (or Lyman) break Article number, page 7 of 14

14582#pg8>. The posteriors are predominantly unimodal and near-Gaussian, with the remaining third almost entirely bimodal, which reflects genuine colour–redshift degeneracies<ref:2611. p. 9
Where the paper says it

8 per cent) are classified as bimodal, which reflects the prevalence of genuine colour–redshift degeneracies in the photometry rather than a failure of the estimator: a k-neighbour KDE retains both solutions when the training set contains two distinct redshifts for the same colours, whereas a single Gaussian would average them into a broader peak centred between them. For comparison, the Pz Cats analysis of the same DES Y3 BAO sample reports that approximately 60 per cent of the ANNz2 posteriors satisfy their Gaussian criterion (Ferreira & Reis 2025).

14582#pg10>.

The paper presents a photometric-redshift (photo-z) estimator that combines k-nearest neighbour (kNN) regression with a Mahalanobis distance metric learned from the covariance of a spectroscopic reference sample, making it a practical option for iterative photo-z production and validation in Stage-IV surveys<ref:2611.14582#pg2>.

MAHA-z offers a transparent, training-light, computationally inexpensive alternative to template-fitting and neural-network photo-z codes<ref:2611.14582#pg4>. It provides a metric that respects the geometry of the galaxy population, a posterior as informative as that of a neural network at a fraction of the computational cost<ref:2611. p. 1

Where the paper says it

The Euclidean metric at the heart of standard kNN ignores the fact that the galaxy population occupies an elongated, correlated locus in colour–magnitude space, and it consequently weights differences along the main colour sequence in the same way as differences perpendicular to it, even though the latter are far more informative about redshift. In this paper we revisit the kNN approach with a metric that respects the geometry of the data.

14582#pg10>. The combination of properties is not merely aesthetic because the covariance matrix C absorbs the units and correlations, allowing for native treatment of heterogeneous photometry without imputation<ref:2611.14582#pg4>.

In summary, MAHA-z offers a transparent, training-light, computationally inexpensive alternative to template-fitting and neural-network photo-z codes<ref:2611.14582#pg11>. It does not replace them but provides a metric that respects the geometry of the galaxy population, a posterior as informative as that of a neural network at a fraction of the computational cost<ref:2611.14582#pg10>. The combination of properties is not merely aesthetic because the covariance matrix C absorbs the units and correlations, allowing for native treatment of heterogeneous photometry without imputation<ref:2611.14582#pg4>.

The paper is 2611.14582. Every sentence must end with a reference token. p. 6

Where the paper says it

031 at z ≈ 1. A fourth, independent feature stands out at the highredshift end: the u-band cell at z ≈ 1.

The token names the page and quotes the words from that page, copied word for word. p. 0
Where the paper says it

Its importance stems from its probabilistic output and its long-standing validation at faint magnitudes with filter sets similar to those of current and near-future surveys. BPZ has been adopted in major survey analyses and remains a standard template-fitting refArticle number, page 1 of 14 arXiv:2611.

Write the token BARE, with no backticks around it

MAHA-z presents a photometric-redshift (photo-z) estimator that combines k-nearest neighbour (kNN) regression with a Mahalanobis distance metric learned from the covariance of a spectroscopic reference sample, making it a practical option for iterative photo-z production and validation in Stage-IV surveys<ref:2611.14582#pg2>.

The feature vector for each galaxy is defined as f = m1,..., mNb, c1,..., cNc, µ1,..., (3)<ref:2611.14582#pg4>. The covariance matrix C used by the Mahalanobis metric is estimated from the spectroscopic training sample<ref:2611.14582#pg5>.

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Adaptive Kernel Bandwidth Selection: The AI system can select kernel bandwidth ha adaptively per galaxy using a formula like ha = max(h alpha 1 + z a) / min(h min), which is derived from the paper to optimize the posterior p(z f).

  2. Mahalanobis Distance Metric Implementation: The system can use a Mahalanobis metric where the covariance matrix C is estimated from a spectroscopic training sample, including photometric error variance on the diagonal and optionally shrinking it via Ledoit-Wolf estimator.

  3. Subspace Covariance Handling: The AI can natively handle heterogeneous photometry by using the sub-covariance Cm = C[m, m] to compute squared Mahalanobis distance in any subset of features without needing imputation or fixed input dimensionality.

  4. Feature Space Definition: The system can process feature vectors f = m1,..., mNb, c1,..., cNc, µ1,..., µNm where mi are magnitudes and the color configurations (all pairwise colors or adjacent/reference) are chosen based on the specific survey data.

  5. Multi-modal Posterior Interpretation: The AI system can analyze the posterior p(z f) to quantify the number of modes, defining it as the number of local maxima whose prominence exceeds 5% of the peak density.

Abstract

We present MAHA-z, a photometric-redshift (photo- z) estimator that combines k-nearest neighbour (k NN) regression with a Mahalanobis distance metric learned from the covariance of a spectroscopic reference sample. For each target galaxy, MAHA-z performs a neighbour search in a colour-magnitude feature space with optional morphological parameters, and returns both a point estimate and a redshift posterior p(z f) obtained by kernel density estimation over the neighbour redshifts. The Mahalanobis metric accounts for correlated features and heterogeneous units, eliminating ad hoc normalisation, and its subspace restriction allows MAHA-z to handle missing bands on a per-galaxy basis without imputation. We validate the method on four datasets spanning simulations and survey photometry: the Euclid Flagship 2 mock, the Legacy-KiDZ calibration sample, VIPERS, and the DES Year 3 BAO sample. On Euclid Flagship 2 (LSST+NISP) we achieve σ NMAD=0.0148 with a 0.27% outlier fraction, and on DES Y3 we obtain σ NMAD about0.023 with <1% outliers and posterior calibration comparable to the ANNz2 catalogue. MAHA-z processes millions of galaxies in minutes and provides competitive PDFs at substantially lower computational cost than trained machine-learning models, making it a practical option for iterative photo- z production and validation in Stage-IV surveys.

Related papers