MATH 2411 - Harrell If you must be wrong, how little wrong can you be? Lecture 13 Copyright 2013 by Evans M. Harrell II.
About the test Median was 35, range 25 to 40. As it is written:
About the test Percentiles: 90th: 40 75th: 38 50th: 35 25th: 32 Range: 25 to 40
This week s learning plan Some applications of optimization. Max and min problems in many constraints. Spherical and cylindrical coordinates Vector fields
How does the Army beta test correlate with the SAT? Source: army.mil
Error analysis and optimization You have a bucket of data {(x i, y i )}. They don t really fit on a line, but what is the best fit in the least-squares sense? You want to minimize i (y i -(mx i +b)) 2 But what are the %(@!! variables? ANSWER: m and b!
Error analysis and optimization So we take the gradient of the objective function f(m,b) := i (y i -(mx i +b)) 2 with respect to variables m and b!
Error analysis and optimization So we take the gradient of the objective function f(m,b) := i (y i -(mx i +b)) 2 with respect to variables m and b! Critical points when 0 = -2 i x i (y i -(mx i +b)) and 0 = -2 i (y i -(mx i +b))
Error analysis and optimization Rewrite 0 = -2 i x i (y i -(mx i +b)) and 0 = -2 i (y i -(mx i +b)) In the form of a linear system of equations like m + b = : ( i x i 2 )m + ( i x i ) b = i x i y i ( i x i )m + N b = i y i
Example Best linear fit to (0,1), (1, 3), (2,4) Calculate: N = 3 i x i = 3 i y i = 8 i x 2 i = 5 i x i y i = 11 m = 9/6, b = 7/6
x x x
Other best fits Best quadratic, cubic, etc. Best combination of sines and cosines ( Fourier series ). Other functions representing your preconceptions about the data.
Clicker quiz What is the maximum value of 3x + 4y when x 2 + y 2 = 25? A 5 B 24 C 25 D (24) 1/2 E none of the above.
The Lagrange condition Assuming f and C are smooth, at a boundary maximum point x 0 where g(x 0 ) 0, f(x 0 ) = λ g(x 0 ) for some scalar value λ.
What if we have more than one constraint?
Example The intersection of two planes, such as x + 2 y - 3 z = 6 and x + y + z = 1 is a line. What is the closest point on the line to the origin?
Lagrange with two constraints Assuming f is smooth, and constrained by two smooth functions, g(x) = 0, and h(x) = 0. Lagrange s condition for a doubly constrained critical point is f(x 0 ) = λ g(x 0 ) + µ h(x 0 ) for some scalar values λ and µ.
Example The intersection of two planes, such as x + 2 y - 3 z = 6 and x + y + z = 1 is a line. What is the closest point on the line to the origin?
Example Objective function: f(x,y,z) = x 2 +y 2 +z 2 Lagrange says: 2xi + 2yj + 2zk = λ (1i+2j-3k) + µ (1i+1j+1k) Five unknowns (x,y,z,λ,µ). This vector equation represents three scalar eqns. We need two more
Lagrange conditions constraints
Coordinate systems if you are not square Cylindrical = polar plus z Spherical = geographic coordinates plus radius
Coordinate systems if you are not square Cylindrical = polar plus z r = distance from vertical axis, 0 r θ = angle, any range of length 2π z = height, - < z <
Coordinate systems if you are not square Cylindrical to Cartesian: x = r cos θ y = r sin θ z = z
Coordinate systems if you are not square Cartesian to Cylindrical : r = (x 2 + y 2 ) 1/2 θ = arctan(y/x) z = z
Coordinate systems if you are not square Spherical = geographic plus ρ ρ = distance from origin θ = polar angle in xy plane = longitude φ = angle from pole, colatitude
Coordinate systems if you are not square Cartesian to spherical: ρ = (x 2 + y 2 + z 2 ) 1/2 tan θ = y/x; or cot θ = x/y; or cos θ = x/(x 2 +y 2 ) 1/2 cos φ = z/(x 2 + y 2 + z 2 ) 1/2
Coordinate systems if you are not square Spherical to cylindrical: r = ρ sin φ θ = θ z = ρ cos φ
Coordinate systems if you are not square Spherical to Cartesian: x = ρ sin φ cos θ y = ρ sin φ sinθ z = ρ cos φ
Nice application How far is it by the shortest air route from Atlanta to Moscow? Atlanta latitude=33.640200544698 longitude= -84.418068587706 Moscow latitude=55.57751294796784 Longitude=37.76779917676628
Nice application How far is it by the shortest air route from Atlanta to Moscow? Note: ρ = 6378.137 km Atlanta φ = colatitude=.98366 sin φ =.8325, cos φ =.5540 θ = longitude= -1.4734 sin θ = -.9953, cos θ =.0973
Nice application How far is it by the shortest air route from Atlanta to Moscow? Note: ρ = 6378.137 km Moscow φ = colatitude=.60079 sin φ =.5653, cos φ =.8249 θ = longitude=.65917 sin θ =.6125, cos θ =.7905
Nice application How far is it by the shortest air route from Atlanta to Moscow? Note: ρ = 6378.137 km Atlanta x = ρ (.8325)(.0973) =.0810 y = ρ (.8325)(-.9953) = -.8286 z = ρ (.5540)
Nice application How far is it by the shortest air route from Atlanta to Moscow? Note: ρ = 6378 km Moscow x = ρ (.5653)(.7905) =.4469 y = ρ (.5653)(.6125) =.3462 z = ρ (.8249) Cos(α) =.4469*.0810 +.3462*(-.8286) +.8249*.5540 α = 1.36297, dist = 6378 α = 8693 km.
Unit vectors for curvilinear coordinate systems