pyhctsa.operations.model_fit.loop_local_simple

pyhctsa.operations.model_fit.loop_local_simple(y, forecast_meth='mean')

How simple local forecasting depends on window length.

Analyzes the outputs of local_simple for a range of local window lengths, l. Loops over the length of the data to use for local_simple prediction.

Parameters:
y : array-like

The input time series.

forecast_meth : str, optional

The prediction method:

  • ’mean’: local mean prediction, with window lengths 1, 2, …, 10

  • ’median’: local median prediction, with window lengths 1, 3, …, 19

Default is 'mean'.

Returns:

Dictionary containing statistics about how forecasting performance varies with window length: for each of the residual standard deviation (stde), sws, swm, ac1 and ac2, the normalized mean change (_chn), the mean sign of the changes (_meansgndiff) and, for the last four, _stdn; sws_fexp_b (the rate of an exponential fit a*exp(b*l) + c to the sws curve: negative for a decay with training length), sws_fexp_r2 (between 0 and 1), sws_fexp_adjr2 and sws_fexp_rmse of that fit. The fit is the global least-squares optimum over b, with a and c found by linear least squares (pyhctsa.robust.bf_exp_fit()); a and c are not output because they are poorly determined when the curve is close to a straight line. The four sws_fexp_* outputs are NaN if the sws curve is constant. stde_peakpos (1-based position in the list of window lengths of the extreme value of the stde curve) and stde_peaksize.

Return type:

dict