Predictors are something that can be created separately from this package if desired, however, for convenience we provide a sample set of predictors as well as some convenience methods for creating new ones.

The sample set of predictors can be loaded in with

import matplotlib.pyplot as plt
import LOTUS_regression.predictors as predictors

pred = predictors.load_data('pred_baseline_pwlt.csv')

                enso     solar      qboA      qboB       aod  linear_pre  \
1979-01-01  0.534698  1.578955 -1.067789  0.952231 -0.411760   -1.800000
1979-02-01  0.351147  1.633527 -0.831698  0.892204 -0.412330   -1.791667
1979-03-01  0.004440  1.318208 -1.168007  0.628544 -0.413462   -1.783333
1979-04-01  0.269569  1.129935 -1.229261  0.561389 -0.416360   -1.775000
1979-05-01  0.330752  1.002783 -1.226434  0.052783 -0.420368   -1.766667

            linear_post  constant
1979-01-01          0.0       1.0
1979-02-01          0.0       1.0
1979-03-01          0.0       1.0
1979-04-01          0.0       1.0
1979-05-01          0.0       1.0

The sample set contains

* ENSO from
* Three orthogonal components of the QBO from calculated with PCA
* Solar f10.7 from
* Piecewise linear terms with an inflection at 1997 that are expressed in per decade
* GloSSAC AOD from

These predictors (with the exception of the linear terms) have been scaled to have mean 0 with standard deviation of 1. Each predictor begins in 1978 and ends at 2023-09. A constant is also included by default.


Three other baseline predictor files are included, pred_baseline_eesc.csv, pred_baseline_ilt.csv, pred_baseline_ilt_continuous.csv. Predictors are similar between the four files with the exception of the linear terms.

pred_baseline_eesc.csv contains two orthogonal components of the EESC calculated using principal component analysis for different mean ages of air instead of the piecewise linear term.

pred_baseline_ilt.csv also contains two linear terms, the first is the “pre” term ending at 1997-01-01, and the second is the “post” term beginning at 2000-01-01. The difference is that multiple constant terms are included which allow the two time periods to be essentially independent of each other. This is in contrast with the PWLT predictors which force a common value at 1997

pred_baseline_ilt_continuous.csv is a modification of the previous ILT terms where continuity is enforced at the start of the pre period (1997-01-01) and the start of the post period (2000-01-01). This is done by modifying the pre and post constants to include a linear variation within the gap period.

Functions are also provided to download each individual predictor from its respective source

import as download

enso = download.load_enso()

enso.plot(figsize=(18, 5))

One final tool included is the ability to create predictors modulated by seasonal components. This is useful if you are regressing to data that has not been deseasonalized.

from LOTUS_regression.predictors.seasonal import add_seasonal_components

const_with_seasons = add_seasonal_components(pred, {'constant': 4})

const_with_seasons.plot(figsize=(18, 5))

Extra Predictors

Some additional predictors are included for testing purposes, these currently are tropopause pressure and the GISS AOD. The additional predictors can be loaded in with

extra_predictors = predictors.load_data('pred_extra.csv')

and used to modify the standard predictors. E.g., we can change the GloSSAC AOD to the GISS AOD with

pred['aod'] = extra_predictors['giss_aod']