There is chaotic characteristics in ship motion under certain conditions, so the chaotic diagonal recurrent neural network(CDRNN) is proposed to predict ship swaying motion. A convergence theorem of each weight learn algorithm based on Lyapunov function is given and proofed. Simulation results show that, the value of the optimized sampling time ?? is applied to increase the accuracy of all of the weight, which improves algorithm convergence, and the predicted precision and the forecast time are advanced efficiently. The optimized modeling has better predictive effect using CDRNN than using feed-forward BP neural network to predict.