Professional Documents
Culture Documents
This Lecture Includes Convexity Linear Functions Polynomials Approximation by Polynomials
This Lecture Includes Convexity Linear Functions Polynomials Approximation by Polynomials
Convexity
Linear functions
Polynomials
Approximation by polynomials
Before we start...
A function is convex if, for any two points in its plot, the
straight line between both points is entirely above (or touch-
ing) the plot of the function.
Example 1
4 4
3 3
2 2
1 1
-2 -1 1 2 -2 -1 1 2
2 x
(a) f (x) = 2x (b) f (x) = 2
A function is concave if, for any two points in its plot, the
straight line between both points is entirely below (or touch-
ing) the plot of the function.
Example
-1
-2
-3
Side note
250
4
200
3
150
y
y
100
1
50
5 10 15 20 5 10 15 20
x x
16
14
5.0
12
4.5
10
y
y
8
4.0
6
3.5
4
10 15 20 25 10 15 20 25 30 35 40
x x
Linear functions
f (x) = mx + b
Examples
f (x) = 21 x − 1
f (x) = −2x + 3
f (x) = 1
Geometric interpretation of m and b
f (x) = mx + b
For each ’step’ to the right take m steps up (if m ≥ 0)
If m is negative, say m = −q, take q steps down instead
b is the y -coordinate where f intersects with the y -axis.
f (x) = 12 x − 1
Fitting a linear function through two data points
5
4
3
y
2
1
5 10 15 20
3 = m × 1 + b,
4 = m × 2 + b.
4 − 2m = 3 − m
3=m×1+b =1+b
Zeroes?
Bijection?
Convex/Concave?
Properties of linear functions
Bijection?
Convex/Concave?
Properties of linear functions
Convex/Concave?
Properties of linear functions
Mathematical model:
(
Pn = a − bQn ,
Qn+1 = c + dPn .
Mathematical model:
(
Pn = a − bQn ,
Qn+1 = c + dPn .
Examples
1
f (x) = x 3 + 2x 2 − x + 2 is a polynomial function of degree 3
f (x) = −0.3 is a polynomial function of degree 0
f (x) = 21 (x − 2)2 + 3 is a polynomial function of degree 2
Linear functions (with m 6= 0) are polynomials of degree 1
Sigma notation. Recall that we can also write
n
X
f (x) = ai x i .
i=0
Approximation with polynomials
In Theory
Suppose we are given n + 1 data points (x0 , y0 ), . . . , (xn , yn ).
We can always try to find a polynomial of degree n that
passes through all data points
This requires solving a system of n + 1 linear equations. We
will learn how to do that in a couple of weeks
In Practice
For very large data sets (large n) this might be unnecessarily
complicated and inefficient
We might permit some “noise” into the model – find simple
functions that are a reasonable approximation of data
How about these data points?
250
200
150
y
100
50
5 10 15 20
x
How about these data points?
250
200
150
y
100
50
5 10 15 20
20
400
15
y^(1/2)
300
y
200
10
100
5
0
5 10 15 20 25 30 35 5 10 15 20 25 30 35
x x
a × 22 + c = 4,
a × 42 + c = 10
4 − 4a = 10 − 16a.