MATH 251 Lecture 28

From Notes
Jump to navigation Jump to search

« previous | Wednesday, April 4, 2012 | next »


Linear Regression

Given x, y, and you think y=f(x), but know nothing (this is where statistics comes in).

Observe a finite collection of data Pi=(xi,yi).

Data is assumed to be "noisy" (not 100% true). We want to reconstruct f(x)

In general, we need two things:

  1. A class of functions f(x)
  2. A measure F(f(x),Data) to be minimized

Linear Regression

Assume that our class is linear (i.e. f(x)=mx+b). We want the best choice for m and b: Least-Squares linear regression

Measure the deviation from f(x), so we need a function F that depends on f(x) and the data. Our goal is to minimize this function.

F(m,b)=∑i=1n(yi−f(xi))2=∑i=1n(yi−mxi−b)2

Calculate its gradient, set it to 0, and solve for m and b.

"this is on Wikipedia"

Quadratic Regression

Least-Squares Quadratic Regression let f(x)=ax2+bx+c, so F(a,b,c)=∑i=1n(yi−ax2−bx−c)2

Penalty Coefficient

Sometimes the data looks like a certain form, but could be something else. Introduce a penalty coefficient to check "fitness"


Line Integrals

Confused about Notation?


Given a curve C and a vector field F→(x,y), the line integral represents how much of the vector field F→ is in the direction of the curve C, like Work in physics.

Written: Calculate ∫CF→⋅dr→ (vector field notation) or ∫Cadx+bdy+cdz (differential form notation)

Example: C represents the unit circle going counter-clockwise, and F→=xı^+yȷ^

  1. Break into separate line regions (if necessary)
  2. Parameterize each line C: x(t)=cos⁡t, y(t)=sin⁡t, 0≤t≤2π
  3. Determine meaning of differential: dr→=dxı^+dyȷ^
  4. Plug in vectors into dot product: F→⋅dr→=xdx+ydy
  5. Set up integral with internal components (use chain rule): ∫Cxdx+ydy=∫02πx(t)(x′(t)dt)+y(t)(y′(t)dt)
  6. Evaluate: ∫02π(−cos⁡tsin⁡t+sin⁡tcos⁡t)dt=0

Example

C represents the triangle formed by (0,0), (1,0), and (1,1). Set up an integral for each line. (generally move counter-clockwise)

∫C1+∫C2+∫C3

Parameterization for each C:

  1. x(t)=t, y(t)=0, 0≤t≤1
  2. x(t)=1, y(t)=t, 0≤t≤1
  3. x(t)=1−t, y(t)=1−t, 0≤t≤1


Example

Let F represent a force field (like gravity). If the force is constant, then W=Fd. If the force changes for each point, use the integral to get a continuous sum of the Work at each point.