# Obtaining the Log-logistic distribution from a truncated logistic distribution

Let $$f(x) = \frac{e^x}{(1+e^x)^2}~,~ -\infty \lt x \lt \infty~~~~~(1)$$ be the standard logistic pdf of a random variable $X$. Then one can obtain the pdf of the log-logistic distribution via the transformation $$\log T = Y = a+bX ~,~b\gt 0~,~ -\infty \lt a \lt \infty~$$ as $$f(t) = \frac{1}{bt} \cdot \frac{\exp\left(\frac{\log t - a}{b}\right)}{\left( 1 + \exp\left( \frac{\log t - a}{b} \right)\right)^2}~,~ t\gt 0 ~~~~~~~(2).$$ Now Consider the logistic distribution truncated at $0$. Its pdf is given by $$\frac{2e^x}{(1+e^x)^2}~,~ 0 \lt x \lt \infty~~~~(3).$$

Is there a transformation that can be used to obtain the log-logistic distribution from $(3)$?

• without more precisions, the answer is yes since you can always transform a logistic variate restricted to $(0,\infty)$ into a regular logistic variate by multiplying it by a random sign, i.e., $\pm 1$ with probability $1/2$. – Xi'an Feb 2 '15 at 16:39

## 1 Answer

Step 1: Transform the half-logistic to an ordinary logistic

i) Xi'an suggests attaching a random sign. That will work, producing a result with the desired distribution

ii) I presume, however, that you want a monotonic (order-preserving) transformation. You can transform a continuous random variable $X$ with distribution function $F$ to one with distribution $G$ by taking the transformation $G^{-1}(F(X))$ (given $G$ is invertible). This works perfectly well in your case:

Step 2: then follow your transformation from ordinary logistic to log-logistic

$\,$

Here's some code in R that will do the transformation from half-logistic to logistic:

z <- rlogis(10000)   # z is ~logistic
x <- abs(z)          # x is half-logistic
u <- plogis(x)*2-1   # probability integral transform
y <- qlogis(u)       # inverse-cdf for desired distribution