Working with Time Series Regression Models for Demand Forecasting, I realized that an alternate use of the “*Most Accurate Model*” deployed for the same can be used to evaluate relationship between features that goes into the model as input also.

The core idea of this blog post is to highlight that a deployed time series model can also be used to evaluate the feature relationships and its impacts on the target (*Sales Quantity, Demand*).

We have a model, with its feature impact as follows:

Using the above concept I developed a tool (using Streamlit) which has a good uptake in the business to evaluate the price elasticity of a product based on the seasonality and other input features to the model for “*Promotion Design*“, “*Price Optimization*” and other buying activities.

As we know, in order to produce a time series forecast we need to provide an actual set of data to the trained model in order to compute the derived features and few “*known-in-advance*” features, post which the model provides us the forecasted values.

So the idea was that, If users can tweak on-demand the input data set used for producing the forecast then they can easily evaluate the impact on the target.

Leading to the following app:

In the above the user can input the following:

- Product of their choice
- Store selling the product
- Simulation Price (initially populated with the current selling price)

And then once the user hits the “*Simulate*” the app, prepares the data block using the price value input as “*Known in Advance*” feature and produces the forecasted demand by the backend model rendered on the UI in the form of Chart/Table.

Using the above tool some interesting results for the price-demand simulated results are obtained:

Notes from above:

- As the price rises above from original selling price, the demand (Sales Quantity) impact is not substantial, i.e. the product sales will hold to an extent even if the price is raised (product is an essential food item)
- As we start lowering the prices the demand will jump substantially as for a great offer, customers will buy more (in order to stock the product at a great price)
- So considering the above grid for a Store-Item combination business is in better position to decide the price adjustment, to drive sales with optimal revenue

The above methodology is also great because the model is not just accounting for price change learned over time during training, but also reflecting the impact of the following on the target (Sales Quantity)

- Weather data
- Stock at store
- Previous day/week/month sales
- Seasonality
- Macro data
- More … based on your model input chosen during demand

So to summarize, Price-elasticity is not a static measure in fast moving market and it changes over time incorporating multiple market factors, so the normal formula is not able to reflect the true picture.

Hence techniques like above can greatly yield value to the decision making.

Happy computing, and look forward to share thoughts and experiences with readers.