top of page
  • LinkedIn
  • Instagram
  • Facebook
  • Twitter

What is the Goodness of Fit in the Linear Model?

  • patilpramod6396
  • Jun 14, 2021
  • 2 min read

Linear regression tries to fit the line In a way that the distance between the fitted line and actual data point is minimized.

We can fit the line with the help of ordinary least squares (OLS) which minimizes the sum of the squared residuals (residuals means dist between actual and predicted data point) but we don't know how good this fitted line is then R-Square come into picture which tells us the goodness of fit.

By definition R-square is variation explain by model divide by total variation, it seems complicated let's make it simple with an example.

Find below chart we are predicting Salary (dependent variable) with Experience in Years (Independent variable) and we are done with fitting the line so consider the dotted line as the best-fitted line.



Let's shift all the data points to the Y-axis to emphasize that, at this point, we are only interested in Salary.




Sum the squared residuals Just like in the least-squares, we measure the distance from the mean to the data point and square it, then add those squares together. We called this as "Sum of Squares residuals around the Mean"

SS(Mean) = (data point -Mean) **2

SS(Mean)= (12-7)**2 + (8-7)**2 + (6-7)**2 + (5-7)**2 + (4-7)**2 + (3-7)**2 = 56

Variation around the mean (Var(Mean)) =SS(Mean) / n ( n = Number of data points)

Var(Mean) = 56/6 = 9.33



Now, let's calculate the sum of the squared residuals around our least-square line or best fit line. We called this as "Sum of Squares residuals around the best-fitted line"

SS(Fit) = (data point - point on line)**2

SS(FIt) = (3 - 2)**2 + (4 - 3.9)**2 + (5 - 5.5)**2 + (6 - 7.2)**2 + (12- 10.2)**2 = 5.94

Variance around the Fitted line (Var( Fit)) = SS (Fit) /n ( n = Number of data points)

Var (Fit) = 5.94 /6 = 0.99

By this, we conclude that there is less variation around the line that we fit by least squares. We can say that some of the Variation in Salary is explained by taking Experience into accounts.

R-Squares tells us how much of the Variation in Salary explained by taking Experience into accounts.

R-Square = (Var (Mean)- Var(Fit)) / Var(Mean)

R-Square = (9.33-0.99) / 9.33 = 0. 89 = 89 %

We can say that an 89 % reduction in variance when we take the Experience into accounts. Alternatively, we can say that " Experience explains 89% of the variation in Salary"

R-Square measure between 0 and 1 which calculates how similar a regression line is to the data it’s fitted to. If it’s a 1, the model 100% predicts the data variance; if it’s a 0, the model predicts none of the variances.

 
 
 

Comentarios


About Me.

I'm a paragraph. Click here to add your own text and edit me. I’m a great place for you to tell a story and let your users know a little more about you.

  • Black Facebook Icon
  • Black Instagram Icon
  • Black Twitter Icon
Never Miss a Post!

Tesla Model X: software update turns gullwing into guillotine doors?

  • Facebook

  • Twitter

  • Google Plus

  • Reddit

  • Hacker News

 

Has Tesla disabled some of the object detection features of the falcon wing or gullwing doors on the Tesla Model X crossover? An owner has posted a series of YouTube videos of the door on a Model X neatly chopping in half a series of cucumber. This on a car that apparently got this week’s software release 7.1 2.32.100 downloaded automatically to his car.

Tesla more than any other automaker has used automatic, over-the-air software updates. It’s convenient for owners. It gets improvements and bug fixes installed far faster than a trip to the dealer. This may be hyper-useful if – if – someone hacks a car and an automaker needs to deliver a fix immediately. It also could change or disable a safety feature in ways an owner might not like, were he or she given a chance to learn about the change.

 

Gullwing / falcon wing doors are historically problematic

Over the decades, car doors that swing open with the hinge on top have been a challenge to keep aligned and easy to close. A gullwing door, as on the DeLorean (see “Back to the Future”), is a single-piece door. Tesla’s variant, which it calls a falcon wing, has a second hinge separating upper and lower halves, allowing it to open in tight spaces. It also means more components to align, and realign when they stop working properly.

The Tesla Model X has the falcon wing doors providing access to the middle and rear seating rows, and more traditional “self-presenting” doors in front.

Model X owners have complained about alignment and closing issues with the falcon wing doors. Sometimes the door won’t close, apparently because one of the multiple sensor sets believed something was in the way, what’s called a phantom object detection. In addition, owners were concerned that the initial setup of the remote key fob could open or close all doors with a single, inadvertent, button press.

Multiple changes in the recent software update

Listening to feedback from Tesla owners, Tesla automatically sent an over the air update this week that was automatically downloaded and installed. It addressed the inadvertant auto-open or -close issue with the key fob.

But it also appears to have disabled some of the functionality of pressure- and proximity-measuring sensors in the doors. The doors close with enough vigor to cut a medium-size cucumber in half, according to videos on the MeTV YouTube channel, and mash larger cucumbers. Whether a cucumber is analagous to a human arm or leg is difficult to say. (It isn’t, unless you have very soft bones. But the implications for your fingers are disturbing — Ed). At least in the videos, the door makes contact with larger objects and then reverses. Note that the voiceover on the videos suggests some cause-and-effect conclusions that might be seen in a different light by other testers.

An onscreen note inside the cockpit entitled What’s New in [software] Release 7.1 reads in part:

  • Falcon Wing Door closing behavior has been improved

  • The Falcon Wing Door will stop and open back up sightly if it encounters an obstacle while closing

Tesla’s modest response

Several media sites have queried Tesla. Tesla declined comment for a story in Automotive News.  We received this comment from Tesla, as did Jalopnik (same words): “We adjusted Model X Falcon Wing doors via a software update in order to improve closure consistency and reduce false detection of obstacles.”

  • Grey Facebook Icon
  • Grey Instagram Icon
  • Grey Twitter Icon

© 2023 by Extreme Blog. Proudly created with Wix.com

bottom of page