Gradient of the HLM loglikelihood.

chlm_grad(beta, gamma, y, delta, X, Z)

Arguments

beta

Mean parameter vector of length p.

gamma

Variance parameter vector of length q.

y

Vector of observations of length n.

delta

Optional logical vector of length n indicating the censorring status (TRUE: uncensored, FALSE: uncensored).

X

Mean covariate matrix of size n x p.

Z

Variance covariate matrix of size n x q.

Value

Vector of length p+q returning the gradient of the loglikelihood at the parameter values.