Skip to content

add logit and cloglog link functions and inverses #79

@geryan

Description

@geryan
inverse_cloglog <-function(loglambda){
  1 - exp(-exp(loglambda))
}


p <- seq(from = 0, to = 1, by = 0.1)
x <- seq(from = -10, to = 10, by = 2)

# link: probability to natural
# logit
# use logit for 0,1 outcomes
log(p/(1-p))

# cloglog
# cloglog(x) equals the log of the expected distribution of count data following
# a poisson distribution
log(-log(1 - p))

# inverse link: natural to probability
# inverse logit
exp(x)/(1 + exp(x))
1/(1 + exp(-x)) # same

#icloglog
1 - exp(-exp(x))

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions