Purpose: The purpose of this study was to predict patient respiratory waveform precisely and quickly using a Moving Least Square method. The external respiratory waveform may have a strong correlation with tumor motion in lung and upper abdomen. Prediction is important because tumor may move significantly during the finite time between monitored position change and beam adjustment. Method and Materials: An adaptive linear filter based on the Moving Least Square (MLS) algorithm was used to predict the respiratory waveform signals for six 4D CT patients. The respiratory waveform was acquired with a bellows system at a sampling frequency of 100 Hz or a sampling period of 10 ms. To predict one datum in the future (10 samples or 100 ms away), 10 s history data (1000 samples) were fed to the linear filter to calculate its coefficients with the MLS algorithm. The output of the linear filter was the predicted value. The predicted values were compared to the real data recorded. We also calculated the Root Mean Square Error (RMSE) of the prediction for each patient and normalized it with the average waveform amplitude. The accuracy of MLS method was compared with that of Wiener‐Hopf method in the normalized RMSE values. Results: For a 100 ms prediction interval, the average prediction RMSE for the 6 patients was 2.1%, with a standard derivation of 0.7%. The computation time for predicting one datum with MLS method was 0.5 ms, which is far less than the sampling period (10 ms). This MLS method shows smaller normalized RMSEs than the Wiener‐Hopf method for all 6 patients. Conclusion: The prediction of patient respiratory waveform using MLS method is both accurate and fast. Real time prediction of respiratory waveform and tumor motion is possible.