Confidence and Prediction Interval

In Machine Learning, we often come across the terms – Confidence and Prediction intervals.  Both of these represent two different important concepts while interpreting the statistical results. Recently,  I came across to these terms while playing with linear predictive models. Therefore, my explanation of terms will be in sync with these models. In modelling, we use known values (predictive variables) to predict the unknown value (target variable). Here, I won’t go for mathematical representation.
Confidence Interval (CI): CI represents the range of values specified by a lower and a higher bound. CI means that it contains X% of the true values of unknown variable, Y. For example, a 95% confidence interval means that it will contain 95% of true values  of Y. In other words, there is a 0.95 probability that the values this range contains are the true values ofY. To be specific, CI is always related to  average/mean value of a variable. Therefore, whenever we calculate CI for an unknown variable we always estimate the mean value of a variable and not the exact individual value of a variable.
Prediction Interval (PI): The X% of PI is interpreted in the same manner as that of CI. The only difference is that it does not represent the mean value of an unknown variable, but it shows the individual values of a variable. This means that PI should be wider than CI and both PI and CI should be aligned to same central point/plane. In fact, the former statement is true and the central plane/point is commonly known as regression plane.



  1. Book – An introduction to statistical Learning by Hastie, Tibshirani et al. Page # 82.

RStudio Console Output Redirection

In RStudio Console, most times we need to execute some commands a number of times for testing purposes. All though it serves the purpose of tracing a bug or refining the output, but still printing the output on the same console window makes it congested. To keep the console window clean, a R package “rite” creates a separate window for output. Moreover, you can move this window to another monitor as well. Although it provides various options, but for a minimal purpose you can start with this as

  1. Install package –   install.packages(“rite”)
  2. Load the package
  3. Start a separate window as – sinkstart ()
  4. Stop  this window as – sinkstop()