1 / 7

COMP 116: Introduction to Scientific Programming

COMP 116: Introduction to Scientific Programming . Lecture 13: So l ong Matrices. Regression recap. Linear Regression basics. Hypothesize a model y= mx+c Set it up as a linear system [x 1]*[m c]’ = y Solve (find model parameters m,c ) using Matlab w=Ab

foy
Download Presentation

COMP 116: Introduction to Scientific Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COMP 116: Introduction to Scientific Programming Lecture 13: So long Matrices

  2. Regression recap

  3. Linear Regression basics • Hypothesize a model • y=mx+c • Set it up as a linear system • [x 1]*[m c]’ = y • Solve (find model parameters m,c) using Matlab • w=A\b • Here w corresponds to the unknowns m,c • This returns the w that minimizes • sum((Aw-b).^2)

  4. Exercise 1: Fit a parabola • Hypothesisy=ax^2+bx+c • Find model parameters a,b,c • Plot x vs ax^2+bx+c • Matlab tip: Use>>hold on Download parabola.mat from lecture page

  5. Exercise II • Download midterm_points.mat from lecture page • Columns correspond to questions and rows to students • Find total points for each student (sum) • Plot histogram of total points (hist) • Find student who got more than 60% and less than 80% (find) • Find the least scoring question. Divide by total points. (min and mean) • Find the questions that had maximum, minimum variance respectively. Plot their histograms. (var)

  6. Advanced exercises: linear programming • How to assign weights to the questions so that the class minimum is maximized? • How to assign weights to the question so that the difference between the class minimum and maximum is maximized?

More Related