 # Logistic Functions

## Logistic Function Explained

The logistic function is a special kind of exponential function which typically models the exponential growth of a population. The logistic function also takes into account certain factors like the carrying capacity of land keeping in consideration that a definite area simply won't reinforce unlimited growth since when one population grows, its resources reduce. So a logistic function basically puts a limit on growth. In other words, a logistic function is exponential for olden days, but the growth declines as it reaches some limit.

### Interpretation of Logistic Function

Mathematically, the logistic function can be written in a number of ways that are all only moderately distinctive of each other. In this interpretation below,

S (t) = the population ("number") as a function of time,

t. t0 = the starting time, and the term (t - to) is just an adjustable horizontal translation of the logistic function.

B = criterion that influences the rate of exponential growth

K= the asymptote in horizontal or the limit on the population size

S(t) = $\frac{K}{(1+e^{-b(t-t_{0})})}$

### Meaning of Logistic Growth

Logistic growth can be easily delineated with a logistic equation. The logistic equation is of the mathematical form where the letters in the equation are constants that can also be adjusted/altered to match the condition being modeled. For the image below, you will have to solve for L, A, and E with the detail that is assigned to you in each problem. The constant L is specifically important since it is the limit to growth which is also frequently known as the carrying capacity.

The below given logistic function graph bears a carrying capacity of 10 which can be clearly seen from its graph.

### Why Sigmoid Function For Logistic Regression

So, one of the outstanding properties of logistic regression function is that the outputs of  sigmoid function results in the conditional probabilities of the anticipation, the class probabilities. So, let’s understand how it works? Let’s begin with the supposedly “odds ratio” p / (1 - p), which puts in detail the ratio between –the probability that a definite, positive, event happens and the probability that it doesn’t happen – where positive refers to the “event that we would want to anticipate”, which is., p(y=1 | x).

### Difference Between Logistic Function & Sigmoid Function

To have a better understanding of sigmoid in logistic function let’s get to learn

Logistic function vs. sigmoid function.

So,

### What Is Sigmoid?

A Sigmoid is a standard category of curves that “are S-shaped”. That’s the best way you can understand the sigmoid. In maths, we frequently use the term sigmoid to make reference to the logistic function, but that's actually only one example of a sigmoid. You should know that the “tanh function” also describes a sigmoid curve.

Tanh:

Equation:

F (x) = {ex} − e− {xex} + {e−x}

Range:

Break down the values in (−1,1) ,

0 at x = 0

### Reason For Use in Machine Learning:

It gained eminence as an activation function in neural networks as a significant substitute to the logistic function. It was also empirically discovered to steer to quicker convergence, debatably because of being anti-symmetric & zero-centralized and about the origin. It too suffers from disappearing gradients.

Let’s get going to use it for 1 billion ordinary random numbers in MATLAB

Gives off:-

7.80 seconds

### What is Logistic?

Logistic is a way of Getting a Solution to a differential equation by attempting to model population growth in a module with finite capacity. This is to say, it models the size of a population when the biosphere in which the population lives in has finite (defined/limited) resources and can only support population up to a definite size.

Equation

F (x) =11+ e−x

Range:

Break down the values in (0, 1)

### Reason For Use in Machine Learning

Conceptually optimal “activation” functions for “logistic regression” and Probability.

It also took immense recognition as an activation function because of its easy-to-calculate derivative:  f′(x) = f (x) × (1−f(x)} and its range of (0,1) . It does suffer from disappearing gradients too.

Let’s get going to use it for 1 billion ordinary random numbers in MATLAB (multi-paradigm Computer programming language)

Gives off:-

5.09 seconds

### Solved Example

Problem1:

Find out the logistic model mentioned hereunder c=7 and the points (0, 2) and (3, 5).

The 2 points provide 2 equations, and the logistic model has in possession two variables. Use the given points to solve for M and N.

Solution1:

2= 7/1+M

1+M = 7/2

Thus, M = 2.5

5 = 7/ 1+ (2.5) . N3

1+ (2.5) . N3 =7/5

N3= 0.16

N ~ 0.54329

Hence, the estimated model is

f (x) = 7/ 1+ (2.5) . (0.54329) x

### Fun Facts

• logistic regression is basically a unique kind of sigmoid function

• The logistic sigmoid as well as other sigmoid functions exists, for example, the hyperbolic tangent).

1. What are The Advantages Of Using Logistic Regression?

Logistic functions are considered as one of the easiest machine learning algorithms yet renders excellent efficiency. Since it has a low Variance, it can also be used for feature derivation. Logistic models can be effortlessly updated with new data executing stochastic gradient descent.

2. What are The Disadvantages Of Using Logistic Regression?

A Logistic function is unable to manage a large number of categorical variables well. Since, it needs transformation of non-linear features, thus, are not flexible enough to organically take captive of more complex connections.

3. When to Use Logistic Functions?

Logistic regression is the term used for the function executed at the core of the method, the logistic function. Logistic regression algorithm has its Implementation in python. You can also use Logistic regression when you seek to adjust odds ratio where you are aware of more than one risk factor.

4. What is A Logistic Regression Model?

The coefficients (Beta values b) of the logistic regression are carried out using the maximum-likelihood estimation. Maximum-likelihood estimation is described as a common learning algorithm which is employed by a number of machine learning algorithms, though it does make presumptions in context of distribution of the data.

An ideal coefficient would lead to a model that would anticipate a value very close to 0 (e.g. female) and a value very close to 1 (e.g. male) for the other class.