# loglikelihood.loglogistic

## loglikelihood.loglogistic(alpha : number, beta : number, x : number) 🡒 number, autodiff pure function

The logarithm of the likelihood of the loglogistic distribution. The first argument $\alpha$ is the scale of the loglogistic distribution, and also its median. It should be strictly positive. The second argument $\beta$ is the shape of the distribution, and should be strictly positive. The third argument is the observation. It should be strictly positive.

Example:

table T = extend.range(1000)
alpha0 = 1
beta0 = 2

// learn a parametric distribution from observations
T.X = random.ranvar(loglogistic(alpha0, beta0) into T)
autodiff T with
params alpha in [0.01 ..] auto
params beta in [0.01 ..] auto
return -loglikelihood.loglogistic(alpha, beta, T.X)

show summary "Regressed loglogistic distribution" a1b1 with alpha, beta


## loglikelihood.loglogistic(alpha : number, beta : number, x : number, isLowerBound : boolean) 🡒 number, autodiff pure function

Overload of the loglikelihood.loglogistic function. If isLowerBound is false, it computes the log-likelihood associated to $x$. If isLowerBound is true, it means that $x$ is the lower bound of the actual observation. In this case, the function computes the loglikelihood that the observation is greater than $x$. This overload is useful when one models the duration before an event (for example, a lead time model), since the isLowerBound input lets one utilize the information that an event has not occured yet.

Example:

table T = extend.range(1000)
alpha0 = 1
beta0 = 2

// learn a parametric distribution from lower bound observations
T.Observation = random.ranvar(loglogistic(alpha0, beta0) into T)
T.X = if T.Observation > 1.5 then 1.5 else T.Observation
T.IsLowerBound = if T.Observation > 1.5 then true else false
autodiff T with
params alpha in [0.01 ..] auto
params beta in [0.01 ..] auto
return -loglikelihood.loglogistic(alpha, beta, T.X, T.IsLowerBound)

show summary "Regressed loglogistic distribution" a1b1 with alpha, beta