# How error affects maximum detection?

I have a discrete function $$f$$ which lies over a certain domain $$X$$. My goal is to find the value of $$X$$, $$x_{max}$$, for which the function is maximum. I have opted for a simply search: using numpy python library, I have simply searched the argmax of the function, i.e. I found idx=numpy.argmax(f); x_max=f[idx]. Things work well. But, since the function is known with uncertainties, I'm wondering what is the method with which I can propagate errors of $$f$$ on $$x_{max}$$.

EDIT Follow @whuber suggestion, I will add some information about the funtion $$f$$ and its uncertainties. My function is computed from observed data. I started with the observed spectrum, i.e. the flux measured for each frequency within a range (~4000 - 8000 Angstron). Since these fluxes are measured, I have an error for each flux. Fluxes and their errors are provided by the instrument. Then, I take a spectra template, it is a model of how the flux varying along a wavelength range. I assume for this template no errors. I map the template at various redshift ($$z$$). This is a simple process, based on which I moved the wavelength by a factor $$1+z$$ for $$z \in [z_{min}, z_{max}]$$. The redshift range is imposed as hyperparameter, together with the sampling in $$z$$, i.e. the number of $$z$$ point in the $$z$$-range. Finally, I cross-correlate my observed spectra with each template mapped at different $$z$$, finding a cross-correlation function, i.e. the cross-correlation value estimated for each $$z$$. Finding the maximum value, I get the redshift. This is a common and widely-used process. Indeed it works well.

Finally, since the observed data have errors, I have propagated these errors through the cross-correlation process, computing the various derivatives and obtaining uncertainties on $$f$$ for each $$z$$. Thus, my question is: how can I deduce the error on $$z$$, knowing the error on $$f$$? Hoping that this can clarify my problem.

• Could you explain what you mean by a "discrete" function? – whuber Mar 23 at 15:13
• @whuber : My function is digitized, i.e. I don't know what is its analytic form, I have a value of f, for each x. Is it clear? – Giuseppe Angora Mar 23 at 15:15
• Not really. What does "digitized" mean? Rounded to some very coarse unit? If so, could you explain what "known with uncertainties" means? Does it mean, for instance, that a "noisy" version of $f$ is rounded or perhaps it means the rounded version of $f$ is randomly altered to another rounded value? – whuber Mar 23 at 15:19
• @whuber Ok It's clear that I was not able to explain my self. I simply meant that I have a function, computed from data. So each each point of this function has an error. – Giuseppe Angora Mar 24 at 10:17
• The answer, then, depends on (a) how the function was computed and (b) what you assume about the nature of the error. For some indication of how such problems are approached and what you need to assume, see (for example) stats.stackexchange.com/a/446205/919 (about finding zeros of a function, which is a similar problem) and stats.stackexchange.com/a/370201/919 (which is about testing whether a point is an extremum of a function--a procedure that has evident application to your kind of problem). Maybe they will help you provide more specific information. – whuber Mar 24 at 14:03