JuliaDynamics / TransitionsInTimeseries.jl

Transition Indicators / Early Warning Signals / Regime Shifts / Change Point Detection
MIT License
18 stars 5 forks source link

RidgeRegression is clunky to use in new interface #26

Closed Datseris closed 1 year ago

Datseris commented 1 year ago

In our new interface we do:

indicators = [var, ar1_whitenoise]
ind_conf = IndicatorsConfig(indicators;
    width = 400
)
# use spearman correlation for both indicators
change_metric = spearman
sig_conf = SignificanceConfig(change_metric;
    width = 20, n_surrogates = 10_000,
    surrogate_method = RandomFourier(),
)

# perform the full analysis
result = indicators_analysis(input, ind_conf, sig_conf)

Using the new RidgeRegression in this new interface is super clunky because we need to deduce both the time vector, and the width of the final change metric timeseries, which the user does not. The user only picks the window. We need to have an internal step where we initialize a RidgeRegression with 0 arguments, and once the function indicators_analysis starts, it optimizes the computation once at the start and then re-uses the type later on.