User:IssaRice/Convex function

From Machinelearning

a function is often defined to be convex if for all and all .

two ways to think about this:

  • if you want to use the idea that the set of wikipedia:convex combinations of two points is the line segment between them: take the points (x, f(x)) and (y, f(y)). then each convex combination has the form where t is between 0 and 1. so now we are saying that if we fix some x value tx + (1-t)y along this line segment, then the y value of the y segment, tf(x) + (1-t)f(y), is at least the y value of the function, f(tx + (1-t)y). in other words, the line segment between any two points lies above the function.
  • if you want to reason just from middle-school algebra: the line between (x, f(x)) and (y, f(y)) is given by . rewrite this as . if we consider just the line segment between the points, then . thus . so if we make the substitution we get . now you could say x and y are symmetric here, we could swap them around to get the thing in the definition of convex function, or you could substitute again, say s=1-t, to get it in the right form.
t measures what fraction of the distance from x to y we have traversed (just inspect its definition). the x-value for a given value of t is (just solve for z): . the y-value of the line segment at this point is (1-t)f(x) + tf(y) as we saw above. thus we are saying that the function value at this x-value, f((1-t)x + ty), is below the line segment's y-value, (1-t)f(x) + tf(y).