I am trying compute a metric with panda dataframes. In particular, I get a results object
prediction = results.predict(start=1,end=len(test),exog=test)
The actual values are in a dataframe given by
test['actual'].
I need to compute two things:
How can I compute the sum of squares of errors? So basically, I would be doing an element by element subtraction and then summing the squares of these.
How can I compute the sum of squares of the predicted minus the mean of the actual values? So it would be
(x1-mean_actual)^2 + (x2-mean_actual)^2...+(xn-mean_actual)^2