Spy4Cast v1.0: a Python Tool for statistical seasonal forecast based on Maximum Covariance Analysis
Abstract. Maximum Covariance Analysis (MCA) is a well known discriminant analysis technique used for finding coupled patterns in climate data. This is a powerful tool that has been applied to the study of teleconnections, by reducing all possible relationships between a predictor and a predictand field to a few modes of covariability patterns. MCA can be used to provide statistical forecasts, which can complement predictions performed with dynamical models. Nevertheless, the power of this tool relies on its application in a productive and easy way, as it can be applied to the huge climate data-sets available. Spy4Cast is an open-source interface (API), implemented in Python, that contains a MCA-based statistical model to be used for seasonal forecast. Its main goal is to increase automation and productivity. Spy4Cast enables large data-set manipulation and also performs basic tasks like region slicing and plotting. The methodology consists on an initial configuration (data-set reading and slicing) and preprocessing that prepares the data to be fed into MCA, crossvalidation and validation. It acts upon any kind of predictor and predicting variables that can come from any source of data. Spy4Cast analyses the model sensitivity to particular years, including a diagnosis of the stability of the obtained modes to particular outliers. Finally, the spatial and temporal skill, in terms of anomaly correlation coefficient is obtained and a hindcast is provided. The software is easily accessible through a python package and well documented for beginners and experienced programmers. Only a reduced number of third-party libraries are needed, and they are those widely used in data-science and physics.