This paper proposes a flexible time-varying stochastic frontier model. Similarly to Lee and Schmidt [1993, In: Fried H, Lovell CAK, Schmidt S (eds) The measurement of productive efficiency: techniques and applications. Oxford University Press, Oxford], we assume that individual firms’ technical inefficiencies vary over time. However, the model, which we call the “multiple time-varying individual effects” model, is more general in that it allows multiple factors determining firm-specific time-varying technical inefficiencies. This allows the temporal pattern of inefficiency to vary over firms. The number of such factors can be consistently estimated. The model is applied to data on Indonesian rice farms, and the changes in the efficiency rankings of farms over time demonstrate the model’s flexibility.