In this work, a new hybrid algorithm for modelling time series of daily and monthly wind speed is proposed. The method utilizes Hodrick-Prescott Filter (HPF) to decompose raw wind speed data into trend and cyclic components, and harmonic analysis (HA) is thereafter used to decompose the cyclic component into the periodic and stochastic sub-components. Machine learning (ML) methods are then used to model the time series of both the trend and stochastic components. The predicted wind speeds are finally summed from the individual predictions of the ML methods and harmonic analyses. To highlight the considerably higher predictive accuracy that results from the introduced data pre-treatments with HPF and HA, the proposed hybrid algorithm is compared against the traditional ML methods that are not subjected to the pre-treatments. The proposed hybrid algorithms are highly accurate relative to the traditional ML methods reflecting much higher coefficients of determination and correlation coefficients, and much lower error indices. Artificial neural networks (ANNs), linear regression with interactions (LRI), support vector machine (SVM), rational quadratic Gaussian process regression (RQGPR), fine regression trees (FRTs) and boosted ensembles of trees (BETs) are used as the illustrative machine learning methods. To guarantee both versatility and robustness, the methods are tested on example data drawn from both temperate and tropical conditions.