compute_logLik: Compute the log-likelihood

Description Usage Arguments Value Examples

View source: R/fit_model.R

Description

This function is not actually used. It is a R replicate of the C++ function compute_logLikC that is actually used. It computes the log-likelihood.

Usage

1
compute_logLik(pred_prob, surv_bin, scale = 1L)

Arguments

pred_prob

The predicted probability of death computed by predictor()

surv_bin

The binary response variable taking 1 for alive and 0 for death

scale

The scaling parameter (useful if the optimisation function can only minimise)

Value

The scaled log-likelihood.

Examples

1
2
3
4
5
pmat <- build_param_matrix(param_values = c(0.1, 0.2), param_str = c("w1" = "s"))
dmat <- build_design_matrix(data = SurvEles_small, param_matrix = pmat)
p <- predictor(data = SurvEles_small, design_matrix = dmat)
compute_logLik(pred_prob = p, surv_bin = SurvEles_small$Alive, scale = 1L)
compute_logLikC(pred_prob = p, surv_bin = SurvEles_small$Alive, scale = 1L)

courtiol/SileR documentation built on May 16, 2020, 8:10 p.m.