We present two approaches to invert geophysical measurements and estimate subsurface properties and their uncertainties when little is known a priori about the size of the errors associated with the data. We illustrate these approaches by inverting first-arrival traveltimes of seismic waves measured in a vertical well to infer the variation of compressional slowness in depth. First, we describe a Bayesian formulation based on probability distributions that define prior knowledge about the slowness and the data errors. We use an empirical Bayes approach, where hyperparameters are not well known ahead of time (e.g., the variance of the data errors) and are estimated from their most probable value, given the data. The second approach is a non-Bayesian formulation that we call spectral, in the sense that it uses the power spectral density of the traveltime data to constrain the inversion (e.g., to estimate the variance of the data errors). In the spectral approach, we vary assumptions made about the characteristics of the slowness signal and evaluate the resulting slowness estimates and their uncertainties. This approach is computationally simple and starts from a few assumptions. These assumptions can be checked during the analysis. On the other hand, it requires evenly spaced traveltime measurements, and it cannot be extended easily (e.g., to data that have gaps). In contrast, the Bayesian framework is based on a general theory that can be generalized immediately, but it is more involved computationally. Despite the conceptual and practical differences, we find that the two approaches give the same results when they start from the same assumptions: The allegiance to a Bayesian or non-Bayesian formulation matters less than what one is willing to assume when solving the inverse problem.