fitting_a_model

This shows you the differences between two versions of the page.

Both sides previous revision Previous revision | |||

fitting_a_model [2016/11/28 15:42] vincenzo |
fitting_a_model [2016/11/28 15:43] (current) vincenzo |
||
---|---|---|---|

Line 136: | Line 136: | ||

</code> | </code> | ||

- | Let's try to add some other covariates - interaction terms between time bins and day. To evaluate the model we could check the R squared and RMSE. The R squared is not a very good measure since one can always artificially inflate it (R squared is how much of the variance is explained) by adding extra covariates. We can rely on the **RMSE** which makes a good general purpose error metric for numerical predictions. In this case, we can simply call summary(model)$ sigma for printing the metric. In the second model, the error is in fact smaller (0.9463 vs. 0.9433) | + | Let's try to add some other covariates - interaction terms between time bins and day. To evaluate the model we could check the R squared and RMSE. The R squared is not a very good measure since one can always artificially inflate it (R squared is how much of the variance is explained) by adding extra covariates. We can rely on the **RMSE** which makes a good general purpose error metric for numerical predictions. In this case, we can simply print the metric. In the second model, the error is in fact smaller (0.9463 vs. 0.9433) |

<code python> | <code python> |

fitting_a_model.txt ยท Last modified: 2016/11/28 15:43 by vincenzo