CSDownscale
===============
CSDownscale is intended for downscaling climate predictions. So far, only purely statistical methods are included. The downscaling can be performed either to a grid of different spatial resolution or to a point location.


Overview
--------

The following downscaling methods are included in CSDownscale:

- **Interpolation** : Included in Interpolation(). Regrid of a coarse-scale grid into a fine-scale grid, or interpolate model data into a point location. Different interpolation methods, based on different mathematical approaches, can be applied: conservative, nearest neighbour, bilinear or bicubic. Does not rely on any data for training.

- **Interpolation plus bias adjustment** : Included in Intbc(). interpolate model data into a fine-scale grid or point location. Later, a bias adjustment of the interpolated values is performed. Bias adjustment techniques include simple bias correction, calibration or quantile mapping. 

- **Interpolation plus linear regression** : Included in Intlr(..., method = 'basic'). Firstly, model data is interpolated into a fine-scale grid or point location. Later, a linear-regression with the interpolated values is fitted using high-res observations as predictands, and then applied with model data to correct the interpolated values. 

- **Interpolation with large-scale predictors** : Included in Intlr(..., method = 'large-scale'). Firstly, model data is interpolated into a fine-scale grid or point location. Later, a linear-regression with large-scale predictors from the same model (e.g. teleconnection indices) is fitted using high-res observations as predictands. Finally, the linear-regression is applied with model data to correct the interpolated values.

- **Stencil** : Included in Intlr(..., method = '4nn'). Firstly, model data is interpolated into a fine-scale grid or point location. Later, a linear-regression with the four nearest neighbours is fitted using high-res observations as predictands, and then applied with model data to correct the interpolated values. 

- **Analogs** : Included in Analogs(). A Perfect Prognosis (PP) method based on the popular analog technique, which inferes the downscaled forecast from a set of analog situations selected from daily historical observational data. The search of the analogous fields is performed using the Euclidean distance, which estimates the similarity between large-scale forecast fields and their counterparts from historical reanalysis data. This approach is also known outside the climate community as an implementation of the k-nearest neighbours (K-NNs) algorithm (James 2021), considering each grid point as a feature and getting a multioutput.

- **Logistic regression** : Included in LogisticReg(). this method uses a sigmoid function to relate ensemble mean anomalies of the large-scale forecasts directly to probabilities of observing above normal/normal/below normal conditions at the local scale. Therefore, it does not produce an ensemble of forecasts but rather their associated probabilities. It is a statistical method with few parameters to train, and only benefits from local information, but it has shown good performance.




