trs function

Resample time series by summary statistics