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.