View source: R/model_evaluation.R
estimate_effect_size | R Documentation |
Calculates an estimate for the absolute and relative effect size of the external effect. The absolute effect is the difference between the model bias in the reference time and the effect time windows. The relative effect is the absolute effect divided by the mean true value in the reference window.
estimate_effect_size(df, date_effect_start, buffer = 0, verbose = FALSE)
df |
Data.table or data.frame with the following columns
|
date_effect_start |
A date. Start date of the effect that is to be evaluated. The data from this point onward is disregarded for calculating model performance. |
buffer |
Integer. An additional buffer window before date_effect_start to account for uncertainty in the effect start point. Disregards additional buffer data points for model evaluation |
verbose |
Prints an explanation of the results if TRUE |
Note: Since the bias is of the model is an average over predictions and true values, it is important, that the effect window is specified correctly. Imagine a scenario like a fire which strongly affects the outcome for one hour and is gone the next hour. If we use a two week effect window, the estimated effect will be 14*24=336 times smaller compared to using a 1-hour effect window. Generally, we advise against studying very short effects (single hour or single day). The variability of results will be too large to learn anything meaningful.
A list with two numbers: Absolute and relative estimated effect size.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.