Save this video free

Lecture 9: Regression analysis

Professor Saad Explains · 1:15:12 · Watch on YouTube

Part of University of Utah CH EN 6400. See all 17 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Professor Saad distinguishes interpolation, which must pass through every data point, from regression, which fits a chosen model by minimizing prediction error, usually the sum of squared residuals. He demonstrates polynomial regression with NumPy's `polyfit` and `polyval`, then uses SciPy's `curve_fit` for user-defined models, including lake-bacteria decay, water's ion product, and temperature-dependent reaction rates.

Key takeaways

Chapters

0:00 Interpolation Review: High-Degree Polynomials and Cubic Splines
5:00 Interpolation Limits: Points, Degree, and Data Purpose
10:00 Why Scattered Measurements Call for Regression
11:00 Choose the Model Form Before Fitting Its Parameters
14:00 Least-Squares Regression Minimizes Squared Residuals
19:00 Use NumPy `polyfit` for Polynomial Regression
22:00 Inspect Femur-Length and Height Data Before Fitting
25:00 Fit and Plot a Height-versus-Femur Regression Line
30:00 Compare Polynomial Degrees and Watch for Overfitting
37:00 Linear Regression Depends on Coefficients, Not Curve Shape
41:00 SciPy `curve_fit` Fits User-Defined Model Functions
46:00 Fit Three-Rate Exponential Decay in Lake Bacteria Data
1:00:00 Fit Water's Ion Product with a Transformed Linear Model
1:09:00 Fit a Nonlinear Reaction-Rate Model and Assess Fit Quality

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:03 Good day everyone. Good to be back. I'm hoping you had a chance to look at the interpolation lectures. And I just ask you to to think of one to three questions or more if you want about interpolation that you would ask someone as if you're giving a quiz. Do you have something for me? Max? >> My question was why is it important to use a polynomial regression fit above like degree two or three? >> Okay. Did you hear that? So why should we avoid using high order interpolant polynomial interpolants that are higher than three? Why?

0:57 Pardon me? There's another reason. They're really cheap to compute. I mean the system of equations for these for these interpolants is really is really cheap. It's a great question, Andy. Exactly, exactly. A polynomial has as many roots as its degree. So a fifth order polynomial has five roots. A 10th order polynomial has 10 roots. Now not all roots are going to be real, but if they're all real, it means it has to cross the x-axis 10 times. And so there's a high risk as you go to higher order polynomials

1:46 that your polynomial is going to try to cross the x-axis to go through a root in between any one of those points that you're interpolating in between. And what happens if you did the with the lecture with that density, you'll get a negative density or negative values, unphysical values. Great question. What's another question? Yes. >> Poly val >> Oh, when would it be more useful to use poly val versus cubic spline? Good questions. I should have you guys

2:35 do the quizzes for the for the rest of the class. When? Actually, I'm going to take a minute to think about this myself.

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Professor Saad Explains.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.