Econometric mathematical programming: an application to the estimation of costs and risk preferences at farm level