In this paper we derive both primal and dual-cost systems in which the stochastic specifications arise from the model (random environment or measurement errors and optimization errors)?not tacked on at the end after the deterministic system is worked out. Derivation of the error structures is based on cost-minimizing behavior on the firms. The primal systems constitute the production function and the first-order conditions of cost minimization. We consider two dual-cost systems. The first dual system is based on the cost function and cost share equations. The second dual system is based on a multiplicative general error production model that is an alternative to McElroy's additive general error production model. Our multiplicative general error model gives a clear and intuitive economic meaning to the error components. The resulting cost system is easy to estimate compared to the alternative cost systems. The error components in the multiplicative general error model can capture heterogeneity in the technology parameters even in a cross-sectional model. Panel data are not necessary to estimate either the primal or dual systems. The models are estimated using data on 72 fossil fuel-fired steam electric power generation plants (observed for the period 1986-1999) in the USA.