A generalized model for financial time series representation and prediction