distribution of logT - mean in AFT models

Gumbel Distributed Error

Suppose that the error is Gumbel distributed, $\xi_i\sim Gumbel(1)$.

$$ \begin{aligned} p(\xi) &= \exp(-\xi - \exp(-\xi))\\ p(T) &= \exp(-(\log T - \mu) - \exp(-(\log T - \mu)))\times\frac{1}{T}\\ p(T) &= \frac{1}{T}\exp\left(\mu-\frac{1}{T}\exp(\mu)\right)\times\frac{1}{T}\\ p(T) &\propto \left(\frac{1}{T}\right)^2\exp\left(-\frac{1}{T}\exp(\mu)\right) \end{aligned} $$

Therefore, $T$ is Inverse Gamma distributed, such that $T\sim IG(1, \exp(\mu))$. The survival function in this case is (by using the identities that $\Gamma(1) = 1$ and $\Gamma(1,x) = \exp(-x)$: $$ \begin{aligned} p(T>t) &= 1 - \frac{\Gamma(1, \exp(\mu)/t)}{\Gamma(1)}\\ p(T>t) &= 1 - \exp\left(-\frac{\exp(\mu)}{t}\right) \end{aligned} $$

get_distribution[source]

get_distribution(dist:str)

Get the logpdf and logcdf of a given torch distribution

_, logicdf = get_distribution("Gumbel")
μs = np.log(np.arange(1, 5))
t = np.linspace(1e-3, 10)
for μ in μs:
    logT = np.log(t)
    ξ = torch.Tensor(logT - μ)
    S = torch.exp(logicdf(torch.Tensor(ξ), 1))
    plt.plot(t, S, label=f'μ = log {int(np.exp(μ))}')
plt.legend()
plt.grid()
plt.show()