# Estimating the min and max of a distribution

I have a measurement problem where I am attempting to measure the minimum and maximum height of a surface by taking point samples of heights. If I then look at the distribution of all height values, I would expect to have two sources of error relative to the mean surface. The first error is the surface variation, which I want to measure. The second error is measurement error, which is unwanted.

Currently I'm estimating the minimum and maximum by looking at the minimum and maximum of the samples, but intuitively it seems that these estimates will estimate outer bounds rather than be a good estimate of the true surface variation.

Suppose I don't have a model for how the true surface varies, but I expect the measurement error to be normally distributed; let's also assume that I can measure the standard deviation of the measurement error in isolation. Given the above, is there a robust way to estimate the true minimum and maximum of the surface variation?

My intuitive sense is that I could somehow derive an 'expected max measurement error' based on the number of samples and use that to modify the max/min to pull them in, but I'm not sure where to start on the math.

For observations $$Y_i$$ measured at location $$x_i$$ you could try using a Gaussian Process to model this by:
\begin{align*} Y_i &= \delta(x_i) + \epsilon_i \\ \epsilon_i &\stackrel{iid}{\sim} N(0, \sigma^2) \\ \delta(x) &\sim GP(\mu, \Sigma) \end{align*}
You will deal with lack of identifiability, but if you are able to estimate $$\sigma^2$$ independently (or assign an informative prior if want to be Bayesian), then you should be able to estimate the parameters of the GP. From here, you can easily extract the range of $$\delta(x)$$ with uncertainty! (Note: The GP_fit package in R can fit this model for you)