FTestTutorial.pdf - Using the F-test to Compare Two Models...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Using the F-test to Compare Two Models When fitting data using nonlinear regression there are often times when one must choose between two models that both appear to fit the data well. After plotting the residuals of each model and looking at the r 2 values for each model, both models may appear to fit the data. In this case, an F-test can be conducted to see which model is statistically better 1 . It gives a definitive answer and does not rely on arbitrary interpretation of an r 2 value or residual plot. An F-test follows an F-distribution and can be used to compare statistical models. The F-statistic is computed using one of two equations depending on the number of parameters in the models. If both models have the same number of parameters, the formula for the F statistic is F=SS 1 /SS 2 , where SS 1 is the residual sum of squares for the first model and SS 2 is the residual sum of squares for the second model. There are N - V degrees of freedom, where N is the number of data points and V is the number of parameters being estimated (one degree of freedom is lost per parameter estimated). The result- ing F statistic can then be compared to an F-table to extract the p-value. Alternatively, the p-value can be computed using MATLAB’s built in function ‘fcdf’. To do this simply type P=1-fdcf(F,df 1 ,df 2 ), where F is the computed F-statistic, and df 1 and df 2 are the degrees of freedom of each model equation. If the p-value is large (greater than α ) then the first model is statistically better than the second. If the p-value is small (less than 1- α ) then the second model is statistically better than the first. If the models have different numbers of parameters, the formula becomes: F = ( SS 1 - SS 2 ) / ( df 1 - df 2 ) SS 2 /df 2 The sum of squares for each model and the degrees of freedom for each model are calculated as before (note the models will have different degrees of freedom for this case). Additionally, the first model must be the one with fewer parameters (i.e. the simpler one). Once again, the F-statistic and degrees of freedom can be used to determine the p-value. Use df 1 -df 2 and df 2 degrees of freedom when finding the p-value. In this case a p-value less than α indicates that the more complex model (denominator of F-statistic) fits the data significantly better than the simpler model. 1 Note that the F-test tells you nothing about the physical significance of the model. It is ok to pick a model that does not fit the data as well if it has physical meaning. However, for illustration purposes the following assumes you do not know the physical laws governing the process.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern