Calculating RMSE / R-squared / forecast error metrics through SQL BigQuery

Viewed 155

I'm having trouble trying to figure out how to evaluate different set of forecast values using GoogleSQL.

I have a table as follows:

date      |   country   |   actual_revenue   |   forecast_rev_1 |    forecast_rev_2   |
---------------------------------------------------------------------------------------
x/x/xxxx     ABC            134644.64            153557.44            103224.35
. 
. 
.

The table is partitioned by date and country, and consists of 60 days worth of actual revenue and forecast revenue from different forecast modelling configurations.

3 questions here:

  1. Is calculating R-squared / Root Means Square Error (RMSE) the best way to evaluate model accuracy in SQL?

  2. If Yes to #1, do I calculate the R-squared/ RMSE for each row, and take the average value of them?

  3. Is there some sort of GoogleSQL functionality/better optimized ways of doing this?

Not quite sure about the best way on doing this as I'm not familiar with the statistics territory.

Appreciate any guidance here Thank you!

0 Answers
Related