Functions to use in stock price prediction