Algorithm For Compressing Time Series Data