This study examines the determinants of inventory investment under joint production. We simultaneously estimate a set of optimal sales relations, variable input demands, and a set of Euler equations for capital and inventories of raw materials, work in process, and final products in the petroleum refining industry. The Euler conditions provide a model for the convenience yield discussed in the returns-to-storage literature. The cost savings from holding inventories and expected changes in marginal production costs are important components of the convenience yield. We also find significant cost and stock interactions that may affect short-run price and inventory dynamics in petroleum product markets.