class: center, middle, inverse, title-slide # What can go wrong with prediction? ### Dr. D’Agostino McGowan --- layout: true <div class="my-footer"> <span> Dr. Lucy D'Agostino McGowan </span> </div> --- ## What can go wrong? * Bad model. -- * Quantitative extrapolation. -- * Qualitative extrapolation. -- * Overconfidence due to overfitting. -- * Black swans. --- ## Bad Model ![](14-what-can-go-wrong_files/figure-html/unnamed-chunk-2-1.png)<!-- --> --- ## Quantitative extrapolation ![](14-what-can-go-wrong_files/figure-html/unnamed-chunk-3-1.png)<!-- --> --- ## Quantitative extrapolation |term | estimate| std.error| statistic| p.value| |:-----------|---------:|---------:|---------:|---------:| |(Intercept) | 0.0567150| 0.1176555| 0.482043| 0.6308613| |x | 1.0114406| 0.0719885| 14.050037| 0.0000000| |I(x^2) | 0.9471461| 0.0376736| 25.140814| 0.0000000| -- .question[ What would the predicted value be when x = 10? ] -- ```r x0 <- c(1, 10, 10^2) beta_hat <- c(0.056, 1.01, 0.95) t(x0) %*% beta_hat ``` ``` ## [,1] ## [1,] 105.156 ``` --- ## Quantitative extrapolation ![](14-what-can-go-wrong_files/figure-html/unnamed-chunk-6-1.png)<!-- --> --- ## Qualitative extrapolation * Trying to predict outcomes for observations that come from a different population ![](img/14/heart.png) --- ## Overconfidence due to overfitting ![](14-what-can-go-wrong_files/figure-html/unnamed-chunk-7-1.png)<!-- --> --- ## Black Swan events * Sometimes errors can appear to be normally distributed because you haven’t seen enough data to be aware of extremes * This is of particular concern in **financial applications** where stock prices are characterized by mostly small changes (normally distributed) but with infrequent large changes