cum_hazard.maxlogL | R Documentation |
maxlogLreg
model.This function takes a maxlogL
model and computes the cumulative
hazard function (CHF) using the estimated parameters.
cum_hazard.maxlogL(object, ...)
object |
an object of |
... |
further arguments for |
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"
.
the expected value of the fitted model corresponding to the
distribution specified in the y_dist
argument of
maxlogLreg
.
Jaime Mosquera GutiƩrrez, jmosquerag@unal.edu.co
Other maxlogL:
expected_value.maxlogL()
,
maxlogLreg()
,
maxlogL()
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)
#----------------------------------------------------------------------------
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.