Marginal utility functions (MUFs) encapsulate the prosumer willingness to trade energy with other market agents. In large-scale distributed optimization schemes scalability and convergence are crucial, and the assumption of linear MUFs is common. In this work, instead of assuming the shape and coefficients of those functions, a method is proposed to derive them based on the optimization of a prosumer's energy procurement problem. We formulate a rolling-horizon optimization problem that considers asset characteristics and network tariffs, and we utilize forecasts to capture the effects of uncertainty. We use this formulation to calculate the true prosumer MUF. A test case with real data is used to investigate the shape of these functions. Our results reveal that they present a non-linear shape under certain conditions, they cannot be a priori derived, and their form is sensitive to a variety of factors. This indicates that MUFs should be constructed based on an approach similar to the one proposed in this paper to more accurately capture the prosumer's true willingness to trade. A linearized version of these functions, which is computationally attractive and scalable, can be determined using a least-squares estimator that achieves the best fit to the prosumer's preferences under a linearity constraint.