Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Python: Help with bestfit line and outliers

  1. Jul 7, 2010 #1

    DMT

    User Avatar

    I've been having some trouble with outliers messing up my best fit line on my scatter plot in python. I'm using numpy's polyfit function to calculate the slope and y intercept of the best fit line, however I always seem to get one or two points which throw off the slope enough to make quite a noticeable difference. I've already checked a few python references and did a lengthy google search, but haven't found a solution. Does anyone know of a good way to fix this problem without having to limit the interval or physically remove the bad points from my data?

    Edit: Also, knowing a way to take errors into account would be very helpful as well.

    Thanks!
     
    Last edited: Jul 7, 2010
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: Python: Help with bestfit line and outliers
  1. Help in Python rk4 (Replies: 1)

  2. Basic python help? (Replies: 3)

Loading...