A novel data-driven approach for remaining useful life (RUL) prognostics for lithium-ion batteries using an improved autoregressive (AR) model by particle swarm optimization (PSO) is proposed. First, the AR model based on the capacity fade trends of lithium-ion batteries is presented. Second, the shortcomings of the traditional criteria for AR model order determination are analyzed. Third, the root mean square error (RMSE) is proposed as the new method for AR model order determination. Then, we use PSO algorithm to search the optimal AR model order. In addition, at the prediction stage, the information contained in the data is updated through metabolism which makes the AR model order change adaptively. Finally, the experimental data are used to validate the proposed prognostic approach. The experimental results show the following: (1) the proposed prognostic approach can predict the RUL of batteries with small error; (2) the proposed prognostic approach can be employed in on-board applications.