find.valid.periods function

Find subsequent periods in a vector with values below a threshold. Used internally by the function suggest_threshold