In this paper, we introduce a new model to estimate efficiency by generalizing the state-of-the-art panel stochastic frontier model, the salient feature of which is decomposition of inefficiency into a persistent and a transient component. The proposed model introduces an autoregressive process to allow for temporal dependence in transient inefficiency. Both firm heterogeneity and persistent inefficiency components are allowed to be correlated with some exogenous and endogenous covariates in the model. Our model solves the endogeneity problem and it also introduces determinants of both persistent and transient inefficiency. Since the transient component is autoregressive, the likelihood function is not available in closed form. To address this problem we use the Maximum Simulated Likelihood and (Simulated or Bayes) Generalized Method of Moments method to estimate the parameters and several other quantities of interest, including transient and persistent inefficiency. Since the model is dynamic and accommodates determinants of inefficiency, it is useful to production managers who wish to identify how much of their present inefficiency is affected by past inefficiency, as well as how and in what ways efficiency can be improved. We use Norwegian electricity distribution data to showcase an application of our model.