Distributions on a Logarithmic Scale
In this post, I want to explore the logarithmic analogues of the normal and Laplace distributions. We can define a log-normal probability distribution as a distribution in which its logarithm is normally distributed. Likewise, a log-Laplace distribution is a distribution whose logarithm has a Laplace distribution. If we have a given probability density function, how can we determine its logarithmic equivalent?
Determining the Logarithmic Equivalent
Suppose we have a continuous random variable. We can define the cumulative distribution function of the random variable like this:
Let’s also assume we know the probability density function of the random variable. The density function is the derivative of the cumulative distribution function. We can define the cumulative distribution function based on the probability density function like this:
The probability of observing a realization of the random variable in a range between two points can be expressed like this:
Now suppose we have two continuous random variables. The probability distribution of one is the logarithm of the other:
Our goal is to derive the density function of one based on the density function of the other. Let’s use the following notation:
With this notation, we can express the relationship between these two distributions using the following equation:
The substitution rule for integration can be used to evaluate this further. Let’s consider the following substitution:
Let’s also consider its derivative:
Plugging in the substitution, we can compute the probability of observing the random variable between two points on a logarithmic scale like this:
The substitution rule for definite integrals gives us the following identity:
With this, we can compute the same probability of observing the random variable between two points, but this time on a linear scale:
We can now state the following solution:
Using these steps, we can determine the logarithmic equivalent of any continuous distribution for which we know the formula for the probability density function.
The Log-Normal Distribution
To give an example, we can use the probability density function for the normal distribution to determine the probability density for the log-normal distribution. Recall the density function for the normal distribution:
The logarithmic equivalent is:
If we have a set of samples of a random variable that we know the have a log-normal distribution, the parameters of the distribution can be estimated using the maximum likelihood method outlined in my previous post. I’ll skip the intermediate steps and jump straight to the results.
Here is the estimate for the mean:
Here is the estimate for the standard deviation:
Not surprisingly, the formulas to compute the parameter estimates for the log-normal distribution are nearly the same as those of the normal distribution. The only difference is that we take the logarithm of the observed data points.
The Log-Laplace Distribution
The logarithmic equivalent of the Laplace distribution can be found in the same way as the logarithmic equivalent of the normal distribution. Consider the probability density function for the Laplace distribution:
The logarithmic equivalent is:
If we have a set of samples of a random variable that we know to have a log-Laplace distribution, the parameters can be estimated as before using the maximum likelihood method. You can see my previous post for full details. We first need to rank the samples in ascending order:
We also need to determine the middle value:
Here is the estimate for the location parameter:
Here is the estimate for the scale parameter:
Once again, the formulas to compute the parameter estimates for the log-Laplace distribution are nearly the same as those of the regular Laplace distribution. For the logarithmic equivalent, we simply take the logarithm of the observed data points.
Comparison
When plotted on a graph, the probability density function for the log-normal distribution looks like a distorted version of the normal distribution’s density function. This isn’t too surprising. What’s interesting to me, however, is the shape of the log-Laplace density function. It looks like a skateboard ramp:
The flat top of the log-Laplace density function looks peculiar. I wasn’t expecting it, and I initially thought I had made a mistake when generating the chart. However, the flat part only exists when the scale parameter is set to the standard value of one. The shape of the graph changes as the scale parameter is adjusted up or down. Take a look at the same chart when the horizontal axis has a logarithmic scale:
Notice how the shape of the log-normal density function looks very much like the symmetrical shape of the regular normal distribution. This trait does not exist for the log-Laplace distribution, however. When plugging in smaller values for the scale parameter, the shape of the log-Laplace density function tends to have a closer resemblance to that of the regular Laplace distribution, but it doesn’t exhibit the same symmetry.
Comments