Skip to contents

[Experimental]

This function takes a maxlogL model and computes the cumulative hazard function (CHF) using the estimated parameters.

Usage

cum_hazard.maxlogL(object, ...)

Arguments

object

an object of maxlogL class obtained by fitting a model with maxlogLreg.

...

further arguments for cum_hazard_fun..

Value

the expected value of the fitted model corresponding to the distribution specified in the y_dist argument of maxlogLreg.

Details

The CHF is computed by default using the following expression

$$H(x) = -\log \left( S(x|\hat{\theta})) \right),$$

where \(S(x|\hat{\theta})\) is the survival function using the estimated parameters. This method relies on the cdf, i.e, the pXXX function stored in R environment, where xxx is the name of the distribution.

Notice that CHF can be computed by integration

$$H(x) = \int_0^t h(s)ds$$

Just set up a support and set method = "integration".

See also

Author

Jaime Mosquera Gutiérrez, jmosquerag@unal.edu.co

Examples

library(EstimationTools)

#----------------------------------------------------------------------------
# Example 1: cumulative hazard function of a estimated model.
n <- 100
x <- runif(n = n, -5, 6)
y <- rnorm(n = n, mean = -2 + 3 * x, sd = 0.3)
norm_data <- data.frame(y = y, x = x)

formulas <- list(sd.fo = ~ 1, mean.fo = ~ x)
support <- list(interval = c(-Inf, Inf), type = "continuous")

norm_mod_maxlogL <- maxlogLreg(
  formulas, y_dist = y ~ dnorm,
  support = support,
  data = norm_data,
  link = list(over = "sd", fun = "log_link")
)

# Expected value
H <- cum_hazard.maxlogL(object = norm_mod_maxlogL)


#----------------------------------------------------------------------------