Lineare Regression mit kleinsten Quadraten

Statistical Thinking in Python (Teil 2)

Justin Bois

Lecturer at the California Institute of Technology

US-Swing States: Wahlergebnisse 2008

ch1-2.002.png

1 Daten von Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Teil 2)

US-Swing States: Wahlergebnisse 2008

ch1-2.004.png

1 Daten von Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Teil 2)

US-Swing States: Wahlergebnisse 2008

ch1-2.007.png

1 Daten von Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Teil 2)

US-Swing States: Wahlergebnisse 2008

ch1-2.008.png

1 Daten von Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Teil 2)

Residuen

ch1-2.010.png

1 Daten von Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Teil 2)

Methode der kleinsten Quadrate

  • Das Verfahren, Parameter zu finden, die die Summe der Quadrate der Residuen minimieren
Statistical Thinking in Python (Teil 2)

Kleinste Quadrate mit np.polyfit()

slope, intercept = np.polyfit(total_votes,
                              dem_share, 1)

slope
4.0370717009465555e-05
intercept
40.113911968641744
Statistical Thinking in Python (Teil 2)

Lass uns üben!

Statistical Thinking in Python (Teil 2)

Preparing Video For Download...