Calculates minus the log likelihood function and its first and second order derivatives for data from a Weibull regression model.
phfunc(beta = NULL, lambda, p, X = NULL, Y, offset = rep(0, length(Y)),
ord = 2, pfixed = FALSE, dist = "weibull")
Regression parameters
The scale paramater
The shape parameter
The design (covariate) matrix.
The response, a survival object.
Offset.
ord = 0 means only loglihood, 1 means score vector as well, 2 loglihood, score and hessian.
Logical, if TRUE the shape parameter is regarded as a known constant in the calculations, meaning that it is not cosidered in the partial derivatives.
Which distribtion? The default is "weibull", with the alternatives "loglogistic" and "lognormal".
A list with components
The log likelihood. Present if ord >= 0
The score vector. Present if ord >= 1
The negative of the hessian. Present if ord >= 2
Note that the function returns log likelihood, score vector and minus hessian, i.e. the observed information. The model is