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:¶
- Returns:¶
Dictionary containing statistics about how forecasting performance varies with window length: for each of the residual standard deviation (
stde),sws,swm,ac1andac2, 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 theswscurve: negative for a decay with training length),sws_fexp_r2(between 0 and 1),sws_fexp_adjr2andsws_fexp_rmseof 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 foursws_fexp_*outputs are NaN if theswscurve is constant.stde_minposis the window length that forecasts best: the 1-based position, in the list of window lengths, of the smallest residual standard deviation (the first, if tied). It is 1 when the last value is the best predictor of the next (e.g. a random walk), the last position when a long average is (e.g. white noise), and in between for a smooth signal in noise.stde_minsizeis that smallest residual standard deviation divided by the mean over window lengths (at most 1; near 1 if the window length makes little difference). Both are NaN if the series is too short for the longest window.- Return type:¶
dict