Logistic log-loss function of one variable: Difference between revisions

From Calculus
No edit summary
Line 18: Line 18:


<math>f(x) = p \ln(1 + e^{-x}) + (1 - p) \ln (1 + e^x)</math>
<math>f(x) = p \ln(1 + e^{-x}) + (1 - p) \ln (1 + e^x)</math>
==Key data==
{| class="sortable" border="1"
! Item !! Value
|-
| default [[domain]] || all of <math>\R</math>, i.e., all reals
|-
| range || <math>[m, \infty)</math> where <math>m</math> is the minimum value, given as <math>-(p \ln p + (1 - p) \ln (1 - p))</math>.
|-
| [[local maximum value]] and points of attainment || No local maximum values
|-
| [[local minimum value]] and points of attainment || Local minimum value <math>-(p \ln p + (1 - p) \ln (1 - p))</math>, attained at <math>x = \ln\left(\frac{p}{1 - p}\right)</math>.
|-
| [[derivative]] || <math>g(x) - p</math> where <math>g</math> is the [[logistic function]]
|-
| [[second derivative]] || <math>g(x)(1 - g(x)) = g(x)g(-x)</math>
|-
| [[third derivative]] || <math>g(x)g(-x)(g(x) - g(-x)) = g(x)(1 - g(x))(1 - 2g(x))</math>
|}


==Differentiation==
==Differentiation==

Revision as of 21:11, 14 September 2014

Definition

The logistic log-loss function of one variable is obtained by composing the logarithmic cost function with the logistic function, and it is of importance in the analysis of logistic regression.

Explicitly, the function has the form:

f(x)=(pln(g(x))+(1p)ln(1g(x)))

where g is the logistic function and ln denotes the natural logarithm. Explicitly, g(x)=11+ex.

Note that 1g(x)=g(x), so the above can be written as:

f(x)=(pln(g(x))+(1p)ln(g(x)))

We restrict p to the interval [0,1]. Conceptually, p is the corresponding probability.

More explicitly, f is the function:

f(x)=pln(1+ex)+(1p)ln(1+ex)

Key data

Item Value
default domain all of R, i.e., all reals
range [m,) where m is the minimum value, given as (plnp+(1p)ln(1p)).
local maximum value and points of attainment No local maximum values
local minimum value and points of attainment Local minimum value (plnp+(1p)ln(1p)), attained at x=ln(p1p).
derivative g(x)p where g is the logistic function
second derivative g(x)(1g(x))=g(x)g(x)
third derivative g(x)g(x)(g(x)g(x))=g(x)(1g(x))(12g(x))

Differentiation

WHAT WE USE: chain rule for differentiation, Logistic function#First derivative

First derivative

We use that:

g(x)=g(x)(1g(x))=g(x)g(x)

or equivalently:

ddx(ln(g(x))=1g(x)=g(x)

Similarly:

ddx(ln(g(x))=g(x)

Plugging these in, we get:

f(x)=(p(1g(x))+(1p)(g(x)))

This simplifies to:

f(x)=g(x)p

Second derivative

Using the first derivative and the expression for g, we obtain:

f(x)=g(x)(1g(x))=g(x)g(x)

Note that the second derivative is independent of p.